overbags Posted October 28, 2017 Share Posted October 28, 2017 Hello to all I suggest that the error is on the left hand side of the invoice in "tax details" right in the invoice summary the calculation is right how much a voucher or a discount is in the field on the left DETAIL TAX the amount of the fee is incorrect Discount products 120.16 € Good discount - 5.95 € Tax Detail Tax rate Base price Total taxes Products 22,000% 114,21 € 26,43 € Shipping 22,000% 15,50 € 3,41 € That is, taxes are calculated on the total of products to be discounted how can I fix it? often my customers challenge me this mistake. Link to comment Share on other sites More sharing options...
tuk66 Posted November 6, 2017 Share Posted November 6, 2017 What is your PrestaShop version? I prepared comparison of several versions at http://www.prestashop.com/forums/topic/166816-pdf-invoice-in-different-prestashop-versions-wrong-amounts-updated/ Link to comment Share on other sites More sharing options...
typoman Posted June 25, 2018 Share Posted June 25, 2018 I see the same issue with prestashop 1.6.1.18 if a custom reduction is applied to the invoice the tax for products is calculated incorrect. Is there a solution for this? Link to comment Share on other sites More sharing options...
Prestashop Addict Posted November 17, 2018 Share Posted November 17, 2018 (edited) 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. Edited November 18, 2018 by Prestashop Addict (see edit history) Link to comment Share on other sites More sharing options...
pHumhrey Posted November 19, 2018 Share Posted November 19, 2018 I had the same issue for the US, but all of them can be resolved easily by editing the invoice exactly. If you have a tool to edit tax-related pdf forms bought: https://w9.pdffiller.com certainly, or if you consider investing in purchasing one for such a purpose Link to comment Share on other sites More sharing options...
tuk66 Posted November 20, 2018 Share Posted November 20, 2018 It doesn't work if customers can download invoices created on-the-fly. Link to comment Share on other sites More sharing options...
Wladi Posted January 14, 2019 Share Posted January 14, 2019 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. hi, your code does not work? Can you be more specific what exactly needs to be replaced. Thanks. Link to comment Share on other sites More sharing options...
Rayna Butler Posted January 28, 2020 Share Posted January 28, 2020 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 Link to comment Share on other sites More sharing options...
Alana Ostin Posted December 3, 2020 Share Posted December 3, 2020 I've recently faced the same problem. But I've appealed to my friend, who's been working with such documents much longer than me. And he advised me to use this form https://pdfliner.com/form_w_9. I don't know whether it'll be the same way convinient for you as it's for me. But at least you can give it a try. Hope, that I've managed to help you a little 😊 Link to comment Share on other sites More sharing options...
Eusebio100 Posted March 10, 2021 Share Posted March 10, 2021 En 17/11/2018 a las 9:38 AM, Prestashop Addict dijo: 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: This is good, but if the discount is fixed, for example 5€. How to do in this case? thanks, and sorry for my english. Link to comment Share on other sites More sharing options...
NixxxoN Posted January 22, 2022 Share Posted January 22, 2022 (edited) 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 Edited January 22, 2022 by NixxxoN (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now