Fix computation of second currency amount

issue3664
review3351002
(transplanted from b81862858d215919a2c3355d4075c656e5ed516b)
This commit is contained in:
Cédric Krier committed 2014-02-10 22:28:29 +01:00
1 parent e718c23156
commit bb9730af7a
1 file changed
+2 -2
+2 -2
View File
@@ -866,10 +866,10 @@ class Invoice(Workflow, ModelSQL, ModelView):
term_lines = [(Date.today(), total)]
for date, amount in term_lines:
val = self._get_move_line(date, amount)
remainder_total_currency -= val['amount_second_currency']
remainder_total_currency += val['amount_second_currency']
move_lines.append(val)
if not self.currency.is_zero(remainder_total_currency):
move_lines[-1]['amount_second_currency'] += \
move_lines[-1]['amount_second_currency'] -= \
remainder_total_currency
accounting_date = self.accounting_date or self.invoice_date