[fix] profiability analasyis orderby cost center name

This commit is contained in:
robert schouten 2017-01-13 14:52:11 +08:00
parent d56627f2b7
commit 1a92d54dcb

View File

@ -21,7 +21,7 @@ def execute(filters=None):
def get_accounts_data(based_on, company): def get_accounts_data(based_on, company):
if based_on == 'cost_center': 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 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: else:
return frappe.get_all('Project', fields = ["name"], filters = {'company': company}, order_by = 'name') return frappe.get_all('Project', fields = ["name"], filters = {'company': company}, order_by = 'name')