From d56627f2b715888fab93f00ebfe4f1dbff0d2f1e Mon Sep 17 00:00:00 2001 From: robert schouten Date: Fri, 13 Jan 2017 11:53:43 +0800 Subject: [PATCH 1/2] [fix] profiability analasyis orderby project name --- .../report/profitability_analysis/profitability_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index 4f9fd15f66..c920c7c4bf 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -23,7 +23,7 @@ def get_accounts_data(based_on, company): return frappe.db.sql("""select name, parent_cost_center as parent_account, cost_center_name as account_name, lft, rgt from `tabCost Center` where company=%s order by lft""", company, as_dict=True) else: - return frappe.get_all('Project', fields = ["name"], filters = {'company': company}) + return frappe.get_all('Project', fields = ["name"], filters = {'company': company}, order_by = 'name') def get_data(accounts, filters, based_on): if not accounts: From 1a92d54dcbfffe0b3cbb9502a22aa334fb83a46f Mon Sep 17 00:00:00 2001 From: robert schouten Date: Fri, 13 Jan 2017 14:52:11 +0800 Subject: [PATCH 2/2] [fix] profiability analasyis orderby cost center name --- .../report/profitability_analysis/profitability_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py index c920c7c4bf..09ba40ca75 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.py +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.py @@ -21,7 +21,7 @@ def execute(filters=None): def get_accounts_data(based_on, company): if based_on == 'cost_center': return frappe.db.sql("""select name, parent_cost_center as parent_account, cost_center_name as account_name, lft, rgt - from `tabCost Center` where company=%s order by lft""", company, as_dict=True) + from `tabCost Center` where company=%s order by name""", company, as_dict=True) else: return frappe.get_all('Project', fields = ["name"], filters = {'company': company}, order_by = 'name')