Redundant sql sentences in Report Filters.
[fa-stable.git] / reporting / includes / reports_classes.inc
index b7cccecc4590417a48ef8029972d3078187825c1..1b9694d3890783ddd6acd5bb3a4625744b34627e 100644 (file)
@@ -18,6 +18,7 @@ define('RC_MANUFACTURE', 3);
 define('RC_DIMENSIONS', 4);
 define('RC_BANKING', 5);
 define('RC_GL', 6);
+define('RC_FIXEDASSETS', 7);
 
 class BoxReports
 {
@@ -25,7 +26,7 @@ class BoxReports
        var $ar_reports;
        var $ctrl_handlers = array();
 
-       function ReportClasses()
+       function __construct()
        {
                $this->ar_classes = array();
        }
@@ -219,7 +220,7 @@ class BoxReports
                                                $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ? 
                                                        "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
                                                $st .= "<a href=\"javascript:date_picker(document.forms[0].$name);\">"
-                                               . "     <img src='$calc_image' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+                                               . "     <img src='$calc_image' style='vertical-align:middle;padding-bottom:4px;width:16px;height:16px;border:0;' alt='"._('Click Here to Pick up the date')."'></a>\n";
                                        }       
                                        return $st;
                                        break;
@@ -264,7 +265,7 @@ class BoxReports
 
                                case 'TEXTBOX':
                                        $value = (isset($_POST[$name]) ? $_POST[$name] : "");
-                                       return "<textarea rows=4 cols=30 name='$name'>$value</textarea>";
+                                       return "<textarea rows=4 cols=30 maxlength=130 name='$name'>$value</textarea>";
 
                                case 'ACCOUNTS': // not used
                                        return gl_account_types_list($name, null, _("No Account Group Filter"), true);
@@ -298,7 +299,6 @@ class BoxReports
 
                                case 'CUSTOMERS_NO_FILTER':
                                case 'CUSTOMERS':
-                                       $sql = "SELECT debtor_no, name FROM ".TB_PREF."debtors_master";
                                        if ($type == 'CUSTOMERS_NO_FILTER')
                                                return customer_list($name, null, _("No Customer Filter"));
                                        else
@@ -306,7 +306,6 @@ class BoxReports
 
                                case 'SUPPLIERS_NO_FILTER':
                                case 'SUPPLIERS':
-                                       $sql = "SELECT supplier_id, supp_name FROM ".TB_PREF."suppliers";
                                        if ($type == 'SUPPLIERS_NO_FILTER')
                                                return supplier_list($name, null, _("No Supplier Filter"));
                                        else
@@ -416,15 +415,20 @@ class BoxReports
 
                                case 'LOCATIONS':
                                        return  locations_list($name, null, _("No Location Filter"));
+                               case 'FLOCATIONS':
+                                       return  locations_list($name, null, _("No Location Filter"), false, true);
 
                                case 'CATEGORIES':
                                        return stock_categories_list($name, null, _("No Category Filter"));
-
+                               case 'FCATEGORIES':
+                                       return stock_categories_list($name, null, _("No Category Filter"), false, true);
+                               case 'FCLASS':
+                                       return fixed_asset_classes_list($name, null, _("No Class Filter"), false);
                                case 'SALESTYPES':
                                        return sales_types_list($name);
 
                                case 'AREAS':
-                                       return sales_areas_list($name);
+                                       return sales_areas_list($name, null, _("No Areas Filter"));
 
                                case 'SALESMEN':
                                        return sales_persons_list($name, null, _("No Sales Folk Filter"));
@@ -456,7 +460,7 @@ class Report
        var $ar_params;
        var $controls;
        
-       function Report($id, $name, $ar_params = null)
+       function __construct($id, $name, $ar_params = null)
        {
                $this->id = $id;
                $this->name = $name;