- 🇨🇭Switzerland Lukas von Blarer
This needs a re-roll.
The patch has got BC. I have this error, because i have commerce_shipping promotions:
ArgumentCountError: Too few arguments to function Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\PromotionOfferBase::__construct(), 4 passed in /app/web/modules/contrib/commerce_shipping/src/Plugin/Commerce/PromotionOffer/ShipmentPromotionOfferBase.php on line 53 and exactly 5 expected in Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\PromotionOfferBase->__construct() (line 52 of modules/contrib/commerce/modules/promotion/src/Plugin/Commerce/PromotionOffer/PromotionOfferBase.php).
Can we achieve this without BC?
The patch fixes the tax and promotion calculations. But since applying it, I see rounding errors.
- 🇫🇷France Micka
Hi,
Do you have a solution for stack : PHP 8.1 - D9.5.9 - Drupal Commerce 8.x-2.36
With a clean install and following parameters :
- Custom Tax config : include in the product price (10%)
- Promotion config : not include in the product price (displayed in total summary) (10%)
- original product variation price : 100$Tax is not well if we consider it is calculated on without tax price.
VAT : ((priceTTC - actual VAT) - discount) * actual VAT percentage
VAT : ((110 - 9.09) - 10) * 0.1 = 9.09Subtotal : $110.00
Discount : -$10.00
VAT : $9.09
Total : $100.00Expected :
VAT : ((priceTTC - old VAT) - discount) * actual VAT percentage
VAT : ((110 - 10) - 10) * 0.1 = 9Subtotal : $110.00
Discount : -$10.00
VAT : $9
Total : $100.00Thanks in advance for your answer.
And sorry if i misunderstood this issue (french english ^^). - 🇷🇴Romania cslevy
I recreated this patch to work with the latest commerce.
But I also encounter rounding issues, and I think that the discount amounts should be always rounded half down, not up. I'm not sure if it's correct or not, but I created the patch in 2 versions. one as it was in the previous comment with round up, and one with round down.
Please advise on this