[FIX] Account : When Payment is done by bank statement with a different currency, amount should be converted to company currency
bzr revid: jvo@tinyerp.com-20100706151022-3b3gvzht4ihpceh2
This commit is contained in:
parent
8985969fba
commit
91bf62ce7c
|
@ -58,14 +58,19 @@ class account_statement_from_invoice_lines(osv.osv_memory):
|
|||
# else:
|
||||
ctx['date'] = line_date
|
||||
amount = 0.0
|
||||
|
||||
if line.debit > 0:
|
||||
amount = line.debit
|
||||
elif line.credit > 0:
|
||||
amount = -line.credit
|
||||
|
||||
if line.amount_currency:
|
||||
amount = currency_obj.compute(cr, uid, line.currency_id.id,
|
||||
amount = currency_obj.compute(cursor, user, line.currency_id.id,
|
||||
statement.currency.id, line.amount_currency, context=ctx)
|
||||
else:
|
||||
if line.debit > 0:
|
||||
amount=line.debit
|
||||
elif line.credit > 0:
|
||||
amount=-line.credit
|
||||
elif (line.invoice and line.invoice.currency_id.id <> statement.currency.id):
|
||||
amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id,
|
||||
statement.currency.id, amount, context=ctx)
|
||||
|
||||
reconcile_id = statement_reconcile_obj.create(cr, uid, {
|
||||
'line_ids': [(6, 0, [line.id])]
|
||||
}, context=context)
|
||||
|
|
Loading…
Reference in New Issue