Skip to content

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

@glecam

Description

@glecam

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions