feat: general ledger closing balance with accounts row

This commit is contained in:
Ahmed Bouhuolia
2024-06-06 18:42:07 +02:00
parent 5dbfd36415
commit 10fcf94c92
4 changed files with 99 additions and 31 deletions

View File

@@ -272,10 +272,14 @@ export class GeneralLedgerTable extends R.compose(
const closingBalanceWithSubaccounts =
this.closingBalanceWithSubaccountsMapper(account);
// Appends the closing balance with sub-accounts row if the account
// has children accounts and the node is define.
const isAppendClosingSubaccounts = () =>
account.children?.length > 0 && !!account.closingBalanceSubaccounts;
const children = R.compose(
// Appends the closing balance with sub-accounts row if the account has children accounts.
R.when(
() => account.children?.length > 0,
isAppendClosingSubaccounts,
R.append(closingBalanceWithSubaccounts)
),
R.concat(R.defaultTo([], transactions)),