-
Notifications
You must be signed in to change notification settings - Fork 214
Add malaysian itn number #237
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
base: master
Are you sure you want to change the base?
Conversation
"""Check if the number is a valid NRIC number. This checks the length, | ||
formatting and birth date and place.""" | ||
number = compact(number) | ||
if len(number) > 13 or len(number) <= 10: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also accepts numbers of length 13. Probably use:
if len(number) < 11 or len(number) > 12:
or
if len(number) not in (11, 12):
number = compact(number) | ||
index = 10 | ||
if len(number) > 12: | ||
index += 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed if numbers of length greater than 12 are not allowed?
Hi @pokoli, Thanks for looking into this. The OECD document is pretty unclear but regarding the length it talks about maximum lengths so the actual numbers may be shorter (e.g. "SG 587682020"). The maximum total length appears to be 13 (e.g. "SG 10234567090" is valid). It may be better to not split on length but split on non-digit and digit parts and check the parts. These appear to also be links with useful information:
It would be really nice if we could find a list of number types somewhere (the document has a table with categories that mention SG, OG, C, CS, D, E, F, FA, PT, TA, TC, TN, TR, TP, TJ annd LE but in other places TF is also mentioned). |
I've got some feedback from our users that recieved a number This is strange |
It cloud be that "552815-W" is a registration number (perhaps with something like a chamber of commerce) and not a tax number. It would really be helpful to have good documentation on Malaysian numbers or someone with local knowledge. |
I don't see any tests. |
Note that TF prefix is not implemented because that might be a typo, since it doesn't appear on the lists. Fixes arthurdejong#113 Closes arthurdejong#237
Note that TF prefix is not implemented because that might be a typo, since it doesn't appear on the lists. Fixes arthurdejong#113 Closes arthurdejong#237
This PR implements what is described on #113
I did not found so much information of the number so it is based on:
http://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Malaysia-TIN.pdf
I will complete the tests with all of the numbers of this source document plus a real number example which I am waiting to receive from some of our users.