brotherton-erpnext/accounts/search_criteria/trial_balance/trial_balance.sql

2 lines
261 B
SQL

SELECT CONCAT( REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM tabAccount AS node,tabAccount AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt and node.company = '%(company)s' and node.docstatus != 2 GROUP BY node.name ORDER BY node.lft