Use absolute value of amount second currency to compute the amounts to pay for
issue1107
This commit is contained in:
1 parent
3b0576d9da
commit
fd7c3e30ce
1 file changed
+4
-4
+4
-4
@@ -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'):
|
||||
|
||||
Reference in new issue
Block a user