Update trial_balance.py
Assuming that Account_number has NUMBERs will sort.
This commit is contained in:
parent
b258686b00
commit
5e93b02c85
@ -51,7 +51,7 @@ def validate_filters(filters):
|
|||||||
filters.to_date = filters.year_end_date
|
filters.to_date = filters.year_end_date
|
||||||
|
|
||||||
def get_data(filters):
|
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)
|
from `tabAccount` where company=%s order by account_name, lft""", filters.company, as_dict=True)
|
||||||
company_currency = erpnext.get_company_currency(filters.company)
|
company_currency = erpnext.get_company_currency(filters.company)
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
|
|||||||
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
|
def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
|
||||||
data = []
|
data = []
|
||||||
tmpaccnt = sorted(accounts)
|
tmpaccnt = sorted(accounts)
|
||||||
if accounts[0].account_name[0].isnumeric():
|
if not (accounts[0].account_number is None):
|
||||||
accounts = tmpaccnt
|
accounts = tmpaccnt
|
||||||
|
|
||||||
for d in accounts:
|
for d in accounts:
|
||||||
|
Loading…
Reference in New Issue
Block a user