Prestashop: [BOOM-1506] In BO Product page, ecotax tax excl is used instead of ecotax tax incl

Created on 23 Aug 2018  ·  32Comments  ·  Source: PrestaShop/PrestaShop

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

  • _Reporter:_ vincentbz
  • _Created at:_ Tue, 20 Sep 2016 17:39:49 +0200

1) I enable ecotax in international > VAT
2) I define a tax for my ecotax of 20%
Capture du 2018-03-15 16-05-05

3) I set ecotax = 1€ tax incl
The price tax excl is not well recalculated (issue https://github.com/PrestaShop/PrestaShop/issues/9855)
Sans titre2

4) I save my product, reload the page ==> the ecotax = amount Tax Excl. The VAT on the ecotax has disappear in the nature. And the product price tax incl is also wrong (should be 12€)
Capture du 2018-03-15 16-40-38

1.7.4.0 1.7.4.1 BO Bug Critical Fixed Products Topwatchers

Most helpful comment

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ nand2
  • _Created at:_ Wed, 14 Feb 2018 15:40:23 +0100

Hello,

Also being hit by this exact problem on 1.7.2.4.

Here is the quick fix I did to handle the problem :

--- a/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php
+++ b/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php
@@ -449,7 +449,8 @@ class AdminModelAdapter extends \PrestaShopBundle\Model\AdminModelAdapter
             ],
             'step2' => [
                 'price' => $this->product->price,
                'ecotax' => $this>product->ecotax,
+                // The form is expecting the ecotax will taxes included
+                'ecotax' => \Tools::ps_round($this->product->ecotax * (1 + \Tax::getProductEcotaxRate() / 100), 2),
                 'id_tax_rules_group' => !empty($this->product->id_tax_rules_group) ? $this->product->id_tax_rules_group : $this->taxRuleDataProvider->getIdTaxRulesGroupMostUsed(),
                 'on_sale' => (bool) $this->product->on_sale,
                 'wholesale_price' => $this->product->wholesale_price,

 

To my limited understanding, the product ecotax is stored without taxes. On the product editing backoffice interface, the displayed ecotax is expected to be tax included, as indicated by the textfield label, and the fact that taxes are removed when saving the product ecotax. But the displayed ecotax is tax excluded.

So it looks like it has been forgotten to add back the taxes to the ecotax before displaying it in the backoffice interface.

I am sure I have forgotten some edge cases, and the patch is not the best one, but at least I hope it will help people that have to ship right away a website.

 

Cheers!

Nicolas

All 32 comments

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ antoin_m
  • _Created at:_ Mon, 26 Sep 2016 14:36:06 +0200

PR: https://github.com/PrestaShop/PrestaShop/pull/6481

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ vincentbz
  • _Created at:_ Mon, 26 Sep 2016 19:45:48 +0200

Can't test sorry, I have an error connecting to your branch : Fatal error: Class 'Rijndael' not found in C:\wamp\www\PrestaShop\classes\Cookie.php on line 82

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ antoin_m
  • _Created at:_ Tue, 27 Sep 2016 09:25:56 +0200

Vincent Beudez did you try to clean your cache?

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ vincentbz
  • _Created at:_ Mon, 10 Oct 2016 17:57:10 +0200

Unable to render embedded object: File (capture-for-jira-screenshot-20161010-175252-951.png) not found.

It's working thanks.
There is one small thing : in a combination, the ecotax is Tax Excl whereas it should be Tax Incl.

Thanks

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ antoin_m
  • _Created at:_ Tue, 11 Oct 2016 11:09:09 +0200

Vincent Beudez I updated the PR

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ dragan.skrbic
  • _Created at:_ Thu, 13 Oct 2016 14:55:41 +0200

Test Q&A NOK

Le montant de l'écotaxe saisi est un montant TTC, il ne faut donc pas l'ajouter

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ dd_dd
  • _Created at:_ Tue, 26 Sep 2017 11:14:33 +0200

Hi,

Same issue on 1.7.2.2. Very embarrassing because cannot launch the site (penalties ...)
Please is there a quick fix ?
Where are calculated the prices on BO product page ? It's a mistery ...

thanks
Denis

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ nand2
  • _Created at:_ Wed, 14 Feb 2018 15:40:23 +0100

Hello,

Also being hit by this exact problem on 1.7.2.4.

Here is the quick fix I did to handle the problem :

--- a/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php
+++ b/src/PrestaShopBundle/Model/Product/AdminModelAdapter.php
@@ -449,7 +449,8 @@ class AdminModelAdapter extends \PrestaShopBundle\Model\AdminModelAdapter
             ],
             'step2' => [
                 'price' => $this->product->price,
                'ecotax' => $this>product->ecotax,
+                // The form is expecting the ecotax will taxes included
+                'ecotax' => \Tools::ps_round($this->product->ecotax * (1 + \Tax::getProductEcotaxRate() / 100), 2),
                 'id_tax_rules_group' => !empty($this->product->id_tax_rules_group) ? $this->product->id_tax_rules_group : $this->taxRuleDataProvider->getIdTaxRulesGroupMostUsed(),
                 'on_sale' => (bool) $this->product->on_sale,
                 'wholesale_price' => $this->product->wholesale_price,

 

To my limited understanding, the product ecotax is stored without taxes. On the product editing backoffice interface, the displayed ecotax is expected to be tax included, as indicated by the textfield label, and the fact that taxes are removed when saving the product ecotax. But the displayed ecotax is tax excluded.

So it looks like it has been forgotten to add back the taxes to the ecotax before displaying it in the backoffice interface.

I am sure I have forgotten some edge cases, and the patch is not the best one, but at least I hope it will help people that have to ship right away a website.

 

Cheers!

Nicolas

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ nand2
  • _Created at:_ Thu, 15 Mar 2018 16:05:14 +0100

Hello,

No combinations in my test case, just a "normal" product. I had to apply the code change above to fix the issue.

Nicolas

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Thu, 15 Mar 2018 16:06:04 +0100

All right, so this problem is when we applied a tax at the eco participation

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ david 10
  • _Created at:_ Sat, 9 Jun 2018 10:41:30 +0200

Bonjour,

J'ai signalé ce problème hier BOOM 5711 et suis rattaché à votre groupe. Je suis nouveau sur Prestashop et mon site est bloqué à cause de ce problème d' éco-participation. Pas de mise en ligne possible si, je ne règle pas ce problème. Comme je vois que le problème est signalé depuis plusieurs mois et pas résolu je m'interroge. Quelles sont mes options pour sortir de cette impasse ?
Remerciements

This comment has been migrated from the Forge. Read the original comment here.

  • _Author:_ marion_francois
  • _Created at:_ Wed, 13 Jun 2018 12:00:38 +0200

Hello David BONCORPS

When you create a new issue or when you comment an issue, please send your message in English.
The forge is public and it allows more people to understand

This issue will probably not solved right now because there are more importants to solve before this one.
But PrestaShop is an open source project, so developers can contribute by submitting a pull request here: https://github.com/PrestaShop/PrestaShop/tree/develop

So, if it's very important for you, you can ask to a developer to solve this bug for you and by the way it will also help other people

Regards

BUG still present in version 1.7.5, it is a blocking BUG which generates accounting errors
We must find a solution quickly !!!!
This BUG is serious reminder that it obliges me to propose to my customers a solution other than PRESTASHOP which becomes unusable in France.

Hi @fly-49,

Sorry, the issue not fixed yet.
In the PS1.7.6.0 we are focused to fix prices issues.
Thanks for your understanding!

Still not resolved in 1.7.5 ... here is a quick fix :

in src/PrestaShopBundle/Model/Product/AdminModelAdapter.php

Line 530 :
Replace'ecotax' => $product->ecotax,
by 'ecotax' => round($product->ecotax * (1 + $this->taxRuleDataProvider->getProductEcotaxRate() / 100), 2),

now works ok for me.

Hi @clemrdh,

Thanks for your fix.
Would you be willing to make a pull request on GitHub with your code suggestion?
https://github.com/PrestaShop/PrestaShop/tree/develop
Thank you!

Hi @khouloudbelguith
Just tried on a fresh clean PS1.7.5 install and can't reproduce ...
So must come from somewhere else .... Don't think it's needed to do a pull request for that ...
Thanks,

Hi @clemrdh,

I manage to reproduce the issue with PS1.7.5.0 also.
image
Thanks!

@khouloudbelguith,
This is another issue. Mine was in the BackEnd. Yours in Front.
I cannot reproduce yours with a fresh local install of PS1.7.5.0.
However on my current production install I still have this problem... and its the same version PS1.7.5.0

In same conditions, i.e. when a VAT tax is applied on eco tax :

  • ecotax price is displayed without tax on product page while product price is with tax
  • the total price before taxes in PDF invoice (bottom left) does include the ecotax amount, while the eco tax is listed with VAT on a second separated line

Information in french here

related to #10030

@matks is it fixed into 1.7.7 already ? Thanks

@matks is it fixed into 1.7.7 already ? Thanks

Not fixed yet, else the issue would be closed 😄

@matks there is no milestone associated to this issue, should be targeted to 1.7.7 or i'm missing something?

Hi @hadjedjvincent,
There is no milestone yet. The milestone is applied to the issue when the related pull request is merged.

The product page will be migrated on 1.7.8 version, we will try to address most of the must-have bug from this list. So we wish to solve it on the next version.
Thank you for your understanding,

This issue should be split in different issues as we won't fix all of them in a single PR.

Fixed by #18580

Reopening the issue as unfortunately this github issue contains 4 different bugs to be fixed. My PR only fixed one.

@matks Where 4 bugs ? I see only a process in 4 steps in the first comment.

@matks Where 4 bugs ? I see only a process in 4 steps in the first comment.

Oh, my bad. Either it used to be a list of bugs and it has been split since then or I'm crazy. I hope it's the 1st case.

Yes, we can close this one, I created 2 new issues for other problems

Was this page helpful?
0 / 5 - 0 ratings