Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pokoli
Copy link

@pokoli pokoli commented Sep 10, 2020

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.

"""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:
Copy link
Owner

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
Copy link
Owner

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?

@arthurdejong
Copy link
Owner

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).

@pokoli
Copy link
Author

pokoli commented Sep 18, 2020

I've got some feedback from our users that recieved a number 552815-W of company in Malaysia but the number does not match any of the specified numbers. I've checked on the net and the company exists.

This is strange

@arthurdejong
Copy link
Owner

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.

@unho
Copy link
Contributor

unho commented Oct 24, 2020

I don't see any tests.

unho added a commit to unho/python-stdnum that referenced this pull request Jan 14, 2023
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
unho added a commit to unho/python-stdnum that referenced this pull request Jan 14, 2023
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
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.

3 participants