Skip to content

Commit 0c88d05

Browse files
committed
[FIX] account_payment_term_extension: Display correct amounts in journal items when using foreign currency
1 parent 310d409 commit 0c88d05

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

account_payment_term_extension/models/account_payment_term.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def _compute_terms(
234234
# FIXME: Find an inheritable way of doing this
235235
self.ensure_one()
236236
company_currency = company.currency_id
237+
foreign_currency = company_currency != currency
237238
tax_amount_left = tax_amount
238239
tax_amount_currency_left = tax_amount_currency
239240
untaxed_amount_left = untaxed_amount
@@ -243,6 +244,8 @@ def _compute_terms(
243244
total_amount_currency = remaining_amount_currency = (
244245
tax_amount_currency + untaxed_amount_currency
245246
)
247+
if foreign_currency:
248+
total_amount, total_amount_currency = total_amount_currency, total_amount
246249
result = []
247250
precision_digits = currency.decimal_places
248251
company_precision_digits = company_currency.decimal_places

0 commit comments

Comments
 (0)