Skip to content

[29.x] [CH] When posting with FCY, VAT G/L Entry stores VAT base amount in Source Currency Amount instead of VAT amount - #11269

Merged
dcenic merged 1 commit into
releases/29.xfrom
bugs/64959xCHVATAmount
Sep 11, 2026
Merged

[29.x] [CH] When posting with FCY, VAT G/L Entry stores VAT base amount in Source Currency Amount instead of VAT amount#11269
dcenic merged 1 commit into
releases/29.xfrom
bugs/64959xCHVATAmount

Conversation

@dcenic

@dcenic dcenic commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

automated test

Risk & compatibility

…res VAT base amount in Source Currency Amount instead of VAT amount
@dcenic
dcenic requested a review from a team September 9, 2026 13:23
@dcenic
dcenic requested a review from a team as a code owner September 9, 2026 13:23
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 9, 2026
@github-actions github-actions Bot added this to the Version 29.1 milestone Sep 9, 2026
@dcenic
dcenic enabled auto-merge (squash) September 9, 2026 14:29
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

The 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 fit

Fit: 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.

Suggestions

None.

Risk assessment and necessity

Risk: 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.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11269 round=1 by=alexei-dobriansky at=2026-09-09T19:16:25.2577451Z lastSha=6868aa785a57cee3f36b4220b7f6edefc5683c28 reviewKey=a8535e7c1dbea49c3dbb4ab5ebb761cadc01512ea409813f8f527c528e8e7709 suggestions=none

@dcenic
dcenic merged commit b17ce43 into releases/29.x Sep 11, 2026
333 of 335 checks passed
@dcenic
dcenic deleted the bugs/64959xCHVATAmount branch September 11, 2026 09:23
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