Prestashop: Bad recalculation of price tax excl field after entering an ecotax for a product with VAT

Created on 22 Aug 2018  Â·  5Comments  Â·  Source: PrestaShop/PrestaShop

This issue has been migrated from the Forge. Read the original ticket here.

  • _Reporter:_ salma.moakhar
  • _Created at:_ Wed, 18 Oct 2017 16:59:33 +0200

Hi all,

1/ Product price (screen 1)
exVAT : 14.841667
VAT : 20% FR standard
Ecotax (including VAT) : 2
Full price : 19,81

2/ Create a new group "B2B", and choose price display in exVAT (screen 2)

In FO, the product price is 16,84 for the B2B group customers (exVAT). This is wrong, because the ecotax included VAT (2) has been added to the exVAT price (14.84).

The price exVAT should be 14.841667 + ( 2 / 1,2 ) = 16,508333

The issue is located in classes / Product.php / priceCalculation near 3060
if ($use_tax)

{
[...]
}

else

{
$price += $ecotax;
}

should probably something like
if ($use_tax)

{
[..]
}

else

{
[..]
$price += $ecotax_tax_calculator->removeTaxes($ecotax);
}


Describe the bug

Bad recalculation of price tax excl field after entering an ecotax for a product with VAT

Expected behavior

Correct recalculation of the "net turnover excluding tax"

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to Catalog > Products and create a new product
  2. Fill the product price tax excl (incl ecotax): 16,508333
  3. Fill the VAT for the product: 20%
  4. Product price tax incl (incl ecotax): 19,81
  5. Fill the ecotax tax incl: 2
  6. VAT on the ecotax: 0%
  7. The product price tax excl field in BO is recalculated to remove the ecotax and becomes 14,84

The calcul is currently the following one:
product price tax excl incl ecotax - (ecotax / coef VAT product)
16,508333 - (2 / 1,20) = 14,841666333

This is wrong, it should be:
product price tax excl including ecotax - ecotax tax incl
16,508333 - 2 = 14,508333

The problem is the same in FO:
Product price tax excl is 16,84 instead of 16,508333€

Screenshots

https://drive.google.com/file/d/1SJ-__foJgj5iL289hUjJxW2rfEtm-dkT/view

Additional information

  • PrestaShop version: 1.7.7.0
  • PHP version: 7.2
1.7.2.3 1.7.4.0 1.7.4.1 1.7.6.0 1.7.7.0 BO Bug FO Major Must-have Products Taxes and Prices To Do

Most helpful comment

Hello @marionf,

I am on PrestaShop 1.7.5.1, I am in France and I have the same issue with a bad excluded price calculation as soon I complete the 'ecotax (all tax included)' field.

I think that this field does not correspond to the ecotax named as 'eco-participation' in France and must not be used (may be this must be mentioned somewhere).

May be all my following reply just apply to France but I think there is a problem in your calcul because i don't know any country where you can add or subtract price_excluded_price with price_included_tax like this:

product price tax excl incl ecotax - ecotax tax incl ????

So, for France, I think that you are wrong with your price calculation. The ecotax is considered as a service so it is subject to VAT like any other product, in condition the seller is subject to VAT too..

The price to pay by a customer must be calculated like this:

unit_price_to_pay_by_customer = (unit_product_price_tax_excl + VAT) + (unit_product_ecotax + VAT)

And in case of a discount:

unit_discount_price_to_pay = ((unit_product_price_tax_excl – unit_product_discount_amount) + VAT) + (unit_product_ecotax + VAT)

As we can see the exotax MUST NOT impact the 'product tax excluded price' IN ANY CASE. The ecotax is just applied to the product tax included price with the VAT. So on FO, the ecotax can be considered like a 'service product' added to cart. The only difference is that it must be added to the cart only if the product subject to the ecotax is added to the cart first.

I don't understand what you mean by:

The product price tax excl field in BO is recalculated to remove the ecotax because it's donated by the merchant to a collection agency and shouldn't impact his margin.
and
This is wrong, it should be:
product price tax excl incl ecotax - ecotax tax incl

This is completely wrong, because If you remove the ecotax to the 'excluded tax price', you nibble seller margin !!!
The margin earned by the seller is only done on the 'all EXCLUDED tax price product' ! If you subtract a tax to the 'all EXCLUDED tax price product', you clearly nibble the seller margin.

I think that this issue must be considered as a priority in France because French PrestaShop websites are not compliant with the authorities since 2012 (I will not tell here which ones) but all these points are not conform:

  • public_price_to_pay calculation on product detail page
  • public_price_to_pay calculation on cart
  • show clearly at the bottom of the invoice and not in the body of the invoice (on an invoice line) the information about environmental unit costs

I know that PrestaShop is an Open Source project and thanks very much for the team about that to free a product like this one.
But I think that PrestaShop users must be clearly informed about authorities compliance.
Because lots of users are not developers, just merchants and many 'young and new merchant' will use PrestaShop 'AS THIS'. They expect to have a ready to use product as it is claimed by PrestaShop website and as the result they will not respect authorities that can generate very expensive costs in court fees.
So using an Open Source solution can become a legal and financial hell.

