VAT format validation

com2 - January 26, 2009 - 19:28
Project:Ubercart VAT Number
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:critical
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

I use a format that correctly validates on the EU website but the module stubbornly responds with:

"Your VAT Number syntax is not correct. You should have something like that : FR0123456789"

Will it only validate French numbers correctly?

#1

com2 - January 28, 2009 - 12:19

I submit a patch to relax the validation and allow apart from the country code other letters. Now Spanish VAT numbers will validate correctly.

AttachmentSize
uc_vat_number.validation.patch 728 bytes

#2

com2 - January 28, 2009 - 12:19
Status:active» needs review

#3

zmove - February 5, 2009 - 16:38
Status:needs review» postponed (maintainer needs more info)

Hi,

I'm not sure to understand this issue, normally a VAT number is composed like that:

2 letter country code + List of numbers. The spanish VAT number should be like that too...

The last condition you removed in your patch check if the "code" after the country code is only composed by letters, so, until somebody didn't prove me that there are some VAT number that can have letters in their "code" I suggest to not remove this condition.

#4

upupax - February 9, 2009 - 23:27

I'm not sure that the prefix is mandatory for national invoice in every country.
Neither in italy this is mandatory, but I suppose that the VAT validation process require it.
Understanding that people normally don't use the country prefix I've written a little patch that automatically fill the vat field with the right iso code just selecting the billing country.
This is my really first patch so, if there is something wrong, please be patient.
Maybe the better choice would be to create two fields as in the Vies VAT number validation, one automatically filled with country iso and the other just for digits.

AttachmentSize
uc_vat_number_country_iso.patch 993 bytes

#5

VinceW - February 12, 2009 - 23:36
Title:VAT format validation error» VAT format validation
Category:bug report» feature request
Priority:normal» critical

LS,

IMHO the whole validation of the VAT-number is a critical aspect of this module. It should be 'very good' or outstanding, because store owners and customers must be able to rely on it. I checked out the module and I think there is some room for improvement of it. For instance:

  • The validation should not only assume the hard coded countries, but also take in aspect the place of the supplier of the goods. Because a supplier in the same country as the buyer has to charge vat on his sales.
  • IMHO it is better to retrieve the country data from a build in table. (perhaps such a table should be part of the Drupal core, because a lot of modules are using that data, such as ubercart, etc). But that's an other discussion
  • The country code and the vat-number should be separated fields in the form. Or the retrieval of the country code should be done in an other way. It is possible to generate the alpha-2 country code based on the address of the buyer (held against the country database). In that way the buyer only has to submit the rest of his vat-number
  • The format of a vat-number can hold more than only numbers (see: http://ec.europa.eu/taxation_customs/vies/faqvies.do#item11 for more information, specialy the remark at the bottom of this table). So verification of the user input should deal with this.
  • fault handling can be better implemented. What if the SOAP service is not available or the member state database is down for some reason?

I don't only want to be a positive, critical spectator on this, but willing to actively work on this matter. So let me know when hands are needed.

Best,
VinceW

-=[ Your Information Matters ]=-

#6

com2 - March 13, 2009 - 18:32

For many (unlimited) businesses the Spanish VAT registration number is the same as the TAX registration number of the shop owner. Furthermore legally correct invoices (of suppliers and private persons alike) need to have both the tax number of the client and the store, if they hava a VAT registration or not. This means that for all Spanish clients of a Spanish shop the TAX registration number is obligatory, Is there a way to patch this module to cater for this situation (exception)?

 
 

Drupal is a registered trademark of Dries Buytaert.