django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
826 stars 290 forks source link

local-flavor SI: SITaxNumberField should not raise exception when control code is 11 #206

Closed ladolf closed 8 years ago

ladolf commented 8 years ago

local-flavor 1.2 for Slovenia (SI) has a bug in file localflavor/si/forms.py on line 111: if chk == 10: which should be replaced with if chk == 10 or chk == 11:

Tax number check in Slovenia

benkonrath commented 8 years ago

Could you create a PR (with a test) for this? Thanks.

ladolf commented 8 years ago

Here is the test: https://github.com/ladolf/localflavor-si-tax-test

Quick example would also be: from localflavor.si.forms import SITaxNumberField SITaxNumberField().clean('25215930') # random tax number with check code==11

benkonrath commented 8 years ago

Would it be possible for you to make your changes directly django-localflavor and then create a pull request so that we can review it? I can guide you through the process if you're not sure how to start.

ladolf commented 8 years ago

I've never created pull request. I will read some documentation (for example https://www.atlassian.com/git/tutorials/making-a-pull-request) and try to do it. Do you recommend some other documentation?

benkonrath commented 8 years ago

I found this guide that explains how to make a pull request with github as a reference instead of bitbucket.

http://stackoverflow.com/a/14681796

There's a lot of information there so please ask if you're not sure about something. I'm looking forward to seeing your pull request!

benkonrath commented 8 years ago

This guide looks good as well: https://www.thinkful.com/learn/github-pull-request-tutorial/

ladolf commented 8 years ago

I created PR (maybe description "Closes #206" should be more informative): https://github.com/django/django-localflavor/pull/221

I also updated authors, changelog and tests.

benkonrath commented 8 years ago

@ladolf Thanks! Great to see you were able to work out how to make a pull request.

Normally you would put something informative in the summary of the commit message (the first line is the summary) and then you can put more information in the subsequent paragraphs as required. You could put "Closes #206" in one of the subsequent paragraphs.

I found this guide that might be useful if you're interested but we're not as strict on this project as the author recommends: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

benkonrath commented 8 years ago

@ladolf As far as I can see, a control code of 11 means that the SI tax identification number is invalid. Here are the two references I found about this:

http://zylla.wipos.p.lodz.pl/ut/translation.html#PZSI https://github.com/arthurdejong/python-stdnum/blob/352aa8aef4b60456fba02a52460e9b8c6462b2fb/stdnum/si/ddv.py#L48

I'm closing this issue for now. Feel free to re-open this issue if you find an SI tax number with a control code of 11 that we can lookup in the VIES database. This will allow us to confirm that such an SI tax number is active which means it's valid. Here are two websites that allow you to lookup VAT numbers in the VIES database:

http://ec.europa.eu/taxation_customs/vies/ https://vatlayer.com/