Trial Balance sort by Account Name

Trial Balance order by Account Name
Used Sorted under Prepare_data Function.
This commit is contained in:
Helkyd 2018-01-29 13:47:12 +00:00 committed by GitHub
parent 58c040cffb
commit d6a61ad0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ def validate_filters(filters):
def get_data(filters):
accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
from `tabAccount` where company=%s order by lft""", filters.company, as_dict=True)
from `tabAccount` where company=%s order by account_name, lft""", filters.company, as_dict=True)
company_currency = erpnext.get_company_currency(filters.company)
if not accounts:
@ -168,6 +168,8 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
data = []
tmpaccnt = sorted(accounts)
accounts = tmpaccnt
for d in accounts:
has_value = False