X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fincludes%2Fdb%2Fgl_db_accounts.inc;h=ce0a35071852b71d96ecb339f42b899e231c3bee;hb=80dd97a37f674cc3691fa04af4c29607067566b2;hp=414ad8e277f727c92035c807c25051bba7ee691d;hpb=2383d33373d6ddec06906658a0ed6398077c1147;p=fa-stable.git diff --git a/gl/includes/db/gl_db_accounts.inc b/gl/includes/db/gl_db_accounts.inc index 414ad8e2..ce0a3507 100644 --- a/gl/includes/db/gl_db_accounts.inc +++ b/gl/includes/db/gl_db_accounts.inc @@ -52,12 +52,13 @@ function get_gl_accounts($from=null, $to=null) function get_gl_accounts_all($balance=-1) { if ($balance == 1) - $where ="WHERE balance_sheet>0 AND balance_sheet<".CL_INCOME; + $where ="WHERE ctype>0 AND ctype<".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_types.name AS AccountTypeName,".TB_PREF."chart_types.id AS AccountType, + $where ="WHERE ctype>".CL_EQUITY." OR ctype=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 + ".TB_PREF."chart_class.ctype AS ClassType FROM ".TB_PREF."chart_types INNER JOIN ".TB_PREF."chart_class ON ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid LEFT JOIN ".TB_PREF."chart_master ON ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id "; if ($balance != -1) @@ -78,7 +79,7 @@ function get_gl_account($code) function is_account_balancesheet($code) { - $sql = "SELECT ".TB_PREF."chart_class.balance_sheet FROM ".TB_PREF."chart_class, ".TB_PREF."chart_types, ".TB_PREF."chart_master + $sql = "SELECT ".TB_PREF."chart_class.ctype FROM ".TB_PREF."chart_class, ".TB_PREF."chart_types, ".TB_PREF."chart_master WHERE ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id AND ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid AND ".TB_PREF."chart_master.account_code='$code'";