fix(server): hotbug retireving empty results of inventory valuation and sales by items sheets

This commit is contained in:
Ahmed Bouhuolia
2024-01-21 14:34:36 +02:00
parent d052c23560
commit abffdd1029
4 changed files with 12 additions and 8 deletions

View File

@@ -259,6 +259,6 @@ export class InventoryValuationSheet extends FinancialSheet {
const items = this.itemsSection();
const total = this.totalSection(items);
return items.length > 0 ? { items, total } : {};
return { items, total };
}
}

View File

@@ -84,7 +84,9 @@ export class InventoryValuationSheetTable extends R.compose(
const itemsRows = this.itemsRowsMapper(this.data.items);
const totalRow = this.totalRowMapper(this.data.total);
return [...itemsRows, totalRow];
return R.compose(
R.when(R.always(R.not(R.isEmpty(itemsRows))), R.append(totalRow))
)([...itemsRows]) as ITableRow[];
}
/**