mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: correct trial balance sheet filtering logic
- Include child account transactions when filtering parent accounts - Fix order of operations in accounts section mapping - Ensure accounts with child transactions are not incorrectly filtered out Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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<Account>[]) {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user