[Bug][SubscriptionBilling]: "Prices Including VAT" option does not correctly update Subscription Line amounts#8066
[Bug][SubscriptionBilling]: "Prices Including VAT" option does not correctly update Subscription Line amounts#8066miljance wants to merge 2 commits into
Conversation
…AT is enabled - Add EnsureCalculationBaseAmountExcludesVAT on Subscription Line table to strip VAT from Calculation Base Amount when the Sales Header has Prices Including VAT - Add event subscriber in SalesSubscriptionLineMgmt to recalculate Sales Subscription Line amounts when Prices Including VAT is toggled on the Sales Header - Add four tests covering: CBA equals unit price with/without PIV, recalculation on PIV toggle, and net CBA on posted Subscription Line - Refactor test helpers: extract FindNonZeroVATPostingSetup, FindCustomerDocumentPrice- SalesServiceCommitment, SetupItemCustomerAndSalesHeaderWithVAT; replace magic VAT sentinel with explicit ReassignSalesLineToDifferentVATGroup/ReassignSalesLineToZeroVATGroup - Add GIVEN/WHEN/THEN comments to CheckVatCalculationForServiceCommitmentRhythmInReports
Pull request was closed
Pull request was closed
SalesSubscriptionLine.Modify called without transaction guardIn the new Recommendation:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
|
Re-running the two failed jobs. They strike me as instabilities. |
What & why
Linked work
Fixes #7399
How I validated this
What I tested and the outcome
Followed the repro steps from #7399:
Calculation Base Amounton all Sales Subscription Lines was updated to the VAT-exclusive (net) amount.Calculation Base Amountreverted to the original VAT-inclusive unit price (i.e. the sales line unit price as stored).Calculation Base Amounton a Sales Subscription Line, then toggled Prices Including VAT - confirmed that the manually entered value was preserved but correctly adjusted (VAT stripped or added), not reset to the unit price.Calculation Base Amountis the net (VAT-exclusive) amount, matching the formulaUnitPrice / (1 + VAT% / 100).Risk & compatibility
None. The change adds a new procedure called only from a new event subscriber and from
CreateSubscriptionLineFromSalesLine. It does not touch any existing posting logic, table schema, permissions, or upgrade code. No breaking changes.Fixes AB#634780