2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

refactor: use nullish coalescing

This commit is contained in:
18alantom 2021-10-20 12:28:09 +05:30
parent 6b23aeb986
commit c4b0395b42

View File

@ -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);