X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=reporting%2Fincludes%2Freports_classes.inc;h=dd2e069f223ce9396a1852f5e226e52284aed02b;hb=7561718ee5113232ce917f63085d272884b0929c;hp=72be5bbf67c7fbf87140c386adce8f3fb00c7431;hpb=4a07578898a905fcbb526f25322f215d87163034;p=fa-stable.git
diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc
index 72be5bbf..dd2e069f 100644
--- a/reporting/includes/reports_classes.inc
+++ b/reporting/includes/reports_classes.inc
@@ -47,8 +47,12 @@ class BoxReports
function getDisplay($class=null)
{
- global $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];
@@ -59,6 +63,8 @@ class BoxReports
if (isset($_GET['Class']))
set_focus('class'.$_GET['Class']);
+ $cur_class = $_REQUEST['Class'];
+
foreach($this->ar_classes as $class_id => $name)
{
if (!isset($this->ar_reports[$class_id]))
@@ -67,36 +73,36 @@ class BoxReports
$acc = access_string($name);
$st_classes .= "$acc[0]
";
- $style = $class_id==$_REQUEST['Class'] ? '' : "style='display:none'";
+ $style = $class_id==$cur_class ? '' : "style='display:none'";
$st_reports .= "
\n";
set_focus('Rep'.$report->id);
$Ajax->addUpdate(true, 'rep_form', $st_params);
}
@@ -131,6 +137,9 @@ class BoxReports
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);
@@ -158,7 +167,8 @@ class BoxReports
//
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)
@@ -204,9 +214,13 @@ class BoxReports
else // saved parameters 2010-10-16 Joe Hunt
$date = $_POST[$name];
$st = "";
- 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 .= ""
- . "
\n";
+ . "
\n";
+ }
return $st;
break;
@@ -214,13 +228,19 @@ class BoxReports
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);
@@ -280,35 +300,36 @@ class BoxReports
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");
+ $IV = $type_shortcuts[ST_SALESINVOICE];
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
+ $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-',
+ ".TB_PREF."debtor_trans.type) AS TNO, concat('$IV ', ".TB_PREF."debtor_trans.$ref,' ', ".TB_PREF."debtors_master.name) as IName
+ FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE type=".ST_SALESINVOICE." 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 'CREDIT':
+ $CN = $type_shortcuts[ST_CUSTCREDIT];
+ $ref = ($SysPrefs->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";
+ ".TB_PREF."debtor_trans.type) AS TNO, concat('$CN ', ".TB_PREF."debtor_trans.$ref,' ', ".TB_PREF."debtors_master.name) as IName
+ FROM ".TB_PREF."debtors_master, ".TB_PREF."debtor_trans WHERE 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");
+ $DN = $type_shortcuts[ST_CUSTDELIVERY];
$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
@@ -318,7 +339,7 @@ class BoxReports
return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false));
case 'ORDERS':
- $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+ $ref = ($SysPrefs->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
@@ -326,7 +347,7 @@ class BoxReports
return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
case 'QUOTATIONS':
- $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+ $ref = ($SysPrefs->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
@@ -334,16 +355,16 @@ class BoxReports
return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
case 'PO':
- $ref = ($print_invoice_no == 1 ? "order_no" : "reference");
+ $ref = ($SysPrefs->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";
return combo_input($name, '', $sql, 'order_no', 'IName',array('order'=>false));
case 'REMITTANCE':
- $BP = _("BP");
- $SP = _("SP");
- $CN = _("CN");
+ $BP = $type_shortcuts[ST_BANKPAYMENT];
+ $SP = $type_shortcuts[ST_SUPPAYMENT];
+ $CN = $type_shortcuts[ST_SUPPCREDIT];
$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
@@ -351,18 +372,23 @@ class BoxReports
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");
+ $BD = $type_shortcuts[ST_BANKDEPOSIT];
+ $CP = $type_shortcuts[ST_CUSTPAYMENT];
+ $ref = ($SysPrefs->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
+ ".TB_PREF."debtor_trans.type) AS TNO, concat(".TB_PREF."debtor_trans.$ref, if (type=".ST_BANKDEPOSIT.", ' $BD ', ' $CP '), ".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";
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
@@ -474,4 +500,3 @@ function add_custom_reports(&$reports)
include_once($file);
}
-?>
\ No newline at end of file