Skip to content

Bug 651508: [29.0] ICM 51000002083463: Close Income Statement duplicates or omits mixed LCY/USD amounts with Balance closing, with and without global dimensions - #12769

Merged
ventselartur merged 5 commits into
releases/29.0from
backport/releases/29.0/651508
Oct 22, 2026
Merged

ventselartur merged 5 commits into
releases/29.0from
backport/releases/29.0/651508

Conversation

@ventselartur

@ventselartur ventselartur commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #11894 for AB#651508

Backport-Source: github:#11894
Backport-Target: BCApps:releases/29.0
Backport-Path-Set: 619360cade099740fe14264a176158d22de189784300f6b8c31790e455439333
@ventselartur
ventselartur requested a review from a team October 13, 2026 13:34
@ventselartur
ventselartur requested a review from a team as a code owner October 13, 2026 13:34
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Oct 13, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Oct 13, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

This backport fixes Close Income Statement when blank and nonblank source-currency groups are interleaved in G/L entry order. It replaces positional row skipping with a per-account set that processes each filtered group once, and it sums the source-currency amount and VAT amount for the complete group.

The group identity keeps the existing source-currency, business-unit, and selected-dimension filters. It is reset for each G/L account, so later records from the same group are skipped without losing other groups. The report logic is aligned across W1, ES, and IT, and the tests cover exact closing totals, dimensions, retained earnings, posting, repeated closing, and source-currency totals.

Problem-solution fit

Fit: Strong

The change directly removes the assumption that filtered source-currency entries are contiguous. It covers both the duplicated or omitted closing amounts and the incomplete source-currency totals that can affect later closing runs.

Suggestions

None.

Risk assessment and necessity

Risk: This is a financially sensitive year-end closing path. The change is limited to grouping and amount aggregation, changes no public or event surface, matches the validated mainline patch, and has focused regression coverage in the affected regional layers. The current build has no failing checks, although a small number of test jobs were still running at review time.

Necessity: Without this change, interleaved currency groups can create incorrect income-statement and retained-earnings amounts. A targeted backport is justified because the defect affects posted financial closing results and the implementation preserves the existing grouping criteria.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=12769 round=1 by=alexei-dobriansky at=2026-10-13T19:08:44Z lastSha=5a74a020ec0dba78ad3586e869311a228a441882 reviewKey=882b56057b31f1b9246738854ca3bbb77544d41ee735d8124fbd234e4ceded16 suggestions=

Create an isolated source currency with a deterministic 0.25 exchange rate effective from the fiscal-year start, removing dependency on demo USD rates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 77a301b0-00ce-45a1-b98d-b8e078f1adaa
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 2

Recommendation: Accept

What this PR does

The new commit makes the mixed-currency regression tests independent of demo currency data. Each fixture now creates its own source currency and a deterministic exchange rate effective from the fiscal-year start, and the test descriptions no longer assume a specific currency code.

The rate covers every posting date used by the scenarios and matches the explicit source-currency amounts set by the posting helper. The W1, CH, and IT test changes are identical, and the production report logic is unchanged since round 1.

Status of previous suggestions

No suggestions were raised in round 1.

New observations (commits since round 1)

None.

Risk assessment and necessity

Risk: This remains a financially sensitive year-end closing path, but the new commit changes only deterministic test setup. The same patch is present in all three test copies. No current check reports a failure; 142 have passed and 23 are still running.

Necessity: The test isolation is needed because relying on a pre-existing named currency and its demo exchange rates can make the regression tests environment-dependent. The production fix remains necessary to prevent incorrect closing and retained-earnings amounts.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=12769 round=2 by=alexei-dobriansky at=2026-10-19T13:36:34Z lastSha=2e43e5a47038dd4a5537cc293b5a7b5f94cbf862 reviewKey=777627fd343e2648653637047753c333fc98a697b35fce511f58cd77e1975568 suggestions= parentRound=1

Align the localized request-page value queue and use the retained earnings account selected by the IT report.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c30597be-a58b-4f56-8e03-a2d16659ef63
(cherry picked from commit 1deed91)
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 3

Recommendation: Accept

What this PR does

The latest commit fixes the Italy test adaptation for the localized Close Income Statement request page. The new scenarios now queue values for the balancing, net-profit, and net-loss fields in the order consumed by the handler, and they use an account from the retained-earnings category for the expected balance line.

The change is limited to the Italy test code. It matches the localized report fields, keeps the production fix unchanged, and preserves the test intent from the other country versions.

Status of previous suggestions

No suggestions were raised in round 2.

