mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
refactor: use nullish coalescing
This commit is contained in:
parent
6b23aeb986
commit
c4b0395b42
@ -435,13 +435,8 @@ module.exports = class BaseDocument extends Observable {
|
|||||||
.getMeta(tablefield.childtype)
|
.getMeta(tablefield.childtype)
|
||||||
.getFormulaFields();
|
.getFormulaFields();
|
||||||
if (formulaFields.length) {
|
if (formulaFields.length) {
|
||||||
let value = this[tablefield.fieldname];
|
const value = this[tablefield.fieldname]??[];
|
||||||
//if this[table.fieldname] doesnt have value, skip it
|
for (let row of value) {
|
||||||
if (value == null || value == undefined)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// for each row
|
|
||||||
for (let row of this[tablefield.fieldname] || []) {
|
|
||||||
for (let field of formulaFields) {
|
for (let field of formulaFields) {
|
||||||
if (shouldApplyFormula(field, row)) {
|
if (shouldApplyFormula(field, row)) {
|
||||||
let val = await this.getValueFromFormula(field, row);
|
let val = await this.getValueFromFormula(field, row);
|
||||||
|
Loading…
Reference in New Issue
Block a user