ralphje / django-internationalflavor

Complementing django-localflavor with fields that are applicable to multiple countries
Other
25 stars 19 forks source link

Correct VAT ID is recognized as invalid #15

Closed emesik closed 4 years ago

emesik commented 4 years ago

It seems that VAT ID NL001266526B03 is not recognized properly. VIES reports it as valid, while the module reacts:

~/.local/lib/python3.8/site-packages/internationalflavor/vat_number/validators.py in _country_specific_check(self, country, rest)
    129         if country == 'NL':  # validate against modified elfproef
    130             if _get_check_digit(rest, [9, 8, 7, 6, 5, 4, 3, 2, -1]) != 0:
--> 131                 raise ValidationError(self.country_failure % {'country': country})
    132 
    133         elif country == 'BE':  # validate with Modulus97 test

ValidationError: ['This VAT number does not match the requirements for NL.']
emesik commented 4 years ago

Well, it seems Netherlands have introduced new VAT IDs: https://www.bdo.global/en-gb/microsites/tax-newsletters/indirect-tax-news/issue-4-2019/netherlands-new-vat-identification-numbers-for-some

However, I can't find any information on the checksum algorithm, at least in English.

emesik commented 4 years ago

Thanks!