You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an use case where I need to add a tax correction on the order, related to an order_promotion that is added onto the order.
The correction is nicely deducted from the total VAT on the Cart Summary page. However, it's also deducated from the Shipping Total. Diving into that, leads me to this calculation in src/Sylius/Component/Core/Model/Order.php:
/**
* Returns shipping fee together with taxes decreased by shipping discount.
*/
public function getShippingTotal(): int
{
$shippingTotal = $this->getAdjustmentsTotal(AdjustmentInterface::SHIPPING_ADJUSTMENT);
$shippingTotal = $this->getAdjustmentsTotal(AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT);
$shippingTotal = $this->getAdjustmentsTotal(AdjustmentInterface::TAX_ADJUSTMENT);
return $shippingTotal;
}
This basically assumes that all tax adjustments on the order are related to shipping, which won't be the case always I assume.
The comment above the method kind of says that it should only be related to shipping discounts, but well, there can be other reasons for order discounts.
At least not in my situation, and the system is modular enough to cater for this kind of situations.
The text was updated successfully, but these errors were encountered:
I'm having an use case where I need to add a tax correction on the order, related to an
order_promotion
that is added onto the order.The correction is nicely deducted from the total VAT on the Cart Summary page. However, it's also deducated from the Shipping Total. Diving into that, leads me to this calculation in
src/Sylius/Component/Core/Model/Order.php
:This basically assumes that all tax adjustments on the order are related to shipping, which won't be the case always I assume.
The comment above the method kind of says that it should only be related to shipping discounts, but well, there can be other reasons for order discounts.
At least not in my situation, and the system is modular enough to cater for this kind of situations.
The text was updated successfully, but these errors were encountered: