Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
haylau

VAT Module issues

Question

I have had this issue before but forgot. I have updated the VAT module to latest release and there is a bug that has been there in previous releases also

I am not sure how widespread this is, but it is definitly an issue for UK based sellers with ES VAT business customers

When entering the ES (Spanish) VAT number we get an invalid number message

The problem is in vatnumber.php

 

Line 228 is

 $url = 'http://ec.europa.eu/taxation_customs/vies/viesquer.do?ms='.urlencode($prefix).'&iso='.urlencode($prefix).'&vat='.urlencode($vat);

I think this is an old PS issue also as I found the solution on the PS forum (http://forge.prestashop.com/browse/NM-824)

Changing that line to

 $url = 'http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode='.urlencode($prefix).'&number='.$vat.'&traderName=';

Makes the VAt number valid

Edited by haylau
  • Like 2
Link to comment
Share on other sites

24 answers to this question

Recommended Posts

  • 0
9 hours ago, Traumflug said:

Thanks for the heads up. Here's a preview version with this fix applied (which will go into v2.2.1 of this module):

vatnumber-master.zip

Did you only change that line or are there other changes? 

Why? Because it crashed my site with the dreaded 500 error. I tried a couple of times (upload from back office, and manual via ftp), so uninstalled for now and reverted back

Link to comment
Share on other sites

  • 0

Still does  not work

$url = 'http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode='.urlencode($prefix).'&number='.$vat.'&traderName=';

 

I think the tradername part is missing?

 

Link to comment
Share on other sites

  • 0

Using the code from above, the traderName field is always empty, so it shouldn't matter. As this URL loads an ordinary HTML page, one can try in the browser:

http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode=DE&number=171017618

http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode=DE&number=171017618&traderName=

This VAT ID is my own, so it should be valid. However, the HTML page reads "Member State service unavailable. Please re-submit your request later." ... which the module recognizes as an invalid ID report.

Link to comment
Share on other sites

  • 0

I understand, it should work. But it does not without the tradename. Remember by initial post - it affected the spanish VAT number (ES)

 

Try these

 

http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode=ES&number=B63622740&traderName=
http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode=ES&number=B63622740

  • Like 1
Link to comment
Share on other sites

  • 0

"Does not work", like this?

image.png.3c5fd466e2002eabf4ef020ab0bb58ca.png

(I just clicked the link above)

This is starting to become a head scratcher. I also tried from the thirty bees server (which is located in Germany):

$ curl 'http://ec.europa.eu/taxation_customs/vies/vatResponse.html?locale=EN&memberStateCode=DE&number=17101aderName=' | grep -i 'valid VAT number'  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current  
                                 Dload  Upload   Total   Spent    Left  Speed  
100 13423    0 13423    0     0  50469      0 --:--:-- --:--:-- --:--:-- 50652  
                       <b><span class="validStyle">Yes, valid VAT number</span></b>

I'll also ask @lesley, he's outside the EC.

Link to comment
Share on other sites

  • 0

Really weird. Every thing now works. 

Last night I tried at least half a dozen Germany VAT codes that did not work. Now they do. 

Hmmmm

Anyway, all looks good at the moment. I will do some random checks over the next few days. Perhaps it is more a random VIES issue that the module

Link to comment
Share on other sites

  • 0

They indeed simply turn off this service without notice. Seeing all the trouble here I started implementing this request using the recommended SOAP protocol. Up to around 10:00PM the service worked just fine. Since then it just reports "Member state service unavailable". And it's not back online 2 hours later, at 00:15AM.

Welcome to the Internet, European Community!

Good news: the SOAP response can distinguish between a VAT number found to be invalid and a service not working.

Now I wonder what to do with a missing service response. Slapping this into the customer's face likely means a lost sale, as he can't get past this without accepting to pay VAT. Maybe the module should accept the number, but also send an email to the merchant, notifying him about the VAT number being unverified.

Link to comment
Share on other sites

  • 0

Anything to minimise disruption to the buyer - I agree. I almost lost a long standing customer because of this. So yes, I think an email to merchant. But also, if possible, change the order status to "Check VAT" or something similar?

Link to comment
Share on other sites

  • 0

Hi, 
I'm using this old thread to report that something doesn't seem to work right anymore with the module.
In one shop taxes were deduced from customers that have random stuff in the VAT ID address field and then I saw those errors in the logs:

VAT number [xxxx] could not get validated due to a validation web service outage (Server error: `POST http://ec.europa.eu/taxation_customs/vies/services/checkVatService` resulted in a `500 Internal Server Error` response: Error 500--Internal Server Error

Maybe the module can be updated as described here:
https://stackoverflow.com/questions/73443655/why-does-this-vat-number-validation-script-return-an-error

Cheers!

Link to comment
Share on other sites

  • 0

I have been doing tests of this EU VIES server using SoapClient.
This server is one big tragedy.
For some countries it sometimes returns a response and sometimes returns an error.
For some countries response times of more than 10 seconds.
It is better to disable this validation service in module, because it is not suitable for stores.

Link to comment
Share on other sites

  • 0

Indeed vies server is very unreliable. It often reply with transient error responses (like too many requests, try later), and sometimes with hard errors when their server just crashes. Current tb module handles these situation silently, with only a log entry inside Logs messages. Which can very easily lead to wrong taxes being applied and collected.

What we want to do is extend current module, and implement retry mechanism. Basically, when we fail to validate VAT number during checkout (caused by server issue), we would move the order into some special order status (like Pending VAT number validation), and try later. Module would try to validate missing VAT numbers on regular basis, and switch order to either 'VAT Validation Failed' status, or to normal status like 'Payment Accepted' or 'Awaiting Bank Wire Transfer'. Employee would have to manually handle the 'VAT Validation Failed' situation -- adjust order, and optionally request payment for missing VAT amount.

That's the plan. Now we need the time 🙂

Link to comment
Share on other sites

  • 0
2 hours ago, RabbitZzZ said:

Is there another suitable solution for the European VAT regulation? Maybe even with manual validation?

All stores have automatic validation disabled and for new customers they do manual validation:
https://ec.europa.eu/taxation_customs/vies/#/vat-validation
Manual validation is also Russian roulette 🙂 Sometimes you have to click several times before you get validation. Especially for Germany it is tragic.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...