I'm posting this only because I keep losing this simple VATMOSS logic, and my blog doubles as my online memory bank. It's also important for me to say VATMOSS does not rule, it's terrible.
Anyway, this is the logic that states when VAT should be applied to which kinds of customers.
MY EVENTAttend ffconf.org 2018
The UK's best JS and web development conference. 8 amazing speakers, workshops, socials — find out more & get tickets today.
What to capture
- VAT (optional and validated though all kinds of silly methods)
This is from the perspective of being in the UK.
IF country IS "GB" ADD_VAT IF country IS IN (eu) AND vat IS EMPTY ADD_VAT IF country IS IN (eu) AND vat IS NOT EMPTY DO_NOT_ADD_VAT ELSE DO_NOT_ADD_VAT
List of EU countries and ISO codes (from GOV.UK):
HR, Republic of Cyprus
CY, Czech Republic
SE and the UK
var EU = ['AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'EL', 'ES', 'FI', 'FR', 'GB', 'HR', 'HU', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK'];
Where to get latest EU VAT rates: http://jsonvat.com
Usual caveat's apply: this not consistute as financial advice, if you copy and paste this and it's wrong, you're responsible!