valvat icon indicating copy to clipboard operation
valvat copied to clipboard

Es VAT checksum validation with all AEAT rules

Open KirtashW17 opened this issue 2 years ago • 0 comments

Applies more rules to SPAIN VAT Number validation:

  • CIF: If first digit is in [ABCDEFG], check-digit can be both a letter or a number.
  • CIF: If first digit is in [HJUV], check-digit MUST be a number.
  • CIF: If first digit is in [NPQRSW], check-digit MUST be a letter.
  • Adds rules for special NIF's [KLM]: First two digits must be between 01 and 56 (inclusive).

Based on official AEAT VAT validation Library written in Java:

  • https://ws024.juntadeandalucia.es/maven/repository/internal/com/aeat/valida/valnif/2.0.1/
  • http://www.migoia.com/website/articulos/NIF.html

I also did some JJUnit tests to confirm this behaviours of the official library:

KirtashW17 avatar Sep 18 '22 13:09 KirtashW17