X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Freports_classes.inc;h=a3a7cfad11921e214f1eb5ce47bbf2e815decc25;hb=b9b56a5ff383d30908052431e3e0cbc6f7f76228;hp=badf6308fabea23ca8b5d05f3859058284a313ab;hpb=720988d0c5feec323d5c5fe87e36c40190d50105;p=fa-stable.git diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index badf6308..a3a7cfad 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -1,26 +1,40 @@ . +***********************************************************************/ +class BoxReports { var $ar_classes; + var $ctrl_handlers = array(); - function ReportClasses() + function ReportClasses() { $this->ar_classes = array(); } - function addReportClass($class_name) + function addReportClass($class_name) { $this->ar_classes[$class_name] = array(); } - function addReport($class_name, $id, $rep_name, $params=null) + function addReport($class_name, $id, $rep_name, $params=null) { - $this->ar_classes[$class_name][] = new Report($id,$rep_name,$params); + unset($this->ar_classes[$class_name][$id]); // unset std report if any + $this->ar_classes[$class_name][$id] = new Report($id, $rep_name, $params); } - function getDisplay($class=null) + function getDisplay($class=null) { - global $table_style2; + global $table_style2, $comp_path, $path_to_root, $pdf_debug, $Ajax; + + $temp = array_values($this->ar_classes); $display_class = $class==null ? $temp[0] : $this->ar_classes[$class]; $class_counter = 0; @@ -28,36 +42,61 @@ class BoxReports $st_reports = ""; $st_params = ""; $st_classes = "" . _("Report Classes:") . "
"; - foreach($this->ar_classes as $key=>$value) + foreach($this->ar_classes as $key=>$value) { - $style = $class_counter==0 ? '' : $style = "style='display:none'"; - $st_classes .= "$key
"; - $st_reports .= ""; - foreach($value as $report) + $style = $class_counter==$_REQUEST['Class'] ? '' : "style='display:none'"; + $acc = access_string($key); + $st_classes .= "$acc[0]
"; + $st_reports .= "
" . _("Reports For Class: ") . " $key
\n"; + foreach($value as $report) { - $st_reports .= ""; - $st_params .= "
" . _("Reports For Class: ") . " $key
" . $report->name . "
"; - $st_params .= ""; + $acc = access_string($report->name); + $st_reports .= "id'" + ." id='".default_focus()."'" + ."$acc[1]>$acc[0]\n"; + if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) { + + $action = $path_to_root.'/reporting/prn_redirect.php'; + + $st_params = "
\n" + . "
\n"; + $st_params .= hidden('REP_ID', $report->id, false); + $st_params .= submit('Rep'.$report->id, + _("Display: ") . access_string($report->name, true), + false, '', $pdf_debug ? false : 'default') . '

'; + $st_params .= $this->getOptions($report->get_controls()); + $st_params .= "\n
\n"; + set_focus('Rep'.$report->id); + $Ajax->addUpdate(true, 'rep_form', $st_params); + } } $st_reports .= ""; + $class_counter++; } + $st_params = "
". + "$st_params
"; + + $st = " "; @@ -69,59 +108,56 @@ class BoxReports return $st; } -} - -class Report -{ - var $id; - var $name; - var $ar_params; - function Report($id, $name, $ar_params) - { - $this->id = $id; - $this->name = $name; - $this->ar_params = $ar_params; - } - function getDisplay() + function getOptions($controls) { - global $path_to_root, $use_date_picker; - $st = " - - "; - $st .= "

"; - $dummy = ""; - if ($this->ar_params==null) - return ""; - foreach($this->ar_params as $index=>$param) - { - $st .= $param->param_name . ':
'; - switch ($param->param_type) + + // + // Register additional control handler + // $handle - name of global function f($name, $type) returning html code for control + function register_controls($handler) { + $this->ctrl_handlers[] = $handler; + } + // + // Returns html code for input control $name of type $type + // + function get_ctrl($name, $type) + { + global $path_to_root, $use_date_picker, $pdf_debug, $print_invoice_no; + + $st = ''; + switch ($type) { case 'CURRENCY': - $sql = "SELECT curr_abrev, concat(curr_abrev,' - ', currency) FROM ".TB_PREF."currencies"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Currency Filter")); - break; + $sql = "SELECT curr_abrev, concat(curr_abrev,' - ', currency) AS name FROM ".TB_PREF."currencies"; + return combo_input($name, '', $sql, 'curr_abrev', 'name',array('spec_option'=>_("No Currency Filter"),'spec_id'=>ALL_TEXT,'order'=>false)); + case 'DATE': case 'DATEBEGIN': case 'DATEEND': @@ -129,279 +165,275 @@ class Report case 'DATEENDM': case 'DATEBEGINTAX': case 'DATEENDTAX': - if ($param->param_type == 'DATEBEGIN') + if ($type == 'DATEBEGIN') $date = begin_fiscalyear(); - elseif ($param->param_type == 'DATEEND') + elseif ($type == 'DATEEND') $date = end_fiscalyear(); else $date = Today(); - if ($param->param_type == 'DATEBEGINM') + if ($type == 'DATEBEGINM') $date = begin_month($date); - elseif ($param->param_type == 'DATEENDM') + elseif ($type == 'DATEENDM') $date = end_month($date); - elseif ($param->param_type == 'DATEBEGINTAX' || $param->param_type == 'DATEENDTAX') + elseif ($type == 'DATEBEGINTAX' || $type == 'DATEENDTAX') { $row = get_company_prefs(); $edate = add_months($date, -$row['tax_last']); $edate = end_month($edate); - if ($param->param_type == 'DATEENDTAX') + if ($type == 'DATEENDTAX') $date = $edate; else { - $bdate = add_months($edate, -$row['tax_prd'] + 1); - $date = begin_month($bdate); + $bdate = begin_month($edate); + $bdate = add_months($bdate, -$row['tax_prd'] + 1); + $date = $bdate; } - } - $name = "RP_" . $this->id . "_$index"; - //$st .= ""; - $st .= ""; + } + + $st = ""; if ($use_date_picker) $st .= "" . " "._(\n"; - - break; - case 'YES_NO': - $sel = array(_('No'), _("Yes")); - $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); - break; - case 'PAYMENT_LINK': - $sel = array(_("No Payment Link"), "PayPal"); - $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); + return $st; break; + + case 'YES_NO': + return yesno_list($name); + + case 'PAYMENT_LINK': + $sel = array(_("No payment Link"), "PayPal"); + return array_selector($name, null, $sel); + + case 'DESTINATION': + $sel = array(_("PDF/Printer"), "Excel"); + return array_selector($name, null, $sel); + case 'COMPARE': $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget")); - $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); - break; + return array_selector($name, null, $sel); + case 'GRAPHIC': - $sel = array(_("No Graphics"), _("Vertical bars"), _("Horizontal bars"), _("Dots"), _("Lines"), _("Pie"), _("Donut")); - $st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel); - break; + $sel = array(_("No Graphics"), _("Vertical bars"), _("Horizontal bars"), + _("Dots"), _("Lines"), _("Pie"), _("Donut")); + return array_selector($name, null, $sel); + case 'SYS_TYPES': - $st .= dup_systypes_list("RP_" . $this->id . "_$index", $dummy, true, _("No Type Filter"), true); - break; + return gl_systypes_list($name, null, _("No Type Filter")); + + case 'SYS_TYPES_ALL': + return systypes_list($name, null, _("No Type Filter")); + case 'TEXT': - $st .= ""; - break; + return ""; + case 'TEXTBOX': - $st .= ""; - break; - case 'ACCOUNTS': - $sql = "SELECT id, name FROM ".TB_PREF."chart_types ORDER BY name"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Account Group Filter"), true); - break; + return ""; + + case 'ACCOUNTS': // not used +// $sql = "SELECT id, name FROM ".TB_PREF."chart_types"; +// return combo_input($name, '', $sql, 'id', 'name',array('spec_option'=>_("No Account Group Filter"),'spec_id'=>ALL_NUMERIC)); + return gl_account_types_list($name, null, _("No Account Group Filter"), true); + + case 'ACCOUNTS_NO_FILTER': // not used + return gl_account_types_list($name); + case 'GL_ACCOUNTS': - $sql = "SELECT account_code, concat(account_code, ' - ', account_name) as account_name FROM ".TB_PREF."chart_master ORDER BY account_code"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return gl_all_accounts_list($name); + case 'BANK_ACCOUNTS': - $sql = "SELECT ".TB_PREF."bank_accounts.account_code, concat(bank_account_name, if (bank_curr_code=curr_default,'', concat(' - ', bank_curr_code))) FROM ".TB_PREF."bank_accounts, ".TB_PREF."chart_master, ".TB_PREF."company - WHERE ".TB_PREF."bank_accounts.account_code=".TB_PREF."chart_master.account_code"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return bank_accounts_list($name); + case 'DIMENSION': - $sql = "SELECT reference, concat(reference, ' - ', name) AS DimName FROM ".TB_PREF."dimensions ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return dimensions_list($name, null, false, ' ', false, true, 0); + case 'DIMENSIONS': - $sql = "SELECT reference, concat(reference, ' - ', name) as DimName FROM ".TB_PREF."dimensions ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Dimension Filter"), true); - break; + return dimensions_list($name, null, true, _("No Dimension Filter"), false, true, 0); + case 'DIMENSION1': - $sql = "SELECT reference, concat(reference, ' - ', name) AS DimName FROM ".TB_PREF."dimensions WHERE type_=1 ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return dimensions_list($name, null, false, ' ', false, true, 1); + case 'DIMENSIONS1': - $sql = "SELECT reference, concat(reference, ' - ', name) as DimName FROM ".TB_PREF."dimensions WHERE type_=1 ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Dimension Filter"), true); - break; + return dimensions_list($name, null, true, _("No Dimension Filter"), false, true, 1); + case 'DIMENSION2': - $sql = "SELECT reference, concat(reference, ' - ', name) AS DimName FROM ".TB_PREF."dimensions WHERE type_=2 ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return dimensions_list($name, null, false, ' ', false, true, 2); + case 'DIMENSIONS2': - $sql = "SELECT reference, concat(reference, ' - ', name) as DimName FROM ".TB_PREF."dimensions WHERE type_=2 ORDER BY reference"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Dimension Filter"), true); - break; + return dimensions_list($name, null, true, _("No Dimension Filter"), false, true, 2); + case 'CUSTOMERS_NO_FILTER': case 'CUSTOMERS': - $sql = "SELECT debtor_no, name FROM ".TB_PREF."debtors_master ORDER BY name"; - if ($param->param_type == 'CUSTOMERS_NO_FILTER') - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Customer Filter"), true); - else - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + $sql = "SELECT debtor_no, name FROM ".TB_PREF."debtors_master"; + if ($type == 'CUSTOMERS_NO_FILTER') + return combo_input($name, '', $sql, 'debtor_no', 'name',array('spec_option'=>_("No Customer Filter"),'spec_id'=>ALL_NUMERIC)); +// FIX allitems numeric! +// return customer_list($name, null, _("No Customer Filter")); + else + return combo_input($name, '', $sql, 'debtor_no', 'name', null); +// return customer_list($name); + case 'SUPPLIERS_NO_FILTER': case 'SUPPLIERS': - $sql = "SELECT supplier_id, supp_name FROM ".TB_PREF."suppliers ORDER BY supp_name"; - if ($param->param_type == 'SUPPLIERS_NO_FILTER') - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Supplier Filter"), true); - else - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + $sql = "SELECT supplier_id, supp_name FROM ".TB_PREF."suppliers"; + if ($type == 'SUPPLIERS_NO_FILTER') + return combo_input($name, '', $sql, 'supplier_id', 'supp_name',array('spec_option'=>_("No Supplier Filter"),'spec_id'=>ALL_NUMERIC)); +// FIX allitems numeric! +// return supplier_list($name, null, _("No Supplier Filter")); + else + return combo_input($name, '', $sql, 'supplier_id', 'supp_name', null); +// return supplier_list($name); + case 'INVOICE': $IV = _("IV"); $CN = _("CN"); - $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-', - ".TB_PREF."debtor_trans.type) AS TNO, concat(".TB_PREF."debtor_trans.trans_no, if (type=10, ' $IV ', ' $CN '), ".TB_PREF."debtors_master.name) as IName - FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE (type=10 OR type=11) AND ".TB_PREF."debtors_master.debtor_no=".TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + $ref = ($print_invoice_no == 1 ? "trans_no" : "reference"); + $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-', + ".TB_PREF."debtor_trans.type) AS TNO, concat(".TB_PREF."debtor_trans.$ref, if (type=".ST_SALESINVOICE.", ' $IV ', ' $CN '), ".TB_PREF."debtors_master.name) as IName + FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE (type=".ST_SALESINVOICE." OR type=".ST_CUSTCREDIT.") AND ".TB_PREF."debtors_master.debtor_no=".TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC"; + return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false)); + + case 'DELIVERY': + $DN = _("DN"); + $sql = "SELECT + concat(".TB_PREF."debtor_trans.trans_no, '-', ".TB_PREF."debtor_trans.type) AS TNO, concat(".TB_PREF."debtor_trans.trans_no, ' $DN ', + ".TB_PREF."debtors_master.name) as IName + FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans + WHERE type=".ST_CUSTDELIVERY." AND ".TB_PREF."debtors_master.debtor_no=". + TB_PREF."debtor_trans.debtor_no ORDER BY ".TB_PREF."debtor_trans.trans_no DESC"; + return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false)); + case 'ORDERS': - $sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.order_no, '-', - ".TB_PREF."debtors_master.name) as IName - FROM ".TB_PREF."debtors_master, ".TB_PREF."sales_orders WHERE ".TB_PREF."debtors_master.debtor_no=".TB_PREF."sales_orders.debtor_no ORDER BY ".TB_PREF."sales_orders.order_no DESC"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + $ref = ($print_invoice_no == 1 ? "order_no" : "reference"); + $sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.$ref, '-', + ".TB_PREF."debtors_master.name) as IName + FROM ".TB_PREF."debtors_master, ".TB_PREF."sales_orders WHERE ".TB_PREF."debtors_master.debtor_no=".TB_PREF."sales_orders.debtor_no + AND ".TB_PREF."sales_orders.trans_type=".ST_SALESORDER." ORDER BY ".TB_PREF."sales_orders.order_no DESC"; + return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false)); + + case 'QUOTATIONS': + $ref = ($print_invoice_no == 1 ? "order_no" : "reference"); + $sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.$ref, '-', + ".TB_PREF."debtors_master.name) as IName + FROM ".TB_PREF."debtors_master, ".TB_PREF."sales_orders WHERE ".TB_PREF."debtors_master.debtor_no=".TB_PREF."sales_orders.debtor_no + AND ".TB_PREF."sales_orders.trans_type=".ST_SALESQUOTE." ORDER BY ".TB_PREF."sales_orders.order_no DESC"; + return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false)); + case 'PO': - $sql = "SELECT ".TB_PREF."purch_orders.order_no, concat(".TB_PREF."purch_orders.order_no, '-', - ".TB_PREF."suppliers.supp_name) as IName + $ref = ($print_invoice_no == 1 ? "order_no" : "reference"); + $sql = "SELECT ".TB_PREF."purch_orders.order_no, concat(".TB_PREF."purch_orders.$ref, '-', + ".TB_PREF."suppliers.supp_name) as IName FROM ".TB_PREF."suppliers, ".TB_PREF."purch_orders WHERE ".TB_PREF."suppliers.supplier_id=".TB_PREF."purch_orders.supplier_id ORDER BY ".TB_PREF."purch_orders.order_no DESC"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false)); + case 'ITEMS': - $sql = "SELECT stock_id, concat(stock_id, '-', description) as name FROM ".TB_PREF."stock_master WHERE (mb_flag='A' OR mb_flag='M') ORDER BY stock_id"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return stock_manufactured_items_list($name); + + case 'WORKORDER': + $sql = "SELECT ".TB_PREF."workorders.id, concat(".TB_PREF."workorders.id, '-', + ".TB_PREF."stock_master.description) as IName + FROM ".TB_PREF."stock_master, ".TB_PREF."workorders WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."workorders.stock_id ORDER BY ".TB_PREF."workorders.id DESC"; + return combo_input($name, '', $sql, 'id', 'IName',array('order'=>false)); + case 'LOCATIONS': - $sql = "SELECT loc_code, location_name FROM ".TB_PREF."locations ORDER BY location_name"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Location Filter"), false); - break; + return locations_list($name, null, _("No Location Filter")); + case 'CATEGORIES': - $sql = "SELECT category_id, description FROM ".TB_PREF."stock_category ORDER BY description"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Category Filter"), true); - break; + return stock_categories_list($name, null, _("No Category Filter")); + case 'SALESTYPES': - $sql = "SELECT id, sales_type FROM ".TB_PREF."sales_types ORDER BY sales_type"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + return sales_types_list($name); + case 'AREAS': - $sql = "SELECT area_code, description FROM ".TB_PREF."areas ORDER BY description"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Area Filter"), true); - break; + return sales_areas_list($name); + case 'SALESMEN': - $sql = "SELECT salesman_code, salesman_name FROM ".TB_PREF."salesman ORDER BY salesman_name"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy, true, _("No Sales Folk Filter"), true); - break; + return sales_persons_list($name, null, _("No Sales Folk Filter")); + case 'TRANS_YEARS': - $sql = "SELECT DISTINCT YEAR(tran_date), YEAR(tran_date) FROM ".TB_PREF."gl_trans"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; - case 'ACCOUNTS_NO_FILTER': - $sql = "SELECT id, name FROM ".TB_PREF."chart_types ORDER BY name"; - $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy); - break; + $sql = "SELECT DISTINCT YEAR(tran_date) AS tran_date, YEAR(tran_date) AS tran_date2 FROM ".TB_PREF."gl_trans"; + return combo_input($name, '', $sql, 'tran_date', 'tran_date2',array('order'=>array('tran_date'))); +// FIX shouldn't it be fiscal year selector? +// return fiscalyears_list($name); - } - $st .= "

