FLUX-SE / SyliusEUVatPlugin

This Sylius Plugin allow you to add European VAT Number to the addresses and manage European VAT number rule
MIT License
16 stars 8 forks source link

Remove tax adjustement on shipment #45

Closed arthurels69 closed 1 year ago

arthurels69 commented 1 year ago

In OrderEuropeanVATNumberApplicator.php l61 you should replace:

foreach ($order->getItems() as $item) {
    $quantity = $item->getQuantity();
    Assert::notSame($quantity, 0, 'Cannot apply tax to order item with 0 quantity.');
    $item->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT);
}

By

$order->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT);
Prometee commented 1 year ago

Hello @Modjo69 you are right, I don't know why I didn't do it earlier. Also I must add some tests with shipments because I use this plugin only with virtual products right now.