fix(server): Trial balance total row shouldn't show if accounts have no balances

This commit is contained in:
Ahmed Bouhuolia
2024-02-05 23:04:02 +02:00
parent d6d67b9a51
commit 528d447443
2 changed files with 2 additions and 6 deletions

View File

@@ -252,10 +252,6 @@ export default class TrialBalanceSheet extends FinancialSheet {
* @return {ITrialBalanceSheetData}
*/
public reportData(): ITrialBalanceSheetData {
// Don't return noting if the journal has no transactions.
if (this.repository.totalAccountsLedger.isEmpty()) {
return null;
}
// Retrieve accounts nodes.
const accounts = this.accountsSection(this.repository.accounts);

View File

@@ -46,7 +46,7 @@ export class TrialBalanceSheetTable extends R.compose(
this.query = query;
this.i18n = i18n;
}
/**
* Retrieve the common columns for all report nodes.
* @param {ITableColumnAccessor[]}
@@ -123,7 +123,7 @@ export class TrialBalanceSheetTable extends R.compose(
*/
public tableRows = (): ITableRow[] => {
return R.compose(
R.append(this.totalTableRow()),
R.unless(R.isEmpty, R.append(this.totalTableRow())),
R.concat(this.accountsTableRows())
)([]);
};