borni-dhifi / vatnumber

Automatically exported from code.google.com/p/vatnumber
GNU General Public License v3.0
0 stars 0 forks source link

Built-in vat check for SK (Slovakia) is not valid. In V1.0, and V1.1 #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
>>> import vatnumber
>>> vatnumber.check_vat('SK4020185763')
False
>>> vatnumber.check_vies('SK4020185763')
True

According to Wikipedia, the verification process is:
"'SK'+10 digits (number must be divisible by 11)"

Original issue reported on code.google.com by zyphos....@gmail.com on 3 Apr 2014 at 6:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
A quick solution is:
def check_vat_sk(vat):
    '''
    Check Slovakia VAT number.
    '''
    try:
        int(vat)
    except ValueError:
        return False
    if len(vat) not in(9, 10):
        return False
    return int(vat) % 11 == 0

Original comment by zyphos....@gmail.com on 3 Apr 2014 at 6:59

GoogleCodeExporter commented 8 years ago
Forget it, I just noticed that it has been fixed, but you didn't release a new 
packaging with this. like V1.2

Original comment by zyphos....@gmail.com on 3 Apr 2014 at 7:18

GoogleCodeExporter commented 8 years ago

Original comment by cedric.krier@b2ck.com on 3 Apr 2014 at 7:37

GoogleCodeExporter commented 8 years ago

Original comment by cedric.krier@b2ck.com on 3 Apr 2014 at 7:38