Bug][SubscriptionBilling]: "Prices Including VAT" option does not correctly update Subscription Line amounts#8066
Open
miljance wants to merge 2 commits into
Open
Bug][SubscriptionBilling]: "Prices Including VAT" option does not correctly update Subscription Line amounts#8066miljance wants to merge 2 commits into
miljance 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
AndersLarsenMicrosoft
approved these changes
May 11, 2026
djukicmilica
approved these changes
May 11, 2026
auto-merge was automatically disabled
May 12, 2026 09:41
Pull request was closed
auto-merge was automatically disabled
May 13, 2026 07:31
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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