From 169d77da54edf9f12f0c4873a032f1f131b37621 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 1 Jun 2024 19:31:28 +0530 Subject: [PATCH] fix: Transaction currency value in Journal Entry --- .../accounts/doctype/journal_entry/journal_entry.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index e757f13108fe..6a3254197cc9 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -1058,6 +1058,17 @@ def set_total_amount(self, amt, currency): def build_gl_map(self): gl_map = [] + + company_currency = erpnext.get_company_currency(self.company) + if self.multi_currency: + for row in self.get("accounts"): + if row.account_currency != company_currency: + self.currency = row.account_currency + self.conversion_rate = row.exchange_rate + break + else: + self.currency = company_currency + for d in self.get("accounts"): if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"): r = [d.user_remark, self.remark]