Improve payment, invoice, statement

- Use the right reference from invoice on account move lines
- Add a reference type on invoice
- Payment are now multi-currency
- Add wizard to populate statement
- Make thread safe payment wizard
- Add mod10r in utils
- Add colors on statement lines

bzr revid: ced-24b50b0267903bb60e05ed673d6debc7fd755422
This commit is contained in:
ced 2007-10-04 05:59:39 +00:00
parent a2a261265c
commit ddae539d94
1 changed files with 15 additions and 0 deletions

View File

@ -423,4 +423,19 @@ def get_user_companies(cr, user):
compids.extend(_get_company_children(cr, compids))
return compids
def mod10r(number):
"""
Input number : account or invoice number
Output return: the same number completed with the recursive mod10
key
"""
codec=[0,9,4,6,8,2,7,1,3,5]
report = 0
result=""
for digit in number:
result += digit
if digit.isdigit():
report = codec[ (int(digit) + report) % 10 ]
return result + str((10 - report) % 10)
# vim:noexpandtab