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

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