On 11/17/2018 at 9:38 AM, Prestashop Addict said:Hi,
for those who encounter the problem of calculating VAT on a discount the problem comes from the method of calculation in the cart rules. The calculation does not take into account the VAT or no VAT of the billing address. Example if you have a non-EU customer who does not pay VAT or a customer with an INTRACOMMUNITY VAT number the calculation of the discount will be done with VAT. The bug appears only in the back office in the shopping cart or in the order and in the customer's invoice. So the customer does not see anything in the command tunnel.
Example product at 100 € without VAT with VAT at 20% and a discount of 5% in the basket rule. In France everything is ok, but for an order in DOM / TOM or EU with a VAT N ° INTRA 5% discount are calculated with VAT!
Price without tax 100 €
Discount 5% = 6 € (5 € + 20% VAT = 6 €) instead of 5 €
To fix the problem you have to modify a Prestashop core file classes/CartRules.php inf method getContextualValue() on line 990 change:$price = $product['price']; if ($use_tax) { $infos = Product::getTaxesInformations($product, $context); $tax_rate = $infos['rate'] / 100; $price *= (1 + $tax_rate); }by
$price = Product::getPriceStatic($product['id_product'], $use_tax, isset($product['id_product_attribute']) ? (int)$product['id_product_attribute'] : null, 6, null, false, false, $product['cart_quantity']);That's all folks.
NB: as you are on a 1.6 this fix will unfortunately not be reported in the next updates, only the security and severe bugs are maintained. But the bug is still present in the 1.7 🙂 We will propose the fix.
On 1/28/2020 at 5:38 PM, Rayna Butler said:Old Topic but for anyone coming here with the same problem:
To have the VAT corrrectly calculated in invoice email with voucher change in classes\PaymentModule.php:
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false));
to
'{total_tax_paid}' => Tools::displayPrice(($order->total_paid_tax_incl - $order->total_paid_tax_excl), $this->context->currency, false));
cheers
Sorry guys, thanks for the effort but those two haven't worked at all. No difference whatsoever.
When you apply a coupon, the separated tax calculations (depending on the product) don't show correctly.
Edit: I have 1.6.1.24, the last version of 1.6