"; - } - return $st; - } -} + case 'USERS': + $sql = "SELECT id, user_id FROM ".TB_PREF."users"; + return combo_input($name, '', $sql, 'id', 'user_id',array('spec_option'=>_("No Users Filter"),'spec_id'=>ALL_NUMERIC)); -class ReportParam -{ - var $param_name; - var $param_type; + case 'ACCOUNTTAGS': + case 'DIMENSIONTAGS': + if ($type == 'ACCOUNTTAGS') + $tag_type = TAG_ACCOUNT; + else + $tag_type = TAG_DIMENSION; + return tag_list($name, 5, $tag_type, true, _("No tags")); - function ReportParam($param_name, $param_type) - { - $this->param_name = $param_name; - $this->param_type = $param_type; + } + return ''; } } -function dup_simple_codeandname_list($sql, $name, &$selected_id, - $all_option=false, $all_option_name=null, $all_option_numeric=false, - $submit_on_change=false) +class Report { - if ($submit_on_change == true) - $st = ""; - - if ($all_option == true) + var $id; + var $name; + var $ar_params; + var $controls; + + function Report($id, $name, $ar_params = null) { - if ($all_option_numeric) - $reserved_word = reserved_words::get_all_numeric(); - else - $reserved_word = reserved_words::get_all(); - - if ($reserved_word == $selected_id) - { - $st .= "\n"; - } - else - { - $st .= "\n"; - } - if ($selected_id == "") - { - $selected_id = $reserved_word; - } + $this->id = $id; + $this->name = $name; + if ($ar_params) $this->set_controls($ar_params); } - - $result = db_query($sql); - - while ($row = db_fetch_row($result)) - { - if ($selected_id == $row[0]) - { - $st .= "\n"; - - if ($selected_id == "") - { - $selected_id = $row[0]; - } + + function set_controls($ar_params) { + $this->controls = $ar_params; } - - $st .= ""; - db_free_result($result); - - return $st; + + function get_controls() { + return $this->controls; + } + } -function dup_simple_name_list($name, $selections) +//------------------------------------------------------------------------------------------------ +function gl_systypes_list($name, $value=null, $spec_opt=false) { - $st = ""; - return $st; -} + global $systypes_array; + + $types = $systypes_array; + + foreach(array(ST_LOCTRANSFER, ST_PURCHORDER, ST_SUPPRECEIVE, ST_MANUISSUE, + ST_MANURECEIVE, ST_SALESORDER, ST_SALESQUOTE, ST_DIMENSION) as $type) + unset($types[$type]); -//------------------------------------------------------------------------------------------------ + return array_selector($name, $value, $types, + array( + 'spec_option'=> $spec_opt, + 'spec_id' => ALL_NUMERIC, + 'async' => false, + ) + ); +} -function dup_systypes_list($name, &$selected_id, $all_option=false, $all_option_name=null) +function add_custom_reports(&$reports) { - global $systypes_array; + global $installed_extensions, $path_to_root, $comp_path; - $st = ""; - return $st; + $file = $comp_path.'/'.user_company()."/reporting/reports_custom.php"; + if (file_exists($file)) + include_once($file); } - ?> \ No newline at end of file