- 🇩🇪Germany Greenhorn
Hello,
I would like to address this problem here again, even though it was a long time ago.
First of all, I would like to thank you, the developers, because anyone can complain but it is always difficult to provide constructive solutions. I would like to help find solutions, but I don't know where to start right now.Nevertheless the problem still exists. If there is already a patch that I haven't considered, please let me know.
We created a shop with Drupal commerce 8.x-2.38.
The prices in the shop have all been set to include tax.
Now we have the problem that when ordering several products, the tax is not calculated correctly.
We have noticed that the tax is calculated per order item and then added up.
This is not a problem for smaller orders but for multiple items the tax becomes inaccurate.Here is a simple example with a tax of 7%:
One item costs €4.20 including 7% tax
So the calculation of the tax is:
(4.20 / 107) * 7 = 0.2747... rounded = 0.27, is okbut for 5 items with the price of 4.20 including tax of 7%
the correct calculation would be:
5 x 4.20 = 21.00
Tax:
(21.00 / 107) *7 = 1.3738... rounded = 1.37 is okSince you calculate the tax per order item and then add it up, you get the following tax:
(4.20 / 107) * 7 = 0.2747... rounded = 0.270.27 x 5 = 1.35 and that is not correct in a tax country like Germany ;)
Is it possible to create a new property that contains the following per order:
Total tax per tax rate (7%, 19%, .... depending on the settings) only based on the order items and depending on whether tax is included or not.
These values should also be saved in the order as total tax, if that is possible.Thank you very much and we look forward to a constructive exchange