Jump to content

EU VAT addon issue (limit reached), workaround?


-M-

Recommended Posts

Hi people,

 

I have an issue with the EU VAT addon which is supplied by WHMCS.

 

We regularly hit the limit with VIES (I guess it checks VAT numbers there real-time with WHMCS).

As a result customers aren't able to use their VAT number, which results in excessive phone calls and emails and more importantly we will also lose new customers. It also slows the whole website down until it receives a response because of this.

 

If I check with VIES, I can see which message it's getting:

 

Your Request for VAT validation has not been processed; the maximum number of concurrent requests for this Member State has been reached. Please re-submit your request later or contact TAXUD-VIESWEB@ec.europa.eu for further information.

 

Therefor I am wondering if it's possible to exclude VAT validation when customer is based in the same country as the hosting provider (us).

It's really of no use at all to validate a VAT number if the customer is in the same country. As a result of this, it will check with VIES less often and the whole order procedure would work better.

 

So hosting provider is based in the Netherlands (NL) and a new Dutch customer signs up with his company, he will be able to enter his VAT number without any issues at al..

 

Obviously, we would have done this ourselves, but like everything else, everything is hardcoded with WHMCS. Sigh...

 

Thanks in advance.

 

 

FYI: leaving the field empty is not really an option, as we tried that and people called us and informed us our form was "bugged" as they couldn't fill in their VAT number.

 

Regards

Link to comment
Share on other sites

I have an issue with the EU VAT addon which is supplied by WHMCS.

We regularly hit the limit with VIES (I guess it checks VAT numbers there real-time with WHMCS).

it'll be contacting the EU URL directly and not going anywhere near WHMCS if that's what you mean.

 

As a result customers aren't able to use their VAT number, which results in excessive phone calls and emails and more importantly we will also lose new customers. It also slows the whole website down until it receives a response because of this. If I check with VIES, I can see which message it's getting:

is this applying to all member states? if memory serves, the enquiry is redirected to the member state database (as there is no EU VAT database) specified in the VAT Number.

 

Therefore I am wondering if it's possible to exclude VAT validation when customer is based in the same country as the hosting provider (us).

It's really of no use at all to validate a VAT number if the customer is in the same country. As a result of this, it will check with VIES less often and the whole order procedure would work better.

So hosting provider is based in the Netherlands (NL) and a new Dutch customer signs up with his company, he will be able to enter his VAT number without any issues at al..

Obviously, we would have done this ourselves, but like everything else, everything is hardcoded with WHMCS. Sigh...

FYI: leaving the field empty is not really an option, as we tried that and people called us and informed us our form was "bugged" as they couldn't fill in their VAT number.

i'd be tempted to suggest a variation of the code in the thread below...

 

https://forum.whmcs.com/showthread.php?126030-custom-fields-on-order-form-conditional-logic-(hide-show-options)&p=505054#post505054

 

in that code, you have 2 customfields (dropdown and text box) - a specific value of the dropdown customfield triggers a hidden text customfield to be shown...

 

what you'd need to do is one of two things...

 

1. hide the default VAT customfield when the user selects "Netherlands" in the country dropdown...

2. or hide the default VAT field when users selects "Netherlands", but show a hidden text custom field that mirrors the VAT field output - in other words, for anyone outside of NL, they'd be entering their VAT number in the default field and it will be checked by VIES; customers in NL, will be entering their VAT number in an identical duplicate field but it won't be submitted to VIES - but you'd still be able to see their number in their client profile.

 

I could imagine the coding might need some tweaking, but I think it should work...

Link to comment
Share on other sites

Who else than brian! answered? :P

 

it'll be contacting the EU URL directly and not going anywhere near WHMCS if that's what you mean.

 

Yeah, I know and I meant that. But the stuff is hardcoded and therefor unable to make any changes. Would be 1000000000 times easier, but WHMCS doesn't give a **** about their customers.

It's proved in the past and it's proven now. Sigh.

 

I even contacted (yeah stupid, I know, but maybe something changed lol) WHMCS support and guess what:

 

Thanks for reaching out to WHMCS Support. Unfortunately, the functionality you're looking for here is not something that is currently offered by the addon.

 

However I can see how preventing vat validation in some cases could be useful. Therefore I would encourage you to please submit a request to our feature requests tracker where other users can contribute to and vote on your idea. Ideas with the most votes and activity do get reviewed by our team.

 

http://requests.whmcs.com

 

Still the same lousy support and still the same answers as over 1 year ago. How on earth can you call this support. I really, really feel dumb for reaching out to "support". Matt shoudl really be ashamed of this kind support. I said it before and I will say it again; the only one who really gives SUPPORT around here is brian... If it wasn't for brian, we would have quit using WHMCS straight away.

 

 

 

