fix: incorrect item-wise tax distribution in item valuation #42229
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.
Item wise tax are not respected in Purchase receipt valuation:
In the previous implementation, when an item-wise tax template was selected, the tax rate of that item was split proportionally among the valuation rates of all items in the list, leading to inaccurate item valuations.
This fix corrects the distribution of item-wise tax to the valuation rate of each item and ensures that only the item with a tax template selected reflects its own valuation rate.
Also added validation to ensure that when a purchase tax template is selected, the item tax template is disregarded.
For eg:-
Item 1: Lemon
Rate: 70
Item tax : 5%
Item 2: Onion
Rate: 37
Item tax: 10%
Valaution Rate Shown in Ledger:- (for Either "Valuation" or "Valuation and Total")
BEFORE:-
Lemon: 74.71
Onion: 39.49
AFTER:-
Lemon 73.5 ( 70 + 3.5(5%) )
Onion 40.7 ( 37 + 3.7(10%) )