Skip to content
Snippets Groups Projects
Commit bc05fe26 authored by Quentin De Paoli's avatar Quentin De Paoli
Browse files

[FIX] account: fixed the proposal of reconciliation in the bank statement for negative amounts

parent 59b47119
No related branches found
No related tags found
No related merge requests found
...@@ -409,6 +409,10 @@ class account_bank_statement(osv.osv): ...@@ -409,6 +409,10 @@ class account_bank_statement(osv.osv):
'domain':[('statement_id','in',ids)], 'domain':[('statement_id','in',ids)],
'context':ctx, 'context':ctx,
} }
def number_of_lines_reconciled(self, cr, uid, id, context=None):
bsl_obj = self.pool.get('account.bank.statement.line')
return bsl_obj.search_count(cr, uid, [('statement_id', '=', id), ('journal_entry_id', '!=', False)], context=context)
def get_format_currency_js_function(self, cr, uid, id, context=None): def get_format_currency_js_function(self, cr, uid, id, context=None):
""" Returns a string that can be used to instanciate a javascript function. """ Returns a string that can be used to instanciate a javascript function.
...@@ -432,10 +436,6 @@ class account_bank_statement(osv.osv): ...@@ -432,10 +436,6 @@ class account_bank_statement(osv.osv):
done_currencies.append(st_line_currency.id) done_currencies.append(st_line_currency.id)
return function return function
def number_of_lines_reconciled(self, cr, uid, id, context=None):
bsl_obj = self.pool.get('account.bank.statement.line')
return bsl_obj.search_count(cr, uid, [('statement_id', '=', id), ('journal_entry_id', '!=', False)], context=context)
def link_bank_to_partner(self, cr, uid, ids, context=None): def link_bank_to_partner(self, cr, uid, ids, context=None):
for statement in self.browse(cr, uid, ids, context=context): for statement in self.browse(cr, uid, ids, context=context):
for st_line in statement.line_ids: for st_line in statement.line_ids:
...@@ -554,7 +554,7 @@ class account_bank_statement_line(osv.osv): ...@@ -554,7 +554,7 @@ class account_bank_statement_line(osv.osv):
if total + line[amount_field] <= abs(st_line.amount): if total + line[amount_field] <= abs(st_line.amount):
ret.append(line) ret.append(line)
total += line[amount_field] total += line[amount_field]
if total >= st_line.amount: if total >= abs(st_line.amount):
break break
return ret return ret
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment