Access control system description.
[fa-stable.git] / reporting / includes / reports_classes.inc
index fd424fb213a9f36271735c1d206dc3ff1baf2381..5ff1c72a0ad8dc6adb9186581e542437b96ac5ae 100644 (file)
@@ -134,8 +134,8 @@ class Report
                        switch ($param->param_type)
                        {
                                case 'CURRENCY':
-                                       $sql = "SELECT curr_abrev, concat(curr_abrev,' - ', currency) FROM ".TB_PREF."currencies";
-                                       $st .= dup_simple_codeandname_list($sql, "PARAM_$index", $dummy, true, _("No Currency Filter"));
+                                       $sql = "SELECT curr_abrev, concat(curr_abrev,' - ', currency) AS name FROM ".TB_PREF."currencies";
+                                       $st .= combo_input("PARAM_$index", '', $sql, 'curr_abrev', 'name',array('spec_option'=>_("No Currency Filter"),'spec_id'=>ALL_TEXT,'order'=>false));
                                        break;
                                case 'DATE':
                                case 'DATEBEGIN':
@@ -210,9 +210,15 @@ class Report
                                        $sql = "SELECT id, name FROM ".TB_PREF."chart_types";
                                        $st .= combo_input("PARAM_$index", '', $sql, 'id', 'name',array('spec_option'=>_("No Account Group Filter"),'spec_id'=>ALL_NUMERIC));
                                        break;
+                               case 'ACCOUNTS_NO_FILTER':
+                                       $sql = "SELECT id, name FROM ".TB_PREF."chart_types";
+                                       $st .= combo_input("PARAM_$index", '', $sql, 'id', 'name', null);
+                                       break;
                                case 'GL_ACCOUNTS':
-                                       $sql = "SELECT account_code, concat(account_code, ' - ', account_name) as account_name FROM ".TB_PREF."chart_master";
-                                       $st .= combo_input("PARAM_$index", '', $sql, 'account_code', 'account_name',array('order'=>array('account_code')));
+                                       $sql = "SELECT chart.account_code, chart.account_name, type.name, chart.inactive, type.id
+                                               FROM ".TB_PREF."chart_master chart,".TB_PREF."chart_types type WHERE chart.account_type=type.id";
+                                       $st .= combo_input("PARAM_$index", '', $sql, 'chart.account_code', 'chart.account_name',
+                                               array('format' => '_format_account','order' => array('type.id','account_code'),'async' => false,'category' => 2));
                                        break;
                                case 'BANK_ACCOUNTS':
                                        $sql = "SELECT ".TB_PREF."bank_accounts.id, concat(bank_account_name, if (bank_curr_code=curr_default,'', concat(' - ', bank_curr_code))) AS name FROM ".TB_PREF."bank_accounts, ".TB_PREF."company";
@@ -339,18 +345,14 @@ class Report
                                        $sql = "SELECT id, user_id FROM ".TB_PREF."users";
                                        $st .= combo_input("PARAM_$index", '', $sql, 'id', 'user_id',array('spec_option'=>_("No Users Filter"),'spec_id'=>ALL_NUMERIC));
                                        break;
-                               case 'ACCOUNTS_NO_FILTER':
-                                       $sql = "SELECT id, name FROM ".TB_PREF."chart_types";
-                                       $st .= combo_input("PARAM_$index", '', $sql, 'id', 'name', null);
-                                       break;
                                case 'ACCOUNTTAGS':
                                case 'DIMENSIONTAGS':
                                        if ($param->param_type == 'ACCOUNTTAGS')
-                                               $type = 0;
+                                               $type = TAG_ACCOUNT;
                                        else
-                                               $type = 1;
+                                               $type = TAG_DIMENSION;
                                        $sql = "SELECT id, name FROM ".TB_PREF."tags WHERE type=$type"; 
-                                       $st .= combo_input("PARAM_$index", '', $sql, 'id', 'name',array('spec_option'=>_("No tags"),'spec_id' => ALL_NUMERIC,'multi'=>true,'height'=>4));
+                                       $st .= combo_input("PARAM_$index", '', $sql, 'id', 'name',array('spec_option'=>_("No tags"),'spec_id' => ALL_NUMERIC,'multi'=>true,'height'=>5));
                                        break;
 
                        }