From b0e201a332821c8d277dea4fc12b30c572e6935f Mon Sep 17 00:00:00 2001 From: Karuppasamy923 Date: Tue, 24 Jun 2025 13:27:52 +0530 Subject: [PATCH] fix: Update transaction currency to company currency to show correct currency symbol --- erpnext/controllers/trends.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 57edae7053a..5fe47543023 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -158,7 +158,7 @@ def get_data(filters, conditions): # get data for group_by filter row1 = frappe.db.sql( - """ select t1.currency , {} , {} from `tab{}` t1, `tab{} Item` t2 {} + """ select t4.default_currency AS currency , {} , {} from `tab{}` t1, `tab{} Item` t2 {} where t2.parent = t1.name and t1.company = {} and {} between {} and {} and t1.docstatus = 1 and {} = {} and {} = {} {} {} """.format( @@ -392,8 +392,12 @@ def based_wise_columns_query(based_on, trans): else: frappe.throw(_("Project-wise data is not available for Quotation")) - based_on_details["based_on_select"] += "t1.currency," + based_on_details["based_on_select"] += "t4.default_currency as currency," based_on_details["based_on_cols"].append("Currency:Link/Currency:120") + based_on_details["addl_tables"] += ", `tabCompany` t4" + based_on_details["addl_tables_relational_cond"] = ( + based_on_details.get("addl_tables_relational_cond", "") + " and t1.company = t4.name" + ) return based_on_details