Question

The situation is as follows: We have enabled "cross border trade" and it's working fine (we have products with Gross price defined and VAT is being calculated based on customer country. For each country each customer sees the same end price).

The problem is with our B2B customer, which should have VAT calculated, but they should not pay it.

For example:

  • Retail customer: Gross price 100EUR, VAT for his country is 25%, so VAT is 20EUR.
  • For B2B customer it should be same, but total for him should be excluding tax (80EUR).

Is there a way to set it up (for example with customer groups + tax classes). We're fighting with this for a while and can't google out any solution. Also I can't believe we're the only ones to have that problem. How do you solve it?

Était-ce utile?

La solution 3

We've ended up creating a special helper for this (we call it mixedprice).

You need to overwrite getPrice and getSpecialPrice for Catalog_Model_Product:

public function getPrice()
{
    return Mage::helper('catalog/mixedprice')
        ->getProductPrice($this);
}

public function getSpecialPrice()
{
    return Mage::helper('catalog/mixedprice')
        ->getProductSpecialPrice($this);
}

The idea behind this helper is quite simple, but I need to give more context. We sell our clients software, no physical products. We needed some products to have fixed prices for B2B clients and some products with fixed prices for B2C clients (the end price is constant, vat ammount changes for each customer country). You can't have both obviously.

We have added column for product 'is_vat_included'. For B2B fixed we expect that to be false, for B2C fixed we expect that to be true. (so whoever maintains catalog products has to take care of it).

As you may know: there's global config for magento telling if prices are with or without tax (\Mage_Tax_Helper_Data::priceIncludesTax). We have assumed that this config should be true (you can assume opposite or make no assumptions and take this config into consideration when manipulating prices in "mixedprice" helper.

Rest is quite simple: * if 'is_vat_included' == true for the product, do nothing special * if 'is_vat_included' == false, send it through magento's TaxHelper to calculate price with VAT

So roughly the code would look like this for Catalog_Model_Product:

public function getPrice()
{
    if($this->getIsVatIncluded()) { 
       return parent::getPrice();
    }

    return Mage::helper('tax')->getPrice(
       $this, // product
       parent::getPrice(), // excl. VAT
       true, // ask for price inclugin Tax
       null, // shipping address - we sell downloadable software, you may care more about this param
       $billingAddress, // you can get it from quote
       null, 
       null, 
       false, // price we're passing (parent::getPrice())doesn't include tax
       false, // do not round this price (it's too soon)
    )

}

This is general logic we pulled out to our "mixedprice" helper (I've inlined it here for clarity).

Please note: 1. I can't copy+paste you exact code, so this is rough idea. If you want to manage some stores with products including VAT and some stores where products exclude VAT by default - this method will be more complicated. 2. You need the same trick for product::getSpecialPrice 3. You need even more of it if you are using custom options. 4. Unit testing is your friend - we've used it like crazy (we had to deploy this on 1st of Jan 2015, it worked).

Thanks for @Jeffrey's clarification - please vote up his answer: Cross border tax settings for business clients

Autres conseils

I know exactly what @Meta means. We have the same problem. I will try to explain to make the situation more clear.

We sell a product for € 79,95 including tax. No matter what the tax rate is for a country.

So let's see two examples:

  • The Netherlands: € 79.95 including 21% tax (€ 13.88 tax)
  • Germany: € 79.95 including 19% tax (€ 12.77 tax)

When a B2B customer orders we need to exclude the tax. But the cross border trade setting handles it the same as any other rate. Understandable but thats not what we want.

So with cross border trade enabled it does:

  • The Netherlands: € 79.95 excluding tax (€ 0.00 tax)
  • Germany: € 79.95 excluding tax (€ 0.00 tax)

While what @Meta want is:

  • The Netherlands: € 66.07 excluding 21% tax (€ 13.88 tax)
  • Germany: € 67.18 excluding 19% tax (€ 12.77 tax)

While what I want is:

  • The Netherlands: € 66.07 excluding 21% tax (€ 13.88 tax)
  • Germany: € 66.07 excluding 21% tax (€ 13.88 tax)

Yes. I guess you've already set up all the EU Countries with their appropriate tax rates for the bit you've got working. You need at least one more Customer Tax Class, e.g. 'EU B2B'. Then you need to go to configuration/customers/customer configuration and change the create new account options to enable automatic assignment of group on valid vat id, and set the Group for Valid VAT ID - Intra-Union to EU B2B. Have a look at the other settings see what you want to use, but the combination of these two settings means that when a customer enters a Valid (according to VIES) vat number, magento will take the vat from the transaction.

Note that the way magento expect the VAT number is without the country code prefix, it combines the number with the country code for the address when it validates it. We wrote some code to strip out the country code if present, as most people include it. This doesn't work for Greece at the moment, as whoever wrote the code didn't realise that Greek VAT codes are prefixed EL not GR

Also, while I'm not an accountant, and haven't use the cross-border trade option, and our prices are based on being ex-vat: If you're not VAT registered in all those other countries, you should be collecting VAT on your own VAT number at your native VAT rate. If your turnover in one of those countries exceeds their limit (€33000 or €100000 depending on the country) you'd need to register for VAT in that country, and then collect VAT at that countries rate.

Maybe not the most beautiful solution but if you really want to avoid coding you can solve it by setting up a group price for each VAT zone you are registered in.

Say you are based in Sweden (25% VAT) but also registered for German VAT (19%). You set up two product groups: EU-company and German-company.

For a product which is €100 you set a group price for customer group EU-company to €80 and for customer group German-company you set it to €84.

First you, of course, add the customer groups under customer >> customer groups and assign your B2B customers to the right group. Then you edit the prices by going to each products' detail view and then prices and then add group price. With a lot of products you will want to script the group price setup which is rather easy.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top