is this applying to all member states? if memory serves, the enquiry is redirected to the member state database (as there is no EU VAT database) specified in the VAT Number.

 

To be honest I only tried it with different Dutch VAT numbers; obviously these are our main customers...

...but guessing at the message the VIES system throws back, I am guessing it's only to NL currently (or at least yesterday).

 

 

 

i'd be tempted to suggest a variation of the code in the thread below...

 

https://forum.whmcs.com/showthread.php?126030-custom-fields-on-order-form-conditional-logic-(hide-show-options)&p=505054#post505054

 

in that code, you have 2 customfields (dropdown and text box) - a specific value of the dropdown customfield triggers a hidden text customfield to be shown...

 

what you'd need to do is one of two things...

 

1. hide the default VAT customfield when the user selects "Netherlands" in the country dropdown...

2. or hide the default VAT field when users selects "Netherlands", but show a hidden text custom field that mirrors the VAT field output - in other words, for anyone outside of NL, they'd be entering their VAT number in the default field and it will be checked by VIES; customers in NL, will be entering their VAT number in an identical duplicate field but it won't be submitted to VIES - but you'd still be able to see their number in their client profile.

 

I could imagine the coding might need some tweaking, but I think it should work...

 

I guess that would be the only "solution" as WHMCS is clearly unwilling to fix this or make some kind of toggle switch to enable/disable VAT checking for customers living in the same country as the hosting provider. Guess they find it more important to add new (useless) features. I will investigate it a bit better and see if I can manage to get it working in our current form.

 

Anyways I want to thank you (brian!) for again helping me out. For me WHMCS = brian! :)

WHMCS support division can and would really learn something from you.

 

Regards

Edited by MvdL1979
fixed closing quotes.
Link to comment
Share on other sites

Yeah, I know and I meant that. But the stuff is hardcoded and therefore unable to make any changes.

purely in terms of VIES, to check a VAT number is relatively straightforward - this isn't my PHP code, but it works...

 

<?php
$vatid = 'GB927773676'; // replace for the VAT-ID you would like to check

$vatid = str_replace(array(' ', '.', '-', ',', ', '), '', trim($vatid));
$cc = substr($vatid, 0, 2);
$vn = substr($vatid, 2);
$client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");

if($client){
   $params = array('countryCode' => $cc, 'vatNumber' => $vn);
   try{
       $r = $client->checkVat($params);
       if($r->valid == true){
           // VAT-ID is valid
       } else {
           // VAT-ID is NOT valid
       }

       // This foreach shows every single line of the returned information
       foreach($r as $k=>$prop){
           echo $k . ': ' . $prop;
       }

   } catch(SoapFault $e) {
       echo 'Error, see message: '.$e->faultstring;
   }
} else {
   // Connection to host not possible, europe.eu down?
}
?>

interestingly I say it works, but the above VAT number is from the WHMCS website... and it's invalid - even the main VIES website confirms that... :roll:

 

isn't it against UK/EU law/directive not to display the correct VAT details on a website? perhaps we need to submit a feature request to get them to correct it and it'll be resolved by the time the UK leaves the EU! :-P

 

having checked an invoice from WHMCS, I see that 1 digit is wrong on the website number (perhaps a typo?) - if I use the correct VAT number from the invoice, it outputs the correct business name and registered address... works fine with yours and our VAT number too.

 

anyway, the point i'm getting at is that for validating VAT numbers with VIES, you might be better off getting a developer to code a quick addon for you (perhaps even with js) - that would allow you to disable that option in the EU-VAT addon and determine the conditions of if/when a VIES check is done.

 

https://github.com/nephics/euvat-direct

https://github.com/viruschidai/validate-vat

 

yeah a bit of a pain to do that rather than just edit the existing addon code - but it'd be quicker than submitting a feature request. :idea:

Link to comment
Share on other sites

So sorry for the late reply brian!

 

I was extremely angry after the stupid/lazy answer I received from WHMCS support the other day and decided it was "wiser" to leave it alone for several days!

I seriously have no clue what support are doing all day there. It must be the easiest job in the world to be on the WHMCS so-called "support"-team. *shrugs*

 

Thank you for showing that sample code, maybe I will let someone code a addon, but for now; I will leave it alone as I have no idea on how to use it anyways in WHMCS.

 

 

isn't it against UK/EU law/directive not to display the correct VAT details on a website? perhaps we need to submit a feature request to get them to correct it and it'll be resolved by the time the UK leaves the EU!

 

LMAO :P

 

Anyways, I think the first solution will be better as we have already a coded hook/addon which greys out several fields depending on if they are business or a private person.

But I will have to look into it though if it can be modified a bit easier. For the time being I will just add some extra textual warnings abouts it.

 

Thank you for your answer and sorry again for the late reply...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated