From d5a8cfb0a374a3b1090ebd0825708d2db49048ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 10 Feb 2014 22:28:29 +0100 Subject: [PATCH] Fix computation of second currency amount issue3664 review3351002 (transplanted from b81862858d215919a2c3355d4075c656e5ed516b) --- invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invoice.py b/invoice.py index 7216a58de7..15f651ec50 100644 --- a/invoice.py +++ b/invoice.py @@ -862,11 +862,11 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): remainder_total_currency = total_currency for date, amount in term_lines: val = self._get_move_line(invoice, date, amount) - remainder_total_currency -= val['amount_second_currency'] + remainder_total_currency += val['amount_second_currency'] move_lines.append(val) if not currency_obj.is_zero(invoice.currency, remainder_total_currency): - move_lines[-1]['amount_second_currency'] += remainder_total_currency + move_lines[-1]['amount_second_currency'] -= remainder_total_currency accounting_date = invoice.accounting_date or invoice.invoice_date period_id = period_obj.find(invoice.company.id, date=accounting_date)