[FIX] Base_vat : VAT validation for Portugal,Bulgaria
lp bug: https://launchpad.net/bugs/356922 fixed bzr revid: jvo@tinyerp.com-20090623085441-oww9lyzjxsgov0b1
This commit is contained in:
parent
6aa5671b0c
commit
b2b08837b4
|
@ -114,7 +114,7 @@ class res_partner(osv.osv):
|
|||
'''
|
||||
Check Bulgaria VAT number.
|
||||
'''
|
||||
if len(vat) != 10:
|
||||
if len(vat) not in [9,10]:
|
||||
return False
|
||||
try:
|
||||
int(vat)
|
||||
|
@ -129,10 +129,10 @@ class res_partner(osv.osv):
|
|||
check = 11 - (sum % 11)
|
||||
if check == 11:
|
||||
check = 0
|
||||
if check == 10:
|
||||
return False
|
||||
if check != int(vat[9]):
|
||||
return False
|
||||
# if check == 10:
|
||||
# return False
|
||||
# if check != int(vat[9]):
|
||||
# return False
|
||||
return True
|
||||
|
||||
def check_vat_cy(self, vat):
|
||||
|
@ -890,10 +890,10 @@ class res_partner(osv.osv):
|
|||
6 * int(vat[3]) + 5 * int(vat[4]) + 4 * int(vat[5]) + \
|
||||
3 * int(vat[6]) + 2 * int(vat[7])
|
||||
check = 11 - (sum % 11)
|
||||
if check == 10:
|
||||
if check == 10 or check == 11:
|
||||
check = 0
|
||||
if check != int(vat[8]):
|
||||
return False
|
||||
# if check != int(vat[8]):
|
||||
# return False
|
||||
return True
|
||||
|
||||
def check_vat_ro(self, vat):
|
||||
|
|
Loading…
Reference in New Issue