[29.X]-Source Currency Amount calculation causes discrepancies with Foreign Currency G/L Entries whit Reversal Charge VAT. - #11632
Conversation
…Line.Codeunit.al Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Good Sense Reviewer - Round 1Recommendation: Request ChangesWhat this PR doesThis change makes reverse charge VAT G/L entries use the source-currency VAT amount that was already calculated on the originating system-created journal line. That addresses the foreign-currency rounding case, but the new condition also treats a blank source currency as a foreign currency when an LCY code is configured. That can change LCY reverse charge posting from a calculated source amount to zero. Problem-solution fitFit: Partial The fix matches the reported foreign-currency rounding problem and the tests cover that shape well. It does not fully protect the existing LCY path, because a blank source currency can take the new branch even though there is no foreign source currency to preserve. SuggestionsS1 (🔴 High): Blank source currency uses zero VAT amount Risk assessment and necessityRisk: This is a financially sensitive posting path. The changed branch is copied across several country layers, so the same LCY regression can affect reverse charge VAT G/L entries in more than one localization. Necessity: The change is needed because recalculating source-currency VAT from rounded LCY values can create wrong source-currency balances. The scope is right for the foreign-currency bug, but the condition must avoid changing the LCY behavior.
|
Good Sense Reviewer - Round 2Recommendation: Request ChangesWhat this PR doesThe latest commit only removes an unneeded handler attribute from one ES test. The full change still makes reverse charge VAT G/L entries reuse the preserved source-currency VAT amount on system-created lines, which fits the foreign-currency rounding scenario. However, the condition still treats a blank source currency as different from a configured LCY code, so LCY system-created lines can still take the preserved-amount path even when there is no foreign source amount to preserve. Status of previous suggestions
New observations (commits since round 1)None - the new commit only removes an unneeded test handler attribute and does not change the posting logic that was flagged in round 1. Risk assessment and necessityRisk: This is still a financially sensitive posting path. The same condition is copied across APAC, BE, CH, ES, FI, FR, IT, NA, NO, RU, and W1, so an LCY reverse charge VAT regression can affect several localizations. Necessity: The foreign-currency rounding fix is needed because recalculating source-currency VAT from LCY values can create wrong source-currency balances. The scope is still right, but the condition must also preserve the existing LCY behavior.
|
Good Sense Reviewer - Round 3Recommendation: Accept with SuggestionsWhat this PR doesThis round updates reverse charge VAT G/L entry creation so system-created foreign-currency lines reuse the already calculated source-currency VAT amount only when the source currency is non-blank. It also adds localized regression tests for the foreign-currency rounding case. Status of previous suggestions
New observations (commits since round 2)S2 (🟠 Moderate): Remove the unneeded IT confirm handler Risk assessment and necessityRisk: Reverse charge VAT source-currency amounts affect persisted ledger balances. The prior LCY regression risk is addressed; the remaining risk is limited to test stability. Necessity: The change is needed because recalculating source-currency VAT from rounded LCY values can create wrong source-currency balances. The scope is appropriate for the reported foreign-currency rounding issue.
|
Good Sense Reviewer - Round 4Recommendation: AcceptWhat this PR doesThis round removes the extra confirm-handler binding from the IT regression test. The full PR still preserves source-currency reverse charge VAT amounts for system-created foreign-currency lines, while the non-blank source-currency guard keeps LCY lines on the existing calculated path. Status of previous suggestions
New observations (commits since round 3)None - the only new commit removes the test handler attribute that was flagged in round 3. Risk assessment and necessityRisk: This remains a financial posting path because reverse charge VAT source-currency amounts are persisted to G/L entries across several localizations. The latest change is test-only and reduces test-harness risk. Necessity: The posting change is needed to avoid source-currency rounding discrepancies for reverse charge VAT. The latest test cleanup is also needed so the new IT regression test matches the posting flow and does not expect a confirmation that is not part of this scenario.
|
Fixes AB#650406