Commit 9da864a6 authored by Kevin Deldycke's avatar Kevin Deldycke

Bug in Bank Account Numbers generation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3308 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3576f9ee
......@@ -38,9 +38,12 @@ import string
class BankAccount(Folder, Coordinate):
"""
A bank account number holds a collection of numbers and codes (ex. SWIFT, RIB, etc.) which may be used to identify a bank account.
A bank account number holds a collection of numbers and codes
(ex. SWIFT, RIB, etc.) which may be used to identify a bank account.
A Bank Account is owned by a Person or an Organisation. A Bank Account contain Agents with Agent Privileges used by the owner to delegate the management of the bank account to trusted third-party Persons.
A Bank Account is owned by a Person or an Organisation. A Bank Account
contain Agents with Agent Privileges used by the owner to delegate the
management of the bank account to trusted third-party Persons.
BankAccount inherits from Base and from the mix-in Coordinate.
"""
......@@ -130,7 +133,7 @@ class BankAccount(Folder, Coordinate):
key = self.getBbanKey()
if bank == None: bank = ''
if branch == None: branch = ''
if ban == None: account_id = ''
if ban == None: ban = ''
if key == None: key = ''
return (bank + branch + ban + key).upper()
......@@ -146,7 +149,7 @@ class BankAccount(Folder, Coordinate):
key = self.getBbanKey()
if bank == None: bank = ''
if branch == None: branch = ''
if ban == None: account_id = ''
if ban == None: ban = ''
if key == None: key = ''
return sep.join([bank, branch, ban, key]).upper()
......@@ -170,6 +173,8 @@ class BankAccount(Folder, Coordinate):
if bank == None: bank = ''
if branch == None: branch = ''
if ban == None: ban = ''
if len(bank + branch + ban) == 0:
return ''
bank += ('0' * (5 - len(bank)))
branch += ('0' * (5 - len(branch)))
......
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