- 🇨🇭Switzerland Lukas von Blarer
Yes, the patch in #31 doesn't apply anymore to dev and is broken with 2.30.0.
- Status changed to Active
almost 2 years ago 6:15pm 17 February 2023 - 🇨🇭Switzerland Lukas von Blarer
Sorry, this was caused by another patch.
- Status changed to Needs work
almost 2 years ago 6:17pm 17 February 2023 - 🇨🇭Switzerland Lukas von Blarer
It applies against 2.30.0 and doesn't apply since 2.31.0.
- 🇬🇷Greece idimopoulos
I am not adding anything to the argument, the patch has solved the problem for me too where I was setting the value of the product to 300 VAT included, and in the checkout, I was getting 300.01. Very bad experience for the client too. I am adding the patch that applies to 2.x.
NOTE: Some of the fragments of the patch in the BuyXGetY class were not there anymore. Code was removed. I discarded them. Take care whoever uses it. It might be that more is needed there.
- 🇩🇪Germany Greenhorn
@idimopoulos, thanks for the patch.
Your patch has successfully solved the issue I was facing, as detailed in this issue: https://www.drupal.org/project/commerce/issues/3184028#comment-15495720 💬 VAT Rounding Error Closed: duplicate
I greatly appreciate your work on this.
I only made one adjustment to the following query:
from+ if ($adjustments) { + foreach ($adjustments as $adjustment) { + if (!empty($adjustment['total']) && $adjustment['total'] instanceof Price) { + $total = $total->add($adjustment['total']); + } + } + }
to:
+ if ($adjustments) { + foreach ($adjustments as $adjustment) { + if (!empty($adjustment['total']) && $adjustment['total'] instanceof Price && (isset($adjustment['included']) && !$adjustment['included'])) { + $total = $total->add($adjustment['total']); + } + } + }
I made this change because in the order admin view, the total price was being increased by the amounts that were already included in the price, such as taxes in my case. This adjustment ensures that included items, like taxes, are not added again to the total price.
I'll keep an eye on this and will report back if any issues arise that I haven't noticed yet.
Thanks again for your contribution!
- 🇩🇪Germany Anybody Porta Westfalica
Wouldn't it make sense here to proceed with a MR for easier review? Furthermore the tax related issues should be bundled and tackled in a meta issue, as some of them seem to overlap?
Taxing is surely one of the most critical things in commerce.Moving this forward to 3.0.x as target, as further development should land there first?