diff --git a/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts b/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts index 1cee9693a..790c69800 100644 --- a/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts +++ b/packages/server/src/modules/FinancialStatements/modules/TrialBalanceSheet/TrialBalanceSheet.ts @@ -172,8 +172,11 @@ export class TrialBalanceSheet extends FinancialSheet { private filterNoneTransactions = ( accountNode: ITrialBalanceAccount ): boolean => { - const accountLedger = this.repository.totalAccountsLedger.whereAccountId( - accountNode.id, + const depsAccountsIds = + this.repository.accountsDepGraph.dependenciesOf(accountNode.id); + + const accountLedger = this.repository.totalAccountsLedger.whereAccountsIds( + [accountNode.id, ...depsAccountsIds] ); return !accountLedger.isEmpty(); }; @@ -241,8 +244,8 @@ export class TrialBalanceSheet extends FinancialSheet { */ private accountsSection(accounts: ModelObject[]) { return R.compose( - this.nestedAccountsNode, this.accountsFilter, + this.nestedAccountsNode, this.accountsMapper )(accounts); } @@ -250,7 +253,6 @@ export class TrialBalanceSheet extends FinancialSheet { /** * Retrieve trial balance sheet statement data. * Note: Retruns null in case there is no transactions between the given date periods. - * * @return {ITrialBalanceSheetData} */ public reportData(): ITrialBalanceSheetData {