se-panfilov / jsvat

Check the validity of the format of an EU VAT number
http://se-panfilov.github.io/jsvat
MIT License
131 stars 34 forks source link

Feat(Netherlands): implement new Mod 97 for new numbers #90

Closed MattivdWeem closed 4 years ago

MattivdWeem commented 4 years ago

What are you trying to accomplish?

(as mentioned in https://github.com/se-panfilov/jsvat/issues/89)

The Netherlands, finally has new btw-identificatienummer for ZZP. The new number doesn't validate with the old %11number.

This change implements the %97 validation which is needed for the new identification number and keeps the old one in working for non ZZP BTW numbers.

Why did you choose this approach?

We need both the old and the new validation, to keep it working with other VAT numbers.

What should reviewers focus on?

Test some more numbers, code style.

Before you merge

is there anything we have to do before merging?

[x] I have tested this change (multiple VAT numbers)
[-] It is safe to roll back this change _It will put it back in broken state_

fixes #89

wilgert commented 4 years ago

One thing I would add: an invalid VAT-number with the new format in the tests. To verify that it indeed marks it as invalid. You can obviously just change one digit from the valid number you added and it will be invalid.

se-panfilov commented 4 years ago

Thank you for you efforts, guys. Will make a release asap