VAT tax rates are not calculating correctly when having multiple VAT tax rates.

To reproduce the bug, do the following steps:

  • Install Commerce Kickstart with products and product display nodes
  • Add tax rate ".10" of type VAT
  • Add tax rate ".20" of type VAT
  • Select .10 tax rate for PROD-01
  • Select .20 tax rate for PROD-02
  • Add PROD-01, PROD-02, PROD-03 products to your cart
  • Go to see your shopping cart

I expected product one to cost $10, product two $20 and product three $30. Instead I have, $12, $22, $39.60.

Screenshot of shopping cart contents

Comments

Note that, when you remove the .20 rate and then select .10 rate for all products, you'll see all okay.

Screenshot

I can confirm this bug. Also it should be noted that for the third product commerce also adds VAT even though it's not configured for it.

Category:bug» support
Status:Active» Fixed

This actually is working as designed, though there's a related issue in the queue to consider changing the existing behavior.

When you select a VAT rate on the product form, you're saying the price of the product you've entered includes that VAT. It will always be present, bypassing any conditions you may place on the VAT rate's Rules. Still, any other VAT rate may also be applied because of the default Rules.

So, you said product one included the 10% rate already, so when the rule for the 20% rate executed you ended with a price of $10 (incl. 10% VAT) + the additional 20% VAT (i.e. $2) for a total of $12. Same for the $20 product, just in reverse. For the $30 product, you didn't enter the price including any VAT already, so both got added through the Rules for the total of $39.60.

What you could've done is simply disabled the default Rule that attempts to apply every VAT to every product on the site. Then only the VAT you select on product edit forms would've been taken into consideration. You just wouldn't be able to use any sort of conditional visibility on the rates.

I can't remember the precise other issues dealing with this issue, but if you search for issues including bojanz in the discussion, you'll find 'em.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Version:7.x-1.2» 7.x-1.x-dev
Status:Closed (fixed)» Active

I think we still have a problem here.

When multiple VAT rates exist in the store, each product will still only get one applied.

Hence a store that requires multiple VAT rates (which in the UK is anything that sells children's clothes, so not that uncommon) will have to disable the 'apply VAT to everything' rule.

But then the price field UI is misleading, because you now MUST enter prices with the correct VAT rate included, otherwise the system won't work.

Priority:Major» Normal
Status:Active» Closed (works as designed)

I'm quite sure this is still just the original limitation of entering product prices including VAT I mentioned above. If a store has multiple VAT rates and they want to include product prices including VAT, the answer is to do exactly as joachim described - disable the default Rule that attempts to apply tax rates generally. The default tax Rules in place are there as an abstract starting point to ensure taxes are at last being applied "in general", but the system should be tailored to meet a site's specific needs.

If a store has multiple VAT rates and doesn't want to enter prices including VAT, then you just need to add the appropriate conditions to the tax rate components so taxes only get applied where appropriate. I suppose you could use conditions to prevent multiple tax application even if you're entering product prices including VAT, but it seems it would be easier to just disable the default VAT rule in that case.

Any clue on how to have a VAT rate depending on product type (or on a condition based on product fields) ?

This is a common need in many countries where there are multiple VAT rates I guess.

Component:Tax» Developer experience
Category:support» feature
Status:Closed (works as designed)» Active

> If a store has multiple VAT rates and they want to include product prices including VAT, the answer is to do exactly as joachim described - disable the default Rule that attempts to apply tax rates generally

This actually means that VAT support is not very good for a large number of countries that use VAT. Skim-reading http://en.wikipedia.org/wiki/VAT#Different_systems, most EU countries (apart from Denmark) have multiple rates.

Is this something that could be improved for subsequent releases of Commerce?

Exactly, and the answer given is not an answer to the problem... Have no tax rules is not the same than to have a multiple tax rules.

[Edit] solved using Rules : http://vimeo.com/29725767

Category:feature» bug
Priority:Normal» Major

The more I think about it, the more I think that the default Rules configuration for VAT rate taxes that comes with Commerce is just not doing the right thing.

Currently, the way it works is that every vat rate tax gets a rule which applies the tax to every product in the cart. So given vat rates A and B, this happens:

* product X: +A, +B
* product Y: +A, +B

That's wrong for countries with multiple vat rates, or for stores that cover more than one country. The only case in which it works is if you have only one country and only one vat rate.

There's an extra bit of logic too. You can mark the product price as having vat already included. This is very handy for site owners, because they usually want to work in prices that include vat and let the system do the calculations.

But then this happens.

* product X, vat A already included: +B
* product Y: +A, +B

Rate B gets applies to product X!

The problem is that this logic is again only suited to single-rate sites. It's saying: "For each vat rate: apply the vat to each product, unless that product has this vat rate already included".

When what needs to happen is: "for each vat rate, apply the vat to each product **that it applies to**, unless that product has the vat rate already included.

In practical terms, I think we need to change the VAT price UI from this:

[price] [included vat rate]

to:

[price] [applicable vat rate] [x] included?

and then change the default rule so only one vat rate is applied per product.

This will satisfy countries with multiple vat rates, sites with multiple countries, and the currently working case of sites in countries with only one vat rate.

I agree with rszrama this works as designed. If two VAT rate rule components evaluate as true for a product how could the main VAT rule decide which to apply?

However I do think there could be improvements to the admin UI for entering a product price and that is covered in other tickets.

@joachim
You should check the video (http://vimeo.com/29725767), you'll see it is possible to use Rules in order to manage multiple tax rates. I've done this (French store, 2 tax rates) and it works perfectly well and elegantly.

For my own purpose, I've included a select field on product representing taxes, and the taxes rules components have conditions depending on this field.

The video explains an unnecessary workaround (imho).
Why do I have to selected WHICH rate to apply to product if that selection doesn't affect ANYTHING?

Rather than adding a taxonomy and a rule, I think the solution is make available to rules the 'included tax' selection field. THAT field should already do what we need with multiple VAT rates.

Actually, disabling the VAT calculation rule DOES work, since it works as a precalculation rule. It works for me, since I want to show tax rates just at the end. But what if I had to show them on the product page?

I agree that the current defaults are pretty confusing for someone who wants to setup a store with multiple VAT (very common here in Europe).

The confusing part is the main rule and the separate rule-components for each VAT, plus the fact you need to create a seperate field to select a VAT (if you don't want it to be included in the price)

After some googling, I also found this module.
http://drupal.org/project/commerce_eu_vat

Which actually creates a reference field and necessary taxes (for eacht EU country) and could be a solution.

I tried the EU VAT module, but it does not work as it should, sadly.

commerce_eu_vat now has a 2.x branch based on http://drupal.org/project/commerce_vat.

And yes, the "include tax" dropdown is completely illogical and trips everyone up.

Hmm, never tripped me up. : )

After disabling Commerce Tax and installing http://drupal.org/project/commerce_eu_vat and it's dependencies it all works great for me! I enabled it's Commerce EU VAT NL submodule that adds current Dutch VAT rates. The Commerce VAT Field submodule of Commerce VAT is a dependency of Commerce EU VAT which automatically adds a VAT field to product Commerce price fields, ie. at product variation edit pages.

Eventually we added some custom field formatters to present prices without VAT and format prices the way it suits our clients needs the best. So far so good!

Thanks all...

Issue summary:View changes

I fully agree with joachim at #11: if I select VAT A to be included in a price, why should VAT B be added too afterwards. This doesn't make sense. Is there any country where several VATs exist for a same product?

Please refer to my earlier comments; it doesn't make sense, and no one's saying it makes sense. It's just a matter of choosing a configuration that supports your desired VAT input method (i.e. disabling the default VAT related product pricing rule).

Title:Prices are calculated incorrectly on multi VAT tax rate environmentPrices are calculated confusingly on multi VAT tax rate environment
Category:Bug report» Task
Priority:Major» Normal
Status:Active» Postponed

I'm marking this postponed until there's a clear way forward. To respond more appropriately to comment 21, you just need to complete your configuration of Drupal Commerce VAT. It doesn't work correctly out of the box for every situation - it just makes a very generic assumption because a more specific one isn't possible in the abstract. You can disable the default pricing rule that applies VAT or add conditions to the individual VAT rate rules components that govern their applicability. Whatever strategy you want depends on your store's configuration, but there's no bug in the way this is currently functioning.

Ultimately, we just need a way to clarify the situation. I'm open to more suitable default behaviors, but about the only alternative I can imagine is to not create a default rule to apply VAT to products - which we all know would just fill up the issue queue with "I added VAT but it's not applying to anything" issues. : )

I'm sorry, but I haven't access anymore to that drupal installation, so I have to create another one to test it. It may take some time.