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

Support both corporate and individual Israeli TINs for generic validation #436

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

odony
Copy link

@odony odony commented May 17, 2024

According to the official references mentioned in #107, Israeli companies can use two types of Tax Identification Numbers / VAT codes:

  • Corporate Registration Numbers for corporations, as currently implemented by stdnum.il.hp
  • ID Card numbers for sole proprietorship businesses (individuals), as currently implemented by stdnum.il.idnr

For example, the TIN rules that were provided to OECD by the Israeli tax administration state:

The "TIN" for an Individual is his ID number.

Based on these references, it seems that the validation of a generic VAT number for Israel via stdnum.il.vat should allow both formats.

Further, considering that stdnum.il.idnr is a simple luhn validation that will also work for the numbers that stdnum.il.hp currently verifies, this can be done by simply changin the default alias to point to it instead. The only difference between the two algorithms is that the stdnum.il.hp one verifies that the first digit is 5.

…tion

According to the official references mentioned in arthurdejong#107, Israeli
companies can use two types of Tax Identification Numbers / VAT codes:
- Corporate Registration Numbers for corporations, as currently
  implemented by `stdnum.il.hp`
- ID Card numbers for sole proprietorship businesses (individuals),
  as currently implemented by `stdnum.il.idnr`

For example, the [TIN rules that were provided to OECD
by the Israeli tax administration](https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Israel-TIN.pdf)
state:
> The "TIN" for an Individual is his ID number.

Based on these references, it seems that the validation of a generic VAT
number for Israel via `stdnum.il.vat` should allow both formats.

Further, considering that `stdnum.il.idnr` is a simple luhn validation
that will also work for the numbers that `stdnum.il.hp` currently
verifies, this can be done by simply changin the default alias to point
to it instead. The only difference between the two algorithms is that
the `stdnum.il.hp` one verifies that the first digit is 5.
@odony
Copy link
Author

odony commented May 17, 2024

@arthurdejong it make look like a stretch to use the idnr algorithm to validate the hp ones too, in case they later diverge. Perhaps you'd prefer having an actual stdnum.il.vat that explicitly tries both hp and idnum in sequence?

PS: the test_legacy (3.5) failure seems caused by the this issue in the setup-python GH action

@odony
Copy link
Author

odony commented May 17, 2024

I've worked around the test failure with the workaround suggested here.
It's a separate, unrelated commit that could be dropped as soon as the upstream issue is fixed.

@arthurdejong
Copy link
Owner

Hi, sorry it took a bit to respond. It is probably better to have one module that validates the VAT number (or TIN) separately. If both ID number and company number are valid TIN, is there a name for the TIN? For example, if either number is filled in in a form, what is it referred to?

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

Successfully merging this pull request may close these issues.

2 participants