mirror of
https://github.com/frappe/books.git
synced 2024-12-24 20:00:29 +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)
|
||||
.getFormulaFields();
|
||||
if (formulaFields.length) {
|
||||
let value = this[tablefield.fieldname];
|
||||
//if this[table.fieldname] doesnt have value, skip it
|
||||
if (value == null || value == undefined)
|
||||
continue;
|
||||
|
||||
// for each row
|
||||
for (let row of this[tablefield.fieldname] || []) {
|
||||
const value = this[tablefield.fieldname]??[];
|
||||
for (let row of value) {
|
||||
for (let field of formulaFields) {
|
||||
if (shouldApplyFormula(field, row)) {
|
||||
let val = await this.getValueFromFormula(field, row);
|
||||
|
Loading…
Reference in New Issue
Block a user