koblas / stdnum-js

A JavaScript library to provide functions to handle, parse and validate standard numbers.
MIT License
39 stars 26 forks source link

Question about FR TVA/VAT letters checksum. #60

Closed teebu closed 1 year ago

teebu commented 1 year ago

I'm having a hard time finding documentation on how chars get converted to digits and vise-versa. I know SIREN is used to create check digit, but its always digits, it must go through some conversion process to make it a letter.

https://en.wikipedia.org/wiki/VAT_identification_number

Format is for is FRXX 999999999 - the XX can be digits or letters.

koblas commented 1 year ago

I just spent way too much time trying to get an authoritative source. I did find that there are lots of websites / libraries doing this wrong. The only "source" that I could find that documents the rules is:

https://wiki.scn.sap.com/wiki/display/CRM/France

But, their citation for a source isn't a valid link -- the wayback machine also doesn't really have a useful page (ok, just a validator page).

That said, I'm starting to wonder if the the checkdigits indicate company head-office, since VATs must be collected I wonder if the alpha codes are assigned to foreign companies.

teebu commented 1 year ago

Thanks