Because of that, after 6 months of work, a custom theme developed, just finishing to import my products, I have to see how to manage that, I prefer to not activate my shop right now...
I'm a little bit disappointed...

All 5 comments

Product price tax excl & including ecotax: 16,508333
VAT on the product: 20%
Product price tax incl & including ecotax: 19,81

Ecotax tax incl: 2€
VAT on the ecotax: 0%

The product price tax excl field in BO is recalculated to remove the ecotax because it's donated by the merchant to a collection agency and shouldn't impact his margin.
After filling the ecotax field, the product price tax excl in BO becomes 14,84
The calcul is currently the following one:
product price tax excl incl ecotax - (ecotax / coef VAT product)
16,508333 - (2 / 1,20) = 14,841666333

This is wrong, it should be:
product price tax excl including ecotax - ecotax tax incl
16,508333 - 2 = 14,508333

The problem is the same in FO:
Product price tax excl is 16,84 instead of 16,508333€

I've the same issue (#15666). What could I do?

When will the issue be solved?

Hi @yannicka,

The issue is added to our bug roadmap with Major severity.

Thanks!

Hello @marionf,

I am on PrestaShop 1.7.5.1, I am in France and I have the same issue with a bad excluded price calculation as soon I complete the 'ecotax (all tax included)' field.

I think that this field does not correspond to the ecotax named as 'eco-participation' in France and must not be used (may be this must be mentioned somewhere).

May be all my following reply just apply to France but I think there is a problem in your calcul because i don't know any country where you can add or subtract price_excluded_price with price_included_tax like this:

product price tax excl incl ecotax - ecotax tax incl ????

So, for France, I think that you are wrong with your price calculation. The ecotax is considered as a service so it is subject to VAT like any other product, in condition the seller is subject to VAT too..

The price to pay by a customer must be calculated like this:

unit_price_to_pay_by_customer = (unit_product_price_tax_excl + VAT) + (unit_product_ecotax + VAT)

And in case of a discount:

unit_discount_price_to_pay = ((unit_product_price_tax_excl – unit_product_discount_amount) + VAT) + (unit_product_ecotax + VAT)

As we can see the exotax MUST NOT impact the 'product tax excluded price' IN ANY CASE. The ecotax is just applied to the product tax included price with the VAT. So on FO, the ecotax can be considered like a 'service product' added to cart. The only difference is that it must be added to the cart only if the product subject to the ecotax is added to the cart first.

I don't understand what you mean by:

The product price tax excl field in BO is recalculated to remove the ecotax because it's donated by the merchant to a collection agency and shouldn't impact his margin.
and
This is wrong, it should be:
product price tax excl incl ecotax - ecotax tax incl

This is completely wrong, because If you remove the ecotax to the 'excluded tax price', you nibble seller margin !!!
The margin earned by the seller is only done on the 'all EXCLUDED tax price product' ! If you subtract a tax to the 'all EXCLUDED tax price product', you clearly nibble the seller margin.

I think that this issue must be considered as a priority in France because French PrestaShop websites are not compliant with the authorities since 2012 (I will not tell here which ones) but all these points are not conform:

  • public_price_to_pay calculation on product detail page
  • public_price_to_pay calculation on cart
  • show clearly at the bottom of the invoice and not in the body of the invoice (on an invoice line) the information about environmental unit costs

I know that PrestaShop is an Open Source project and thanks very much for the team about that to free a product like this one.
But I think that PrestaShop users must be clearly informed about authorities compliance.
Because lots of users are not developers, just merchants and many 'young and new merchant' will use PrestaShop 'AS THIS'. They expect to have a ready to use product as it is claimed by PrestaShop website and as the result they will not respect authorities that can generate very expensive costs in court fees.
So using an Open Source solution can become a legal and financial hell.

Because of that, after 6 months of work, a custom theme developed, just finishing to import my products, I have to see how to manage that, I prefer to not activate my shop right now...
I'm a little bit disappointed...

Hello @fmipsylone

Thank you for your message !

The ecotax is just applied to the product tax included price with the VAT. So on FO, the ecotax can be considered like a 'service product' added to cart.

I am totally agree with you

It seems we are not talking of the same thing
You are talking of the unit_price_to_pay_by_customer while I am talking of the amount owned by the seller (without taxes and without ecotax)

Tell me if I am wrong but it seems that as a merchant you fill the product price tax excl with the ecotax (tax excl) included
And then, you fill the ecotax field for information ("dont" XX€)
The product price tax excl is used in PrestaShop to calcul the seller margin, so we must remove the amount of the ecotax from the "product price tax excl" field when you fill it

It works already like this currently, the ecotax is deducted from the price tax excl field of the product in BO as soon as the ecotax is filled. Except that the ecotax is not correctly deducted when you fill it.

Please take a look at this issue and what we planned to do to improve this part of the product page: https://github.com/PrestaShop/PrestaShop/issues/15044#issue-478563769

If you have any feedback let me know, I will be happy to talk with you about it :)

Was this page helpful?
0 / 5 - 0 ratings