fix: Quotation Trends report not working for filter group by customer (#18989)

diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py
index 0404a1e..da44325 100644
--- a/erpnext/controllers/trends.py
+++ b/erpnext/controllers/trends.py
@@ -54,6 +54,9 @@
 	if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
 		cond += " and t1.status != 'Closed'"
 
+	if conditions.get('trans') == 'Quotation' and filters.get("group_by") == 'Customer':
+		cond += " and t1.quotation_to = 'Customer'"
+
 	year_start_date, year_end_date = frappe.db.get_value("Fiscal Year",
 		filters.get('fiscal_year'), ["year_start_date", "year_end_date"])
 
@@ -64,7 +67,7 @@
 		if filters.get("group_by") == 'Item':
 			sel_col = 't2.item_code'
 		elif filters.get("group_by") == 'Customer':
-			sel_col = 't1.customer'
+			sel_col = 't1.party_name' if conditions.get('trans') == 'Quotation' else 't1.customer'
 		elif filters.get("group_by") == 'Supplier':
 			sel_col = 't1.supplier'
 
@@ -225,7 +228,7 @@
 	elif based_on == "Customer":
 		based_on_details["based_on_cols"] = ["Customer:Link/Customer:120", "Territory:Link/Territory:120"]
 		based_on_details["based_on_select"] = "t1.customer_name, t1.territory, "
-		based_on_details["based_on_group_by"] = 't1.customer'
+		based_on_details["based_on_group_by"] = 't1.party_name' if trans == 'Quotation' else 't1.customer'
 		based_on_details["addl_tables"] = ''
 
 	elif based_on == "Customer Group":