From b98cce8b9acebadc569abeb8240bd47ae4ee522d Mon Sep 17 00:00:00 2001 From: i-am-vimal Date: Thu, 19 Jun 2025 18:14:32 +0530 Subject: [PATCH] fix: add validation for exchange gain/loss entries (cherry picked from commit 5c9eddd31e16bf6f8afa5e3800e04c2ea1044c53) # Conflicts: # erpnext/accounts/report/utils.py --- erpnext/accounts/report/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index 5d606f648fa..f78d95f4160 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -107,7 +107,11 @@ def convert_to_presentation_currency(gl_entries, currency_info): credit_in_account_currency = flt(entry["credit_in_account_currency"]) account_currency = entry["account_currency"] - if len(account_currencies) == 1 and account_currency == presentation_currency: + if ( + len(account_currencies) == 1 + and account_currency == presentation_currency + and (debit_in_account_currency or credit_in_account_currency) + ): entry["debit"] = debit_in_account_currency entry["credit"] = credit_in_account_currency else: