[DEV] VAT number validation & VAT exc' group auto-add

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Post Reply
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

[DEV] VAT number validation & VAT exc' group auto-add

Post by Martin »

The issue of charging business/VAT-registered customers in Europe has raised its head so I'm looking at a modification that does the following:
  • Validates entries into the VAT number field (format AND number itself)
  • Auto-add customer to customer group for "VAT exclusive" pricing
  • Charge members of "VAT exclusive" the appropriate prices automatically.
Already got a few useful resources to tap into for this although the last bit could be the illegitimate offspring aspect of things.
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: [DEV] VAT number validation & VAT exc' group auto-add

Post by Martin »

Had some success with this but now appear to be getting some odd results that I can't currently explain...

EDIT: See next post for explanation of how to work around the scenario below
(I've left it in place for anyone else who, lacking documentation, are wondering how to make this work)


It looks like the tax code in 6.1.1 is still broken if you attempt to use it with groups.

Scenario:
- Prices are input as tax inclusive
- You have setup a tax zone (ie: VAT) with 20% on your Default Tax Class
- You change the tax setting so it now applies to "only X groups" and you leave out your VAT group.

Problem:
- Your products will now treat the VAT tax as being EXTRA to your input prices (ie: it doesn't recognise that the inclusive price includes your VAT tax)

I suspect the reason for this is that the code assumes that the tax included in the price is one that must be applied to everyone so if you have a tax code that applies to everyone except one group then that's no longer true. That logic seems reasonable until you realise that you have country specific tax and that there's no other tax zone.


Either way... Another *$£&%ing tax bug...

Ho hum...
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: [DEV] VAT number validation & VAT exc' group auto-add

Post by Martin »

Turns out my guesswork was correct in many respects...

The code seems to require a baseline tax rate for the zone for everyone (not special to groups) to describe the tax it has included in its price. Again I don't see why this should only relate to groups as country based tax doesn't have any issues with this... but hey ho...


To get a VAT/Tax exclusive group to show the correct prices you need to do the following:
  1. Setup a tax zone for the affected countries and make sure it is set for EVERYONE (not to specific groups)
  2. Setup the tax rate(s) as normal (eg: Default Tax Class @ 20%)
  3. Now setup a tax zone for the same affected countries but this time select the
  4. Setup the tax rate(s) for your specific group so that the tax is 0% (or whatever it should be)
In a nutshell it seems that the ISC tax system uses the "Everyone" tax rate to work out what the tax should be and then allows your second duplicate zone with a specific usergroup, to override the everyone tax rate and effectively remove it.


The fact that you have to create a duplicate zone is a pain in the backside but minimal compared to the original ISC tax headaches...

I hasten to add this approach is only test in 6.1.1 so it may well be "fixed" in later versions...
Post Reply