koblas / stdnum-js

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

GB VAT number - checksum validation bug #37

Closed olehAndersen closed 1 year ago

olehAndersen commented 1 year ago

Hi! Thanks for your hard work! That some VAT numbers of the GB, exactly those that start with 34, do not pass the checksum validation. These are valid numbers and they will also validate the stdnum python library.

A couple of examples:

  1. GB340804329 - http://www.vat-lookup.co.uk/verify/vat_check.php/VATNumber/GB340804329
  2. GB346270013 - http://www.vat-lookup.co.uk/verify/vat_check.php/VATNumber/GB346270013

Error message message: "The number number's checksum or check digit is invalid."

These companies are united by the Incorporation year, 2019, and there may have been changes in the formula for the BAT number.

I believe that you can fix it, Thank you!

koblas commented 1 year ago

Thanks for the report, will look at this shortly.

koblas commented 1 year ago

The fix should be available version 1.4.11 please let me know if you have any other problems.

olehAndersen commented 1 year ago

Thanks for the quick fix 🙇🏼