MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+
+// Standard report classess
+define('RC_CUSTOMER', 0);
+define('RC_SUPPLIER', 1);
+define('RC_INVENTORY', 2);
+define('RC_MANUFACTURE', 3);
+define('RC_DIMENSIONS', 4);
+define('RC_BANKING', 5);
+define('RC_GL', 6);
+define('RC_FIXEDASSETS', 7);
+
class BoxReports
{
- var $ar_classes;
+ var $ar_classes; // report class names
+ var $ar_reports;
var $ctrl_handlers = array();
function ReportClasses()
$this->ar_classes = array();
}
- function addReportClass($class_name)
+ function addReportClass($class_name, $class_id=null)
{
- $this->ar_classes[$class_name] = array();
+ if (!$class_id)
+ $class_id = count($this->ar_classes);
+ $this->ar_classes[$class_id] = $class_name;
+
+ return $class_id;
}
- function addReport($class_name, $id, $rep_name, $params=null)
+ function addReport($class, $id, $rep_name, $params=null)
{
- unset($this->ar_classes[$class_name][$id]); // unset std report if any
- $this->ar_classes[$class_name][$id] = new Report($id, $rep_name, $params);
+ unset($this->ar_reports[$class][$id]); // unset std report if any
+ $this->ar_reports[$class][$id] = new Report($id, $rep_name, $params);
}
function getDisplay($class=null)
{
- global $table_style, $comp_path, $path_to_root, $pdf_debug, $Ajax;
+ global $path_to_root, $SysPrefs, $Ajax;
+ if (find_submit('Rep') != -1) {
+ include($path_to_root.'/reporting/prn_redirect.php');
+ return;
+ }
$temp = array_values($this->ar_classes);
$display_class = $class==null ? $temp[0] : $this->ar_classes[$class];
- $class_counter = 0;
- $rep_counter = 0;
$st_reports = "";
$st_params = "";
$st_classes = "<b>" . _("Report Classes:") . "</b><br>";
- foreach($this->ar_classes as $key=>$value)
+
+ if (isset($_GET['Class']))
+ set_focus('class'.$_GET['Class']);
+
+ $cur_class = $_REQUEST['Class'];
+
+ foreach($this->ar_classes as $class_id => $name)
{
- $style = $class_counter==$_REQUEST['Class'] ? '' : "style='display:none'";
- $acc = access_string($key);
+ if (!isset($this->ar_reports[$class_id]))
+ continue; // e.g. no dimensions
+
+ $acc = access_string($name);
$st_classes .= "<a href='"
- .$_SERVER['PHP_SELF']."?Class=$class_counter'"
- ." class='menu_option' id='".default_focus()."'"
- ." onclick='return showClass($class_counter);'$acc[1]>$acc[0]</a> <br>";
- $st_reports .= "<table id='TAB_" . $class_counter ."' $style cellpadding=0 cellspacing=0 width='100%'><tr><td><b>" . _("Reports For Class: ") . " $key</b></td></tr>\n";
- foreach($value as $report)
+ .$_SERVER['PHP_SELF']."?Class=$class_id'"
+ ." style='font-weight:". ($cur_class == $class_id ? 'bold' : 'normal')."'"
+ ." class='repclass_link' id='".'class'.$class_id."'"
+ ."$acc[1]>$acc[0]</a> <br>";
+
+ $style = $class_id==$cur_class ? '' : "style='display:none'";
+ $st_reports .= "<table class='repclass' id='TAB_" . $class_id ."' $style cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td><b>" . _("Reports For Class: ") . " $name</b></td></tr>\n";
+ foreach($this->ar_reports[$class_id] as $rep_id => $report)
{
$acc = access_string($report->name);
- $st_reports .= "<tr><td><a class='printlink' href='"
- .$_SERVER['PHP_SELF']."?Class=$class_counter&rep_id=$report->id'"
- ." id='".default_focus()."'"
+ $st_reports .= "<tr><td><a class='repopts_link'"
+ ." href='".$_SERVER['PHP_SELF']."?Class=$class_id&REP_ID=$report->id'"
+ ." style='font-weight:". (@$_REQUEST['REP_ID'] == $report->id ? 'bold' : 'normal')."'"
+ ." id='".$id = default_focus()."'"
."$acc[1]>$acc[0]</a><tr><td>\n";
- if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) {
- $action = $path_to_root.'/reporting/prn_redirect.php';
-
+ if (@$_REQUEST['REP_ID'] == $report->id) {
+ $Ajax->activate($id);
+ }
+
+ if (isset($_REQUEST['REP_ID']) && $_REQUEST['REP_ID']==$report->id) {
+ // parameters form
+ $action = $_SERVER['PHP_SELF'];
$st_params = "<table><tr><td>\n"
. "<form method='POST' action='$action' target='_blank'>\n";
$st_params .= submit('Rep'.$report->id,
_("Display: ") . access_string($report->name, true),
- false, '', $pdf_debug ? false : 'default') . hidden('REP_ID', $report->id, false).'<br><br>';
- $st_params .= $this->getOptions($report->get_controls());
- $st_params .= "\n</form></td></tr></table>\n";
+ false, '', $SysPrefs->pdf_debug ? false : 'default process') . hidden('REP_ID', $report->id, false).'<br><br>';
+ $st_params .= $this->getOptions($report->get_controls(), $report->id);
+ $st_params .= "\n<input type=hidden name='Class' value=".$cur_class.">"
+ ."\n</form></td></tr></table>\n";
set_focus('Rep'.$report->id);
$Ajax->addUpdate(true, 'rep_form', $st_params);
}
}
$st_reports .= "</table>";
- $class_counter++;
}
$st_params = "<div id='rep_form'>".
"$st_params</div>";
-
- $st = "<script language='javascript'>
- function showClass(pClass) {
- for(i=0; i<$class_counter; i++) {
- document.getElementById(\"TAB_\" + i).style.display=
- i==pClass ? \"block\" : \"none\";
- }
- document.getElementById('rep_form').innerHTML = '';
-// document.getElementById('rep_form').style.display = 'none';
- return false;
- }
- function checkDate(pObj) {
- var re = /^(3[01]|0[1-9]|[12]\d)\/(0[1-9]|1[012])\/\d{4}/;
- if (re.test(pObj.value)==false) {
- alert('" . _("Invalid date format") . "')
- }
- }
- </script>
- ";
- $st .= "<table align='center' width='80%' style='border:1px solid #cccccc;'><tr valign='top'>";
+ $st = "<table align='center' width='80%' style='border:1px solid #cccccc;'><tr valign='top'>";
$st .= "<td width='30%'>$st_classes</td>";
$st .= "<td width='35%' style='border-left:1px solid #cccccc;border-right:1px solid #cccccc;padding-left:3px;'>$st_reports</td>";
$st .= "<td width='35%'>$st_params</td>";
return $st;
}
- function getOptions($controls)
+ function getOptions($controls, $id = 0)
{
$st = '';
if ($controls == null)
if ($ctrl) break;
}
if ($ctrl == '') {
+ if (($id == 102 || $id == 202) && $cnt == 3) // set default Show Also Allocated to Yes in aged reports 2014-09-19 Joe Hunt
+ $_POST['PARAM_'.$cnt] = 1;
+
+ if (isset($_COOKIE['select'][$id][$cnt])) // saved parameters 2010-10-06 Joe Hunt
+ $_POST['PARAM_'.$cnt] = $_COOKIE['select'][$id][$cnt];
$ctrl = $this->get_ctrl('PARAM_'.$cnt, $type);
}
if ($ctrl != '') {
//
function get_ctrl($name, $type)
{
- global $path_to_root, $use_date_picker, $pdf_debug, $print_invoice_no, $def_print_destination;
+ global $path_to_root, $SysPrefs,
+ $type_shortcuts;
$st = '';
switch ($type)
case 'DATEENDM':
case 'DATEBEGINTAX':
case 'DATEENDTAX':
- if ($type == 'DATEBEGIN')
- $date = begin_fiscalyear();
- elseif ($type == 'DATEEND')
- $date = end_fiscalyear();
- else
- $date = Today();
- if ($type == 'DATEBEGINM')
- $date = begin_month($date);
- elseif ($type == 'DATEENDM')
- $date = end_month($date);
- elseif ($type == 'DATEBEGINTAX' || $type == 'DATEENDTAX')
+ if (!isset($_POST[$name]))
{
- $row = get_company_prefs();
- $edate = add_months($date, -$row['tax_last']);
- $edate = end_month($edate);
- if ($type == 'DATEENDTAX')
- $date = $edate;
+ if ($type == 'DATEBEGIN')
+ $date = begin_fiscalyear();
+ elseif ($type == 'DATEEND')
+ $date = end_fiscalyear();
else
+ $date = Today();
+ if ($type == 'DATEBEGINM')
+ $date = begin_month($date);
+ elseif ($type == 'DATEENDM')
+ $date = end_month($date);
+ elseif ($type == 'DATEBEGINTAX' || $type == 'DATEENDTAX')
{
- $bdate = begin_month($edate);
- $bdate = add_months($bdate, -$row['tax_prd'] + 1);
- $date = $bdate;
+ $row = get_company_prefs();
+ $edate = add_months($date, -$row['tax_last']);
+ $edate = end_month($edate);
+ if ($type == 'DATEENDTAX')
+ $date = $edate;
+ else
+ {
+ $bdate = begin_month($edate);
+ $bdate = add_months($bdate, -$row['tax_prd'] + 1);
+ $date = $bdate;
+ }
}
}
-
+ else // saved parameters
+ $date = $_POST[$name];
$st = "<input type='text' name='$name' value='$date'>";
- if ($use_date_picker)
+ if (user_use_date_picker())
+ {
+ $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='$path_to_root/themes/default/images/cal.gif' 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;
return yesno_list($name);
case 'PAYMENT_LINK':
- $sel = array(_("No payment Link"), "PayPal");
- return array_selector($name, null, $sel);
+ return payment_services($name, null);
case 'DESTINATION':
$sel = array(_("PDF/Printer"), "Excel");
$def = 0;
- if (isset($def_print_destination) && $def_print_destination == 1)
+ if (user_def_print_destination() == 1)
+ $def = 1;
+ return array_selector($name, $def, $sel);
+
+ case 'ORIENTATION':
+ $sel = array(_("Portrait"), _("Landscape"));
+ $def = 0;
+ if (user_def_print_orientation() == 1)
$def = 1;
return array_selector($name, $def, $sel);
return "<input type='text' name='$name'>";
case 'TEXTBOX':
- return "<textarea rows=4 cols=30 name='$name'></textarea>";
+ $value = (isset($_POST[$name]) ? $_POST[$name] : "");
+ return "<textarea rows=4 cols=30 maxlength=130 name='$name'>$value</textarea>";
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
case 'CUSTOMERS':
$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"));
+ return customer_list($name, null, _("No Customer Filter"));
else
- return combo_input($name, '', $sql, 'debtor_no', 'name', null);
-// return customer_list($name);
+ return customer_list($name);
case 'SUPPLIERS_NO_FILTER':
case 'SUPPLIERS':
$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"));
+ return supplier_list($name, null, _("No Supplier Filter"));
else
- return combo_input($name, '', $sql, 'supplier_id', 'supp_name', null);
-// return supplier_list($name);
+ return supplier_list($name);
case 'INVOICE':
- $IV = _("IV");
- $CN = _("CN");
- $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";
+ $IV = $type_shortcuts[ST_SALESINVOICE];
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
+ $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
+ concat('$IV ', debtor_trans.$ref,' ', debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."debtor_trans debtor_trans
+ WHERE type=".ST_SALESINVOICE." AND debtor.debtor_no=debtor_trans.debtor_no
+ ORDER BY debtor_trans.trans_no DESC";
+ return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
+
+ case 'CREDIT':
+ $CN = $type_shortcuts[ST_CUSTCREDIT];
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
+ $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
+ concat('$CN ', debtor_trans.$ref,' ', debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."debtor_trans debtor_trans
+ WHERE type=".ST_CUSTCREDIT." AND debtor.debtor_no=debtor_trans.debtor_no
+ ORDER BY 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";
+ $DN = $type_shortcuts[ST_CUSTDELIVERY];
+ $sql = "SELECT concat(debtor_trans.trans_no, '-', debtor_trans.type) AS TNO,
+ concat(debtor_trans.trans_no, ' $DN ', debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."debtor_trans debtor_trans
+ WHERE type=".ST_CUSTDELIVERY." AND debtor.debtor_no=debtor_trans.debtor_no
+ ORDER BY debtor_trans.trans_no DESC";
return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
case 'ORDERS':
- $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";
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
+ $sql = "SELECT sorder.order_no, concat(sorder.$ref, '-', debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."sales_orders sorder
+ WHERE debtor.debtor_no=sorder.debtor_no AND sorder.trans_type=".ST_SALESORDER
+ ." ORDER BY sorder.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";
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
+ $sql = "SELECT sorder.order_no, concat(sorder.$ref, '-', debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."sales_orders sorder
+ WHERE debtor.debtor_no=sorder.debtor_no AND sorder.trans_type=".ST_SALESQUOTE
+ ." ORDER BY sorder.order_no DESC";
return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
case 'PO':
- $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";
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "order_no" : "reference");
+ $sql = "SELECT po.order_no, concat(po.$ref, '-', supplier.supp_name) as IName
+ FROM ".TB_PREF."suppliers supplier,"
+ .TB_PREF."purch_orders po
+ WHERE supplier.supplier_id=po.supplier_id
+ ORDER BY po.order_no DESC";
return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
case 'REMITTANCE':
- $BP = _("BP");
- $SP = _("SP");
- $CN = _("CN");
- $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
- $sql = "SELECT concat(".TB_PREF."supp_trans.trans_no, '-',
- ".TB_PREF."supp_trans.type) AS TNO, concat(".TB_PREF."supp_trans.$ref, if (type=".ST_BANKPAYMENT.", ' $BP ', if (type=".ST_SUPPAYMENT.", ' $SP ', ' $CN ')), ".TB_PREF."suppliers.supp_name) as IName
- FROM ".TB_PREF."suppliers, ".TB_PREF."supp_trans WHERE (type=".ST_BANKPAYMENT." OR type=".ST_SUPPAYMENT." OR type=".ST_SUPPCREDIT.") AND ".TB_PREF."suppliers.supplier_id=".TB_PREF."supp_trans.supplier_id ORDER BY ".TB_PREF."supp_trans.trans_no DESC";
+ $BP = $type_shortcuts[ST_BANKPAYMENT];
+ $SP = $type_shortcuts[ST_SUPPAYMENT];
+ $CN = $type_shortcuts[ST_SUPPCREDIT];
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
+ $sql = "SELECT concat(trans.trans_no, '-',trans.type) AS TNO,
+ concat(trans.$ref, IF(type=".ST_BANKPAYMENT.", ' $BP ', IF(type=".ST_SUPPAYMENT.", ' $SP ', ' $CN ')), supplier.supp_name) as IName
+ FROM ".TB_PREF."suppliers supplier, "
+ .TB_PREF."supp_trans trans
+ WHERE type IN(".ST_BANKPAYMENT.",".ST_SUPPAYMENT.",".ST_SUPPCREDIT.")
+ AND supplier.supplier_id=trans.supplier_id
+ ORDER BY trans.trans_no DESC";
return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
case 'RECEIPT':
- $BD = _("BD");
- $CP = _("CP");
- $CN = _("CN");
- $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_BANKDEPOSIT.", ' $BD ', if (type=".ST_CUSTPAYMENT.", ' $CP ', ' $CN ')), ".TB_PREF."debtors_master.name) as IName
- FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE (type=".ST_BANKDEPOSIT." OR type=".ST_CUSTPAYMENT." 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";
+ $BD = $type_shortcuts[ST_BANKDEPOSIT];
+ $CP = $type_shortcuts[ST_CUSTPAYMENT];
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
+ $sql = "SELECT concat(trans.trans_no, '-', trans.type) AS TNO,
+ concat(trans.$ref, IF(type=".ST_BANKDEPOSIT.", ' $BD ', ' $CP '), debtor.name) as IName
+ FROM ".TB_PREF."debtors_master debtor,"
+ .TB_PREF."debtor_trans trans
+ WHERE type IN(".ST_BANKDEPOSIT.",".ST_CUSTPAYMENT.",".ST_CUSTCREDIT.") AND debtor.debtor_no=trans.debtor_no
+ ORDER BY trans.trans_no DESC";
return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
case 'ITEMS':
return stock_manufactured_items_list($name);
+ case 'ITEMS_ALL':
+ return stock_manufactured_items_list($name, null, true);
+
+ case 'ITEMS_P':
+ return stock_purchasable_items_list($name, null, true);
+
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";
+ $sql = "SELECT wo.id, concat(wo.id, '-', item.description) as IName
+ FROM ".TB_PREF."stock_master item,"
+ .TB_PREF."workorders wo
+ WHERE item.stock_id=wo.stock_id
+ ORDER BY wo.id DESC";
return combo_input($name, '', $sql, 'id', 'IName',array('order'=>false));
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);
$tag_type = TAG_ACCOUNT;
else
$tag_type = TAG_DIMENSION;
- return tag_list($name, 5, $tag_type, true, _("No tags"));
+ return tag_list($name, 5, $tag_type, true);
}
return '';
)
);
}
-
+/*
+ Add extension/custom reports to report manager.
+*/
function add_custom_reports(&$reports)
{
- global $installed_extensions, $path_to_root, $comp_path;
+ global $installed_extensions, $path_to_root;
// include reports installed inside extension modules
if (count($installed_extensions) > 0)
{
$extensions = $installed_extensions;
foreach ($extensions as $ext)
- if (($ext['active'] && $ext['type'] == 'module')) {
+ if (($ext['active'] && $ext['type'] == 'extension')) {
$file = $path_to_root.'/'.$ext['path']."/reporting/reports_custom.php";
- if (file_exists($file))
+ if (file_exists($file)) {
+ set_ext_domain($ext['path']);
include_once($file);
+ set_ext_domain();
+ }
}
}
- $file = $comp_path.'/'.user_company()."/reporting/reports_custom.php";
+ $file = company_path()."/reporting/reports_custom.php";
if (file_exists($file))
include_once($file);
}
-?>
\ No newline at end of file