@frappe.whitelist()
def get_opening_accounts(company):
 accounts = frappe.db.sql_list(u"select\n DCTB  DCTB  DCTB name from tabAccount\n DCTB  DCTB where\n DCTB  DCTB  DCTB is_group=0 and\n DCTB  DCTB  DCTB report_type='Balance Sheet' and\n DCTB  DCTB  DCTB ifnull(warehouse, '') = '' and\n DCTB  DCTB  DCTB company=%s\n DCTB  DCTB order by name asc", company)
 return [{u'account': a, u'balance': get_balance_on(a)} for a in accounts]

@ frappe . whitelist ( ) def get_opening_accounts ( company ) : accounts = frappe . db . sql_list ( u"select\n DCTB  DCTB  DCTB name from tabAccount\n DCTB  DCTB where\n DCTB  DCTB  DCTB is_group=0 and\n DCTB  DCTB  DCTB report_type='Balance Sheet' and\n DCTB  DCTB  DCTB ifnull(warehouse, '') = '' and\n DCTB  DCTB  DCTB company=%s\n DCTB  DCTB order by name asc" , company ) return [ { u'account' : a , u'balance' : get_balance_on ( a ) } for a in accounts ]
get all balance sheet accounts for opening entry .