fix(Quotation): calculate row values for alternative items (backport #43054) #43495
+47
−9
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.
Introduced via: #33874
Problem
When marking a Quotation row as Is Alternative, the row is completely ignored in code. E.g. the row amount does not get updated, the tax template is not verified, the tax exclusive rate is no longer determined, etc.
This can easily result in a wrong quotation. For example, if the rate is edited after the row was marked as Is Alternative, the row amount is no longer correct.
Solution
Exclude alternative rows only when calculating total taxes and amounts for the entire Quotation. Individual row values should get updated as usual, for alternative items as well.
Internal ref: DEP-567
This is an automatic backport of pull request #43054 done by Mergify.