- $sql = "SELECT ".TB_PREF."chart_master.account_code, ".TB_PREF."chart_master.account_name, ".TB_PREF."chart_types.name AS AccountTypeName,".TB_PREF."chart_types.id AS AccountType,
- ".TB_PREF."chart_types.parent, ".TB_PREF."chart_class.class_name AS AccountClassName
+ if ($balance == 1)
+ $where ="WHERE balance_sheet>0 AND balance_sheet<".CL_INCOME;
+ elseif ($balance == 0)
+ $where ="WHERE balance_sheet>".CL_EQUITY." OR balance_sheet=0"; // backwards compatibility
+ $sql = "SELECT ".TB_PREF."chart_master.account_code, ".TB_PREF."chart_master.account_name, ".TB_PREF."chart_master.account_code2,
+ ".TB_PREF."chart_types.name AS AccountTypeName,".TB_PREF."chart_types.id AS AccountType,
+ ".TB_PREF."chart_types.parent, ".TB_PREF."chart_class.class_name AS AccountClassName, ".TB_PREF."chart_class.cid AS ClassID,
+ ".TB_PREF."chart_class.balance_sheet AS ClassType