[29.x] [CH] When posting with FCY, VAT G/L Entry stores VAT base amount in Source Currency Amount instead of VAT amount - #11269
Conversation
…res VAT base amount in Source Currency Amount instead of VAT amount
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThe change prevents source-currency amount initialization from recalculating the net-of-VAT amount for system-created G/L entries. Those VAT split entries keep the VAT source amount that posting already calculated before the G/L entry is inserted. The guard is narrow: normal non-payable account entries can still get the net source amount, while system-created VAT entries keep their passed-in source amount. The added regression test posts a foreign-currency purchase journal line and checks both the expense and VAT G/L entries. Problem-solution fitFit: Strong The reported problem is that a foreign-currency VAT G/L entry can store the VAT base instead of the VAT amount in Source Currency Amount. The diff addresses that exact overwrite and adds coverage for the affected purchase posting path. SuggestionsNone. Risk assessment and necessityRisk: This is a CH G/L and VAT posting path, so an incorrect change could persist wrong source-currency amounts. The code change is small, has no public API or event signature change, and the CH app and CH unit-test checks are passing. One AU unit-test check is failing, but it is outside the changed area. Necessity: The change is needed because the VAT split entry already receives the VAT source amount; recalculating from the journal line can store the base amount instead. The scope is appropriate: one posting guard plus a regression test for the reported path.
|
When posting with FCY, VAT G/L Entry stores VAT base amount in Source Currency Amount instead of VAT amount
What & why
During initialization of a system-generated G/L Entry, not recalculating source currency amounts, as it already carries the correct source currency amount.
Linked work
Fixes AB#649597
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
automated test
Risk & compatibility