Skip to content

fix for edge case when balance of a posting account at ending date is zero#8836

Open
mynjj wants to merge 4 commits into
releases/28.xfrom
bugs/tb-totaling-accs-28.x
Open

fix for edge case when balance of a posting account at ending date is zero#8836
mynjj wants to merge 4 commits into
releases/28.xfrom
bugs/tb-totaling-accs-28.x

Conversation

@mynjj

@mynjj mynjj commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Work item: AB#640630

Summary

Backport of the fix for the edge case where a posting account's balance at the ending date is zero.

The query-based Trial Balance path previously skipped any account/dimension combination whose values netted to zero (CheckAllZero). But the underlying query only returns combinations that actually have entries, so a zero net change still represents real (offsetting) turnover that should be shown. This change inserts every combination the query returns in the first pass, so the second (opening-balance) pass can correctly adjust those that also have an opening balance — preserving correct debit/credit splits when the end balance nets to zero.

Changes

  • src/Apps/W1/ExcelReports/App/src/Financials/TrialBalance.Codeunit.al
  • src/Apps/W1/ExcelReports/Test/src/TrialBalanceExcelReports.Codeunit.al

Tests updated/added:

  • QueryPathIncludesAccountsThatNetToZero
  • QueryPathReportsCorrectDebitCreditSplitsForZeroEndBalance

Cherry-picked from bugs/tb-totaling-accs (commits 470ad7c8, d24a08cf, 09e70035).

@mynjj mynjj requested a review from a team June 26, 2026 11:12
@mynjj mynjj requested a review from a team as a code owner June 26, 2026 11:12
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jun 26, 2026
@github-actions github-actions Bot added this to the Version 28.3 milestone Jun 26, 2026
…Data

The buffer parameter of InsertTrialBalanceReportData is non-temporary, so the
test's local record cannot be temporary; AA0237 forbids the Temp prefix on a
non-temporary variable. Rename to TrialBalanceData to match the rest of the file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant