To comply with VAT law we must do the following...
1. Not charge VAT to anyone outside the EU.
2. Not charge VAT to anyone outside the UK but in the EU who is a business.
3. Do charge VAT to everyone in the UK and anyone who is an individual in the EU.
I need a way of setting the VAT on specific countries, is this possible?
I need a way to determine if a customer in the EU (but not in the UK) is a business and if they are a business, not charge them VAT. One way to do this is to ask them for their registered VAT number as proof but there needs to be some kind of trigger to take VAT off their order if they supply a valid, non UK but EU VAT number.
Currently we cannot take any business from countries outside europe or european (non UK) businesses without breaking VAT laws because we dont have a way to not charge them VAT.
This following code will check the EU VAT web service for an existing VAT number...
<?php
class checkVat {
var $countryCode;
var $vatNumber;
function __construct($cc, $vat)
{
$this->countryCode = $cc;
$this->vatNumber = $vat;
}
}
function checkVat($vat){
$vat = trim($vat);
$vat = str_replace(" ","",$vat);
$vat = str_replace("-","",$vat);
$vat_prefix = substr($vat, 0, 2);
$vat_num = substr($vat, 2);
$wsdl = 'http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl';
$vies = new SoapClient($wsdl);
$nii = new checkVat($vat_prefix, $vat_num);
try {$ret = $vies->checkVat($nii);}
catch (SoapFault $e){
$ret = $e->faultstring;
$regex = '/\{ \'([A-Z_]*)\' \}/';
$n = preg_match($regex, $ret, $matches);
$ret = $matches[1];
$faults = array(
'INVALID_INPUT' => 'The provided CountryCode is invalid or the VAT number is empty',
'SERVICE_UNAVAILABLE' => 'The SOAP service is unavailable, try again later',
'MS_UNAVAILABLE' => 'The Member State service is unavailable, try again later or with another Member State',
'TIMEOUT' => 'The Member State service could not be reached in time, try again later or with another Member State',
'SERVER_BUSY' => 'The service cannot process your request. Try again later.'
);
$ret = $faults[$ret];
}
/*
Return results
0 = Invalid VAT number
1 = Valid VAT number
2 = Communication error
*/
if (!is_object($ret)){ // An error occurred
return 2; // SOAP ERROR
} else {
foreach ($ret as $k => $v) {
if ($k == "valid"){
if ($v==1){
return 1; // Valid VAT
} else {
return 0; // invalid VAT
}
}
}
}
}
?>
The above will apply to any european country - the VAT laws are the same as far as I know. You cant charge VAT to anyone outside the EU, you must charge VAT to any individual who is in the EU but any EU business outside your own country must not be charged VAT.
Anyone running a hosting business in Europe who is not complying to the above specifics is breaking the law.
Question
4uh
To comply with VAT law we must do the following...
1. Not charge VAT to anyone outside the EU.
2. Not charge VAT to anyone outside the UK but in the EU who is a business.
3. Do charge VAT to everyone in the UK and anyone who is an individual in the EU.
I need a way of setting the VAT on specific countries, is this possible?
I need a way to determine if a customer in the EU (but not in the UK) is a business and if they are a business, not charge them VAT. One way to do this is to ask them for their registered VAT number as proof but there needs to be some kind of trigger to take VAT off their order if they supply a valid, non UK but EU VAT number.
Currently we cannot take any business from countries outside europe or european (non UK) businesses without breaking VAT laws because we dont have a way to not charge them VAT.
EU VAT number validity can be acheived using a free javaascript here http://www.braemoor.co.uk/software/vat.shtml
This following code will check the EU VAT web service for an existing VAT number...
The above will apply to any european country - the VAT laws are the same as far as I know. You cant charge VAT to anyone outside the EU, you must charge VAT to any individual who is in the EU but any EU business outside your own country must not be charged VAT.
Anyone running a hosting business in Europe who is not complying to the above specifics is breaking the law.
Link to comment
Share on other sites
17 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.