Prestashop: Total tax amount is wrong in order confirmation email

Created on 31 Oct 2019  路  2Comments  路  Source: PrestaShop/PrestaShop

To Reproduce
Steps to reproduce the behavior:

  1. Setup some VAT rule, 21% for example.
  2. Setup a voucher which discounts the order by X percent.
  3. Add something to cart.
  4. Apply a voucher with discount.
  5. Order it.
  6. Total tax in email is wrong. It is calculated from the amount before discounts.

Fix
'{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)

>
'{total_tax_paid}' => Tools::displayPrice($order->total_paid_tax_incl - $order->total_paid_tax_excl, $this->context->currency, false)

I found it suprising that something crucial as calculating VAT is still not fixed after years. This problem is there since 1.6.

Additional information
PrestaShop version: 1.7.6.0
PHP version: 7.2

1.7.5.2 1.7.6.1 Bug Email Fixed Minor PR available Taxes and Prices develop

Most helpful comment

@khouloudbelguith PR opened #16571

All 2 comments

Hi @Hlavtox,

Thanks for your report.
I manage to reproduce the issue with PS1.7.5.2 & PS1.7.6.1 & the develop branch.
In the email the Tax is incorrect.
image

In the FO it is OK
image
I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!

PS: about your fix, we stopped using Tools::displayPrice as it is deprecated, you can follow this PR: https://github.com/PrestaShop/PrestaShop/pull/15448
Thanks!

@khouloudbelguith PR opened #16571

Was this page helpful?
0 / 5 - 0 ratings