New observations (commits since round 2)

None.

Risk assessment and necessity

Risk: This remains a financially sensitive year-end closing path, but the latest commit changes only localized test setup. The request-page queue now matches the Italy-specific handler, the account lookup matches the report's retained-earnings selection rule, and the patch is identical to the corresponding mainline fix. No public or production behavior changed in this round.

Necessity: The Italy tests need localized request-page inputs and the account that the localized report uses for the balance entry. Without this adjustment, the backport's regression coverage can fail for test-setup reasons instead of validating the closing calculation.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=12769 round=3 by=alexei-dobriansky at=2026-10-20T13:19:31Z lastSha=a1c04941be2684d7c7a69a08afc0deacde36e90d reviewKey=a720f0838e56a7cb0c74de2018d9c97d72205654516a93eb9739a3de3c23eb12 suggestions= parentRound=2

Use the account category totaling filter instead of filtering on fields without keys.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8716f85d-9b36-4a18-9a38-10f368725094
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 4

Recommendation: Accept

What this PR does

The latest commit changes only the Italy regression-test lookup for the retained-earnings account. It now scans the account categories and uses each matching category's generated G/L account filter instead of filtering directly on classification fields that have no supporting key.

The resulting helper is identical to the source PR. It returns an account assigned to an Equity / Retained Earnings category, keeps the localized request-page setup intact, and does not change the production closing logic reviewed in the earlier rounds.

Status of previous suggestions

No suggestions were raised in round 3.

New observations (commits since round 3)

None.

Risk assessment and necessity

Risk: This remains a financially sensitive year-end closing scenario, but the new commit is limited to test setup. The category filter is generated from the accounts assigned to that category, the backport matches the source change, and no production or public surface changed. CI has no reported failure, although several build jobs are still running.

Necessity: The localized regression tests need a reliable retained-earnings account lookup. Using the category's account filter avoids depending on unsupported lookup keys while preserving the test's intent to exercise the account accepted by the report.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=12769 round=4 by=alexei-dobriansky at=2026-10-20T19:36:03Z lastSha=c7999d239a43df3df565ea3a13aec360f971e6ca reviewKey=9cf3df811754a2717f17a3b37fcc88ac7e71baf233a529489c53dc772be84fdf suggestions= parentRound=3

Carry explicit field loading, IT Details-mode balancing and currency test setup.
Source: #11894
Source-Commit: ca05fec

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dbbaa964-123c-4b63-96ec-693923084c12
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 5

Recommendation: Accept

What this PR does

This backport fixes incorrect year-end closing amounts when blank and nonblank source-currency groups are interleaved. The latest commit explicitly loads the G/L entry fields used by the W1, Spain, and Italy reports, uses the standard currency helper in the regression fixtures, and corrects Italy's Details-mode test setup and balancing checks.

The field list covers the amounts, source-currency values, business unit, and dimensions used by grouping and journal creation. It leaves the grouping and posting decisions unchanged. Italy's request-page choices and assertions now follow its localized retained-earnings balancing behavior.

Problem-solution fit

Fit: Strong

Processing each currency group once addresses the duplicate and omitted amounts. The tests check exact closing totals, balanced journals, selected dimensions, and zero income-account balances after posting; the latest changes preserve those checks.

Status of previous suggestions

No suggestions were raised in round 4.

New observations (commits since round 4)

None.

Risk assessment and necessity

Risk: Year-end closing is financially sensitive, but this incremental change is narrow. The three BaseApp report implementations remain aligned on field loading, and the localized test handlers preserve their distinct Balance/Details behavior. No public procedure or event signature changes. Both independent review samples found no new issue. The current CI reports 166 successful checks and two skipped checks; these include app and unit-test builds, not proof that the regression tests ran. No local AL build or runtime test was executed during this review.

Necessity: Without the grouping fix, interleaved source currencies can transfer the wrong amounts to retained earnings and leave income accounts incorrectly closed. Explicit field loading and reliable localized fixtures support that fix without broadening its production scope.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=12769 round=5 by=alexei-dobriansky at=2026-10-22T15:33:52Z lastSha=467e8b11e1899ad162dfb7a31370f2a94c555416 reviewKey=1b2b15e8e6543bffa89383f9b0f27082e2f768e2330f8530705b9a4711a0ba0a suggestions= parentRound=4

@ventselartur
ventselartur merged commit ac3b484 into releases/29.0 Oct 22, 2026
330 of 332 checks passed
@ventselartur
ventselartur deleted the backport/releases/29.0/651508 branch October 22, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants