Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BE: add support for Belgian VAT numbers starting with 1 #129

Open
glecam opened this issue Jun 14, 2022 · 3 comments
Open

BE: add support for Belgian VAT numbers starting with 1 #129

glecam opened this issue Jun 14, 2022 · 3 comments

Comments

@glecam
Copy link

glecam commented Jun 14, 2022

Issue

  • Belgian VAT numbers are composed of the prefix 'BE' followed by the company number of the company. For example: BE0606838532
  • VAT numbers starting with digit 1 do not pass validation, while the official documentation states it can start with either 0 or 1. For example: BE1001686633
  • In the near future the Crossroads Bank for Enterprises in Belgium will start registering companies with a company number starting with digit 1. By 01/01/2023 it is strongly recommended to allow VAT numbers to allow such format.
  • Official communication about this change can be found here.

Suggested fixes in Belgium.ts

  • The regex in the Belgian VAT validator can be changed from ^(BE)(0?\d{9})$ to ^(BE)([0-1]?\d{9})$
  • The following line of code should (imo) be completely removed because the sample VAT number that we received does have 0 as second digit. Otherwise BE1001686633 would be marked as not valid.
    if (Number(newVat.slice(1, 2)) === 0) return false;
  • A Belgian company number consists of 10 digits. There is a line of code that adds a 0 to the start of the entered VAT if the entered VAT is only 9 characters. But since the start of the company number can be either 0 or 1, this line is not correct. I'm not sure what the best fix is, since this is kind of a breaking change.
    this const newVat = vat.length === 9 ? '0' + vat : vat;
@qubis741
Copy link

+1

1 similar comment
@zedissime
Copy link

+1

@ArneAmeye
Copy link

For anyone looking into this issue, someone has forked this abandoned project and added support for the new BE VAT numbers:
jsvat-next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants