fix: invalid gain/loss JE created on base currency Expense Claim
(cherry picked from commit 75d95acb23)
This commit is contained in:
@@ -809,6 +809,11 @@ class PaymentEntry(AccountsController):
|
|||||||
flt(d.allocated_amount) * flt(exchange_rate), self.precision("base_paid_amount")
|
flt(d.allocated_amount) * flt(exchange_rate), self.precision("base_paid_amount")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# on rare case, when `exchange_rate` is unset, gain/loss amount is incorrectly calculated
|
||||||
|
# for base currency transactions
|
||||||
|
if d.exchange_rate is None:
|
||||||
|
d.exchange_rate = 1
|
||||||
|
|
||||||
allocated_amount_in_pe_exchange_rate = flt(
|
allocated_amount_in_pe_exchange_rate = flt(
|
||||||
flt(d.allocated_amount) * flt(d.exchange_rate), self.precision("base_paid_amount")
|
flt(d.allocated_amount) * flt(d.exchange_rate), self.precision("base_paid_amount")
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user