From f8aa6cab78f3171b3e5f2271cf6af7c663b4b293 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 18 Aug 2025 17:57:10 +0530 Subject: [PATCH] fix: update ordering in deals by territory and salesperson queries --- crm/api/dashboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crm/api/dashboard.py b/crm/api/dashboard.py index 4bed4218..0b51b6a2 100644 --- a/crm/api/dashboard.py +++ b/crm/api/dashboard.py @@ -1008,7 +1008,7 @@ def get_deals_by_territory(from_date="", to_date="", user=""): WHERE DATE(d.creation) BETWEEN %(from)s AND %(to)s {deal_conds} GROUP BY d.territory - ORDER BY value DESC + ORDER BY deals DESC, value DESC """, {"from": from_date, "to": to_date}, as_dict=True, @@ -1065,7 +1065,7 @@ def get_deals_by_salesperson(from_date="", to_date="", user=""): WHERE DATE(d.creation) BETWEEN %(from)s AND %(to)s {deal_conds} GROUP BY d.deal_owner - ORDER BY value DESC + ORDER BY deals DESC, value DESC """, {"from": from_date, "to": to_date}, as_dict=True,