Jump to content
thirty bees forum

Bug in EU Advanced Compliance with shipping taxes?


30knees

Recommended Posts

Hi, Could someone else please check that when enabled the EU Advanced Compliance module takes the shipping price and adds VAT on top of it? This is surprising for me and I don't know whether it's intended or not. I would expect the module to take the shipping price entered at the carrier as gross, i.e. including taxes, and not net. What would you expect?

Link to comment
Share on other sites

It's indeed intention! With enabled AEUC you have to be aware that shipping costs will be treated as tax included. But I can confirm this, tb treats the tax as net and adds the tax to shipping costs in checkout, really confusing. This is a bug!

Link to comment
Share on other sites

Thanks, @Occam! That means that if I have "Proportionate tax for shipping and wrapping" enabled the shipping rate will change dependent on the contents of the cart? Is there any way to fix this? That's really a big bug - we need to tell our customers in advance what the shipping rate is, but we can't if it's dynamic.

Link to comment
Share on other sites

You can find the bug in function getPackageShippingCost of class Cart.php It starts absolutely right from line 1882:

       if (Configuration::get('PS_ATCP_SHIPWRAP')) {
            // With PS_ATCP_SHIPWRAP, pre-tax price is deduced
            // from post tax price, so no $carrier_tax here
            // even though it sounds weird.
            $carrierTax = 0;
            (...)

But it ends wrong from line 2003 on, because with AEUC option enabled the tax is added to the shipping costs and not deducted from this figure which would be correct:

    if (Configuration::get('PS_ATCP_SHIPWRAP')) {
        if ($useTax) {
            // With PS_ATCP_SHIPWRAP, we apply the proportionate tax rate to the shipping
            // costs. This is on purpose and required in many countries in the European Union.
            $shippingCost *= (1 + $this->getAverageProductsTaxRate());
        }

A workaround is quite simple. Just deactivate line 2007

    if (Configuration::get('PS_ATCP_SHIPWRAP')) {
        if ($useTax) {
            // With PS_ATCP_SHIPWRAP, we apply the proportionate tax rate to the shipping
            // costs. This is on purpose and required in many countries in the European Union.
            //$shippingCost *= (1 + $this->getAverageProductsTaxRate());
        }
Link to comment
Share on other sites

@mdekker I think generally you're right, though in Germany the legal opinion is divided whether displaying the shipping costs directly before the "Buy now" step is enough or whether you need to show them also before.

However, something else to take into consideration is that the link "Shipping excluded" (which should be changed to "plus shipping") next to the price on the product page leads to the shipping cost overview page. I don't think listing net shipping costs and explaining that the total will depend on a proportionate calculation makes sense.

Link to comment
Share on other sites

@30knees said in Bug in EU Advanced Compliance with shipping taxes?:

@mdekker I think generally you're right, though in Germany the legal opinion is divided whether displaying the shipping costs directly before the "Buy now" step is enough or whether you need to show them also before.

However, something else to take into consideration is that the link "Shipping excluded" (which should be changed to "plus shipping") next to the price on the product page leads to the shipping cost overview page. I don't think listing net shipping costs and explaining that the total will depend on a proportionate calculation makes sense.

At least in Germany in my opinion it should be ok when you show the exact shipping costs during the checkout process, because AEUC provides the link to shipping costs near every product price. You can avoid this irritating "free shipping" in the cart (as long as the shipping costs can not be calculated) by adding a boolean condition to hide this display when $is_logged is not true.

@mdekker There seems to be another bug in the proportianate taxes for shipping. If you have mixed taxes in the order and the quantity of products with the lower amount is greater than 1 the proportionate tax on shipping is the same as for the other tax rate, but negative. And btw there are problems with the invoice, too: 1. If you entered a base price for at least one of the products, instead of tax label/tax rates the base price is shown. But this should not be considered as alternative.

    {if isset($layout.before_discount)}
        <th class="product header small" width="{$layout.unit_price_tax_excl.width}%">{l s='Base price' pdf='true'} <br /> {l s='(Tax excl.)' pdf='true'}</th>
    {/if}

2. The variable $order_detail.total_price_tax_excl_including_ecotax contains the same as $order_detail.unit_price_tax_excl_before_specific_price. It's not the total amount!

Link to comment
Share on other sites

  • 1 month later...

@30knees Technically yes, it should solve the bug. But as long as TB ignores overrides in this place, the clear answer is NO. It works fine with PrestaShop, but not with TB. Btw some of the additional features of PrestaPlus like individual delivery times (in stock and OOS) for every single product were implemented into PS 1.7 core last week.

Link to comment
Share on other sites

  • 3 years later...

I wouldn't agree, because I cannot reproduce the behavior you were talking of at Github. My fix there from 2017 is currently implemented in a slightly different way to tb so that the workaround I posted is obsolete and outdated now.

        if (Configuration::get('PS_ATCP_SHIPWRAP')) {
            if ($useTax) {
                // With PS_ATCP_SHIPWRAP, we apply the proportionate tax rate to the shipping
                // costs. This is on purpose and required in many countries in the European Union.
                $shippingCost *= 1 + $this->getAverageProductsTaxRate();
            }
        } else {
            // Apply tax
            if ($useTax && isset($carrierTax)) {
                $shippingCost *= 1 + ($carrierTax / 100);
            }
        }

In my release issue-905 from Bleeding Edge it's line 2138-2149 in /classes/Cart.php. I tested it with both the standard invoice and my own invoice (adapted to tb). Each and every figure is correct.

Works fine. I guess there's else something causing your problems, provided that everything configured is properly.

  • Like 1
Link to comment
Share on other sites

1 hour ago, 30knees said:

Would you mind commenting whether this configuration is correct:

1. Disable AEUC. YES, otherwise you cannot disable the tax rate

2. Set tax rate for shipping. NO, delete it.

3. Add shipping rate.NO

4. Enable AEUC. YES

5. Activate proportional calculation. YES

Seems to me that it was a misconfiguration. Never set a shipping tax rate when you use AEUC (hopefully my own modified release)

Link to comment
Share on other sites

8 hours ago, Occam said:

AEUC (hopefully my own modified release)

Where can I find it? I checked here and on Github but didn't come across a release of yours.

8 hours ago, Occam said:

3. Add shipping rate.NO

So I add the shipping rate (cost) after I activate proportional calculation? 

Link to comment
Share on other sites

Actually, I was too hasty. I still get this.

image.thumb.png.acfa53c6d015311602ded72dd278c2db.pngThe base price of the shipping is still tax included.

This is how my cart.php file looks:

  if (!Configuration::get('PS_ATCP_SHIPWRAP')) {
        //    if ($useTax) {
                // With PS_ATCP_SHIPWRAP, we apply the proportionate tax rate to the shipping
                // costs. This is on purpose and required in many countries in the European Union.
        //        $shippingCost *= 1 + $this->getAverageProductsTaxRate();
        //    }
       // } else {
            // Apply tax
            if ($useTax && isset($carrierTax)) {
                $shippingCost *= 1 + ($carrierTax / 100);
            }
        }
        $shippingCost = round($shippingCost, _TB_PRICE_DATABASE_PRECISION_);

Any ideas? 

As I said, I'm more than happy to pay someone and have this fixed and flow into the codebase. 

Link to comment
Share on other sites

  • 2 weeks later...

Of course!

German invoice with  mixed taxes:  RE000019.pdf

And please, don't try to "approve" the Cart.php. Leave the code (where it deals with AEUC) like this:

 if (Configuration::get('PS_ATCP_SHIPWRAP')) {
            if ($useTax) {
                // With PS_ATCP_SHIPWRAP, we apply the proportionate tax rate to the shipping
                // costs. This is on purpose and required in many countries in the European Union.
                $shippingCost *= 1 + $this->getAverageProductsTaxRate();
            }
        } else {
            // Apply tax
            if ($useTax && isset($carrierTax)) {
                $shippingCost *= 1 + ($carrierTax / 100);
            }
        }
        $shippingCost = round($shippingCost, _TB_PRICE_DATABASE_PRECISION_);

        Cache::store($cacheId, $shippingCost);

        return $shippingCost;

 

Edited by Occam
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...