[Master]-]G/L Account Sheet with Foreign Currency report (11564) includes LCY-originated entries after enabling G/L currency revaluation feature resulting in mixed-currency totals in the Swiss version. - Copy - #10041
Conversation
Agentic PR Review - Round 1Recommendation: AcceptWhat this PR doesReport 11564 "SR G/L Acc Sheet Foreign Curr" was accumulating The fix wraps the three assignments ( SuggestionsNo suggestions. Risk assessment and necessityRisk: Low and isolated. The change is inside Necessity: The bug is triggered in production when the G/L currency revaluation feature is on, causing mixed-currency totals that are clearly wrong. The fix is minimal, targeted, and mirrors the pattern already used for the provisional journal-line section of the same report.
|
| FcyAcyAmt := "Source Currency Amount"; | ||
| FcyAcyBalance := FcyAcyBalance + "Source Currency Amount"; | ||
| Exrate := CalcExrate("Source Currency Amount", Amount, "G/L Account"."Source Currency Code"); | ||
| if ("Source Currency Code" <> '') and ("Source Currency Code" = "G/L Account"."Source Currency Code") then begin |
There was a problem hiding this comment.
Report 11564 now zeros FcyAcyAmt/Exrate (and therefore leaves the running foreign-currency balance at zero) for every G/L account whose "Source Currency Posting" is "Multiple Currencies", because those accounts keep "Source Currency Code" blank (per GLAccount.Table.al field 20, that field only holds a value for "Same Currency" posting). This is a shipped behavior change for existing CH customers: entries that previously populated the foreign-currency columns will disappear from the report after upgrade, which can break established reconciliations or exports built against the previous output. Consider preserving prior output for registered multi-currency accounts (e.g. by checking membership in "G/L Account Source Currency" rather than only equality with the single "Source Currency Code" field), or call out the behavior change explicitly in release notes.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4
|
|
||
| LibraryERM.CreateGLAccount(BalGLAccount); | ||
|
|
||
| // [GIVEN] An entry posted in "CurrencyCode" ... |
There was a problem hiding this comment.
The new test's comment states it covers entries "including LCY-originated entries", but the fixture only posts two lines with non-blank (foreign) currency codes on a Multiple-Currencies account. The blank/LCY Source Currency Code branch of the new condition is never exercised, so a regression that lets LCY-originated entries leak back into the FCY totals would not be caught by this test. Either add a posted line with a blank Currency Code to the fixture, or narrow the test's scenario comment to match what it actually verifies (mismatched foreign-currency entries only).
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4
AB#646148