-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OT modules and taxes calculations #6425
Comments
For those who have courage to dig into this code, following information about ***** Values that change depending on 'Display with tax' option. |
In ZC last V2.0.0, after doing few PRs about Order Total modules, especially discount modules, it appears to me that with actual logic of these modules, it is impossible to apply all possible options and get correct results. There are different problems I identified:
1- Discount modules (discount coupons, GV and group pricing) are treated as 'charges' (fee) modules. They have their own tax class option like they were taxable items, which in my opinion is a non-sens. The items/fees they apply to have tax classes, but the discount in itself can't! There should not be any tax class to choose in discount modules.
2- When applying a discount, there are three options to re-calculate tax, 'None', 'Standard' and 'Credit Note'.
The first one, 'None' does not make any sens, especially with percentage discounts. How do you do to not re-calculate tax when applying a 10% discount, for example? When you apply it to total without tax, you get a result without tax. If you apply it to a total with tax included, your result includes tax, reduced from 10%. It is automatic ! This option should not exist in discount modules.
For other options, 'Standard' and 'Credit Note', I decided to interpret them as 'discount amount is price incl.' and 'discount amount is price excl.' when discount is a fixed amount. With percentage, it does not change a thing.
3- Option 'Include tax' was to be use only when no tax recalculation is done... See above. This one should not be there either.
4- When using multiple tax rates or even multiple tax classes with multiple tax rates, details for shipping tax rates are missing, making it impossible to use multiple tax rates as soon as shipping has two or more taxes applied. Shipping taxes for different tax rates should be saved.
I concentrated on all these points and did a rewrite of OT coupons. Discount ones have been heavily modified.
Now I get good results with multiples taxes, even compound, (tested with 4) and possibles options left in discount modules. Additional charge modules although perform well.
Files for now are available on branch Multiple-taxes-support-in-ot-_modules of my GitHub repo.
I am not sure of what to do with this: Make a new PR and deleting PR#6392 or updating this old PR with new files. Another problem is that this files won't pass some of ZC validation tests and these test conditions are kind of obscure which makes it hard to detect if error comes from new code or was in the test already.
The text was updated successfully, but these errors were encountered: