fix: invalid exchange loss booking on invoice againts base accounts

(cherry picked from commit 3d5dba6976)
This commit is contained in:
ruthra kumar
2024-03-18 15:34:21 +05:30
committed by Mergify
parent c4c0510a1b
commit a27f386665

View File

@@ -350,7 +350,9 @@ class PaymentEntry(AccountsController):
ref_details = get_reference_details(
d.reference_doctype, d.reference_name, self.party_account_currency
)
if ref_exchange_rate:
# Only update exchange rate when the reference is Journal Entry
if ref_exchange_rate and d.reference_doctype == "Journal Entry":
ref_details.update({"exchange_rate": ref_exchange_rate})
for field, value in ref_details.items():