Commit 45095c29 authored by Kevin Deldycke's avatar Kevin Deldycke

control keys must be return with 2 digits


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3125 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 271f8ebe
...@@ -114,7 +114,8 @@ class BankAccount(Folder, Coordinate): ...@@ -114,7 +114,8 @@ class BankAccount(Folder, Coordinate):
n += table[c.upper()] n += table[c.upper()]
if c.isdigit(): if c.isdigit():
n += c n += c
return str(98 - (int(n) % 97)) key = str(98 - (int(n) % 97))
return key.zfill(2)
security.declareProtected(Permissions.View, 'getBban') security.declareProtected(Permissions.View, 'getBban')
...@@ -173,6 +174,7 @@ class BankAccount(Folder, Coordinate): ...@@ -173,6 +174,7 @@ class BankAccount(Folder, Coordinate):
bank += ('0' * (5 - len(bank))) bank += ('0' * (5 - len(bank)))
branch += ('0' * (5 - len(branch))) branch += ('0' * (5 - len(branch)))
s = (bank + branch + ban).upper() s = (bank + branch + ban).upper()
key = str(97 - ((transcode(s) * 100) % 97))
return key.zfill(2)
return str(97 - ((transcode(s) * 100) % 97))
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment