mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
fix: Quotation Trends report not working for filter group by customer (#18987)
This commit is contained in:
committed by
Nabin Hait
parent
4111965d2e
commit
dbebec8fcc
@@ -54,6 +54,9 @@ def get_data(filters, conditions):
|
|||||||
if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
|
if conditions.get('trans') in ['Sales Order', 'Purchase Order']:
|
||||||
cond += " and t1.status != 'Closed'"
|
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",
|
year_start_date, year_end_date = frappe.db.get_value("Fiscal Year",
|
||||||
filters.get('fiscal_year'), ["year_start_date", "year_end_date"])
|
filters.get('fiscal_year'), ["year_start_date", "year_end_date"])
|
||||||
|
|
||||||
@@ -64,7 +67,7 @@ def get_data(filters, conditions):
|
|||||||
if filters.get("group_by") == 'Item':
|
if filters.get("group_by") == 'Item':
|
||||||
sel_col = 't2.item_code'
|
sel_col = 't2.item_code'
|
||||||
elif filters.get("group_by") == 'Customer':
|
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':
|
elif filters.get("group_by") == 'Supplier':
|
||||||
sel_col = 't1.supplier'
|
sel_col = 't1.supplier'
|
||||||
|
|
||||||
@@ -225,7 +228,7 @@ def based_wise_columns_query(based_on, trans):
|
|||||||
elif based_on == "Customer":
|
elif based_on == "Customer":
|
||||||
based_on_details["based_on_cols"] = ["Customer:Link/Customer:120", "Territory:Link/Territory:120"]
|
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_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"] = ''
|
based_on_details["addl_tables"] = ''
|
||||||
|
|
||||||
elif based_on == "Customer Group":
|
elif based_on == "Customer Group":
|
||||||
|
|||||||
Reference in New Issue
Block a user