Skip to content

Bugs/Bug 647818 Source Currency Amount FCY GL Entries Reversal Charged - #11635

Merged
Fixes4BC (neeleshsinghal) merged 2 commits into
mainfrom
bugs/Bug-647818-Source-Currency-Amount-FCY-GL-Entries-Reversal-Charged
Sep 21, 2026
Merged

Fixes4BC (neeleshsinghal) merged 2 commits into
mainfrom
bugs/Bug-647818-Source-Currency-Amount-FCY-GL-Entries-Reversal-Charged

Conversation

@neeleshsinghal

@neeleshsinghal Fixes4BC (neeleshsinghal) commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@neeleshsinghal
Fixes4BC (neeleshsinghal) requested a review from a team as a code owner September 21, 2026 05:08
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 21, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 21, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This PR changes reverse-charge VAT G/L entry creation so a system-created line only reuses Source Curr. VAT Amount when Source Currency Code is set and is not LCY. That is a targeted fix for source-currency rounding mismatches: blank source currency no longer follows the foreign-currency preservation branch, while real foreign-currency lines still preserve the document VAT amount.

Problem-solution fit

Fit: Strong

The reported scenario is a foreign-currency purchase flow with Reverse Charge VAT where source-currency G/L amounts can stop balancing. The diff changes the reverse-charge VAT source-currency calculation in every layer that carries this posting code, so it matches the described problem without changing unrelated posting paths.

Suggestions

S1 (🔴 High): Add reverse-charge source-currency regression test
Please add a regression test for a foreign-currency purchase invoice with Reverse Charge VAT where the system-created reverse-charge VAT entries take this new branch. This is posting logic, and a missing test can let source-currency G/L amounts become unbalanced again.

Risk assessment and necessity

Risk: This is a sensitive posting path in GenJnlPostLine.Codeunit.al across all affected layers. If the branch is wrong, posted and previewed G/L entries can carry wrong source-currency amounts, which can break VAT and foreign-currency reconciliation. The code change is small and does not change a public surface.

Necessity: The change is needed because the scenario affects real foreign-currency reverse-charge VAT posting and has no safe workaround after posting. The scope is narrow, but it needs an automated test because this path controls persisted financial data.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11635 round=1 by=alexei-dobriansky at=2026-09-21T07:10:36.9301093Z lastSha=ce3d1847b0bf8c2981063bea571a96b14c611f01 reviewKey=13b2bacfe7d6a746fe38ec18850538f53c6422bb43915dc9ce0657271c2628ee suggestions=S1@ac2b10c5

@neeleshsinghal

Copy link
Copy Markdown
Contributor Author

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does
This PR changes reverse-charge VAT G/L entry creation so a system-created line only reuses Source Curr. VAT Amount when Source Currency Code is set and is not LCY. That is a targeted fix for source-currency rounding mismatches: blank source currency no longer follows the foreign-currency preservation branch, while real foreign-currency lines still preserve the document VAT amount.

Problem-solution fit
Fit: Strong

The reported scenario is a foreign-currency purchase flow with Reverse Charge VAT where source-currency G/L amounts can stop balancing. The diff changes the reverse-charge VAT source-currency calculation in every layer that carries this posting code, so it matches the described problem without changing unrelated posting paths.

Suggestions
S1 (🔴 High): Add reverse-charge source-currency regression test Please add a regression test for a foreign-currency purchase invoice with Reverse Charge VAT where the system-created reverse-charge VAT entries take this new branch. This is posting logic, and a missing test can let source-currency G/L amounts become unbalanced again.

Risk assessment and necessity
Risk: This is a sensitive posting path in GenJnlPostLine.Codeunit.al across all affected layers. If the branch is wrong, posted and previewed G/L entries can carry wrong source-currency amounts, which can break VAT and foreign-currency reconciliation. The code change is small and does not change a public surface.

Necessity: The change is needed because the scenario affects real foreign-currency reverse-charge VAT posting and has no safe workaround after posting. The scope is narrow, but it needs an automated test because this path controls persisted financial data.

[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11635 round=1 by=alexei-dobriansky at=2026-09-21T07:10:36.9301093Z lastSha=ce3d1847b0bf8c2981063bea571a96b14c611f01 reviewKey=13b2bacfe7d6a746fe38ec18850538f53c6422bb43915dc9ce0657271c2628ee suggestions=S1@ac2b10c5

already added in another master PR

@neeleshsinghal
Fixes4BC (neeleshsinghal) added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit f125305 Sep 21, 2026
175 checks passed
@neeleshsinghal
Fixes4BC (neeleshsinghal) deleted the bugs/Bug-647818-Source-Currency-Amount-FCY-GL-Entries-Reversal-Charged branch September 21, 2026 13:48
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