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 WORKSHOPMaster Next.js
Everything you need to master universal React with Next.js in a single intense master class. Includes full pass to ffconf, the web developer conf.
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!