fix(server): avoid return total row on aging summary reports if no customers

This commit is contained in:
Ahmed Bouhuolia
2023-08-27 00:45:12 +02:00
parent b9be83dc2b
commit 0d57ca88bf

View File

@@ -164,7 +164,10 @@ export default abstract class AgingSummaryTable extends R.compose(
* @returns {ITableRow[]}
*/
public tableRows = (): ITableRow[] => {
return R.compose(R.concat(this.contactsRows), R.prepend(this.totalRow))([]);
return R.compose(
R.unless(R.isEmpty, R.append(this.totalRow)),
R.concat(this.contactsRows)
)([]);
};
// -------------------------