From fd7c3e30ced1e15d528071bc5b38123da58281f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 14 Jul 2009 16:47:53 +0200 Subject: [PATCH] Use absolute value of amount second currency to compute the amounts to pay for issue1107 --- invoice.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/invoice.py b/invoice.py index c1dc25ab68..06f97c392a 100644 --- a/invoice.py +++ b/invoice.py @@ -485,9 +485,9 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): continue if line.second_currency.id == invoice.currency.id: if line.debit - line.credit > Decimal('0.0'): - amount_currency += line.amount_second_currency + amount_currency += abs(line.amount_second_currency) else: - amount_currency -= line.amount_second_currency + amount_currency -= abs(line.amount_second_currency) else: amount += line.debit - line.credit for line in invoice.payment_lines: @@ -495,9 +495,9 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): continue if line.second_currency.id == invoice.currency.id: if line.debit - line.credit > Decimal('0.0'): - amount_currency += line.amount_second_currency + amount_currency += abs(line.amount_second_currency) else: - amount_currency -= line.amount_second_currency + amount_currency -= abs(line.amount_second_currency) else: amount += line.debit - line.credit if invoice.type in ('in_invoice', 'out_credit_note'):