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'):