Update trial_balance.py
Assuming that Account_number has NUMBERs will sort.
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py
index f484111..7142c69 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.py
+++ b/erpnext/accounts/report/trial_balance/trial_balance.py
@@ -51,7 +51,7 @@
filters.to_date = filters.year_end_date
def get_data(filters):
- accounts = frappe.db.sql("""select name, parent_account, account_name, root_type, report_type, lft, rgt
+ accounts = frappe.db.sql("""select name, parent_account, account_name, account_number, root_type, report_type, lft, rgt
from `tabAccount` where company=%s order by account_name, lft""", filters.company, as_dict=True)
company_currency = erpnext.get_company_currency(filters.company)
@@ -176,7 +176,7 @@
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
data = []
tmpaccnt = sorted(accounts)
- if accounts[0].account_name[0].isnumeric():
+ if not (accounts[0].account_number is None):
accounts = tmpaccnt
for d in accounts: