Bugs/bug 646637 main posting errorwith50 per non deductible vat - #10214
Bugs/bug 646637 main posting errorwith50 per non deductible vat#10214sanjmaurya wants to merge 3 commits into
Conversation
Agentic PR Review - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis PR fixes a purchase posting failure for foreign-currency invoices with partial non-deductible VAT when source-currency consistency is enabled. The changed The fix is targeted at the system-created purchase posting path that the work item describes. Using the non-deductible amount as a residual split is also safer for rounding than recalculating both parts independently, because the two source-currency VAT pieces still add back to the original source-currency VAT amount. I found the same normal VAT posting procedure across the changed country layers, and the PR applies the same correction consistently. SuggestionsS1 - Assert the source-currency split amounts Risk assessment and necessityRisk: This is a financial posting path: an incorrect source-currency amount can either block posting when consistency checking is enabled or persist wrong source-currency totals on G/L entries. The code change is narrow and does not change public APIs, events, or concurrency behavior, but it affects all changed BaseApp country variants of Necessity: The work item and PR description describe a concrete customer path with purchase invoice posting, 50% non-deductible VAT, foreign currency, and
|
|
We have done the S1. Please review |
Agentic PR Review - Round 2Recommendation: AcceptWhat this PR doesSince round 1, the PR updates the W1 and APAC non-deductible VAT currency tests. The test now uses a dedicated non-deductible purchase VAT account and checks the source-currency amount on both the deductible VAT account and the non-deductible VAT account. This directly addresses the previous concern. The production fix is unchanged, and the new assertions prove the VAT source-currency split is correct, not only that the total source-currency amount balances. Status of previous suggestions
New observations (commits since round 1)None - changes only addressed prior suggestions. Risk assessment and necessityRisk: The underlying production change is still in a financial posting path across the changed GenJnlPostLine.Codeunit.al country variants, so wrong source-currency amounts would be serious. The latest commit only changes tests and adds exact account-level assertions. It does not change public APIs, events, or posting behavior. Necessity: The work item describes a concrete purchase posting failure with partial non-deductible VAT, foreign currency, and source-currency consistency enabled. The fix remains narrow and needed, and the added tests now cover the important source-currency split.
|
Bug 646637: [all-e][Master]Posting Error with 50% Non-Deductible VAT when "Check Source Currency Consistency" is enabled in "General Ledger Setup" page
Fixes AB#646637
Issue :- Posting Error with 50% Non-Deductible VAT when "Check Source Currency Consistency" is enabled in "General Ledger Setup" page
Cause :- When a purchase document is posted with partial non-deductible VAT in a foreign currency and “Check Source Curr. Consistency” is enabled in General Ledger Setup, the source-currency VAT amount on the deductible VAT G/L entry is created using the full source-currency VAT amount instead of subtracting the non-deductible VAT portion.
This causes the G/L source currency totals to become unbalanced, and the posting fails with the source currency consistency validation error.
Solutions:- Adjust the source-currency amount used for the deductible VAT G/L entry to exclude the non-deductible VAT portion:
Before:
GenJnlLine."Source Curr. VAT Amount"
After:
GenJnlLine."Source Curr. VAT Amount" - CalcAmountSrcCurr(GenJnlLine, VATPostingParameters."Non-Deductible VAT Amount")
This keeps the source-currency balance consistent for postings where only part of the VAT is deductible, while preserving the correct deductible VAT posting behavior.