[FIX] l10n_be_coda: fixed a glitch in the coda import when the starting balance of the statement is negative. Courtesy of Damien Carlier (Idealis Consulting)

bzr revid: qdp-launchpad@openerp.com-20130415092956-fzrd7646i9spssad
This commit is contained in:
Quentin (OpenERP) 2013-04-15 11:29:56 +02:00
parent af5892458b
commit b799a51d39
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,8 @@ class account_coda_import(osv.osv_memory):
raise osv.except_osv(_('Error') + ' R1004', _("No matching Bank Account (with Account Journal) found.\n\nPlease set-up a Bank Account with as Account Number '%s' and as Currency '%s' and an Account Journal.") % (statement['acc_number'], statement['currency']))
statement['description'] = rmspaces(line[90:125])
statement['balance_start'] = float(rmspaces(line[43:58])) / 1000
if line[42] == '1': #1 = Debit, the starting balance is negative
statement['balance_start'] = - statement['balance_start']
statement['balance_start_date'] = time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT, time.strptime(rmspaces(line[58:64]), '%d%m%y'))
statement['accountHolder'] = rmspaces(line[64:90])
statement['paperSeqNumber'] = rmspaces(line[2:5])