X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Freports_classes.inc;h=92e5a9eb70b34f7292689a5c56e939f4d737bf93;hb=7e830126b96477e969fe3b48d9fc0e78f6c1fe00;hp=dd0bc82bfeaa0341800f966086bda7701825b9cd;hpb=6b724fc86f632fd277f7fbc330cd748fc019afd3;p=fa-stable.git diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index dd0bc82b..92e5a9eb 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -49,41 +49,60 @@ class BoxReports { global $path_to_root, $pdf_debug, $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]; $st_reports = ""; $st_params = ""; $st_classes = "" . _("Report Classes:") . "
"; + + if (isset($_GET['Class'])) + set_focus('class'.$_GET['Class']); + + $cur_class = $_REQUEST['Class']; + foreach($this->ar_classes as $class_id => $name) { - $style = $class_id==$_REQUEST['Class'] ? '' : "style='display:none'"; -// $cname = access_string($key, true); -// $style = $_REQUEST['Class']==$cname ? '' : "style='display:none'"; + if (!isset($this->ar_reports[$class_id])) + continue; // e.g. no dimensions + $acc = access_string($name); $st_classes .= "$acc[0]
"; + ." style='font-weight:". ($cur_class == $class_id ? 'bold' : 'normal')."'" + ." class='repclass_link' id='".'class'.$class_id."'" + ."$acc[1]>$acc[0]
"; + + $style = $class_id==$cur_class ? '' : "style='display:none'"; $st_reports .= "\n"; foreach($this->ar_reports[$class_id] as $rep_id => $report) { $acc = access_string($report->name); - $st_reports .= "
" . _("Reports For Class: ") . " $name
id'" - ." id='".default_focus()."'" + $st_reports .= "
id'" + ." style='font-weight:". (@$_REQUEST['REP_ID'] == $report->id ? 'bold' : 'normal')."'" + ." 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'; - + 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 = "
\n" . "
\n"; $st_params .= submit('Rep'.$report->id, _("Display: ") . access_string($report->name, true), false, '', $pdf_debug ? false : 'default process') . hidden('REP_ID', $report->id, false).'

'; $st_params .= $this->getOptions($report->get_controls(), $report->id); - $st_params .= "\n
\n"; + $st_params .= "\n" + ."\n
\n"; set_focus('Rep'.$report->id); $Ajax->addUpdate(true, 'rep_form', $st_params); } @@ -94,28 +113,7 @@ class BoxReports $st_params = "
". "$st_params
"; - - $st = " - "; - $st .= ""; + $st = "
"; $st .= ""; $st .= ""; $st .= ""; @@ -166,7 +164,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, $use_date_picker, $pdf_debug, $print_invoice_no, + $def_print_destination, $type_shortcuts; $st = ''; switch ($type) @@ -222,8 +221,7 @@ 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"); @@ -288,35 +286,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"); + $IV = $type_shortcuts[ST_SALESINVOICE]; $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"; + ".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 = ($print_invoice_no == 1 ? "trans_no" : "reference"); + $sql = "SELECT concat(".TB_PREF."debtor_trans.trans_no, '-', + ".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 @@ -349,9 +348,9 @@ class BoxReports 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 @@ -359,12 +358,11 @@ class BoxReports return combo_input($name, '', $sql, 'TNO', 'IName',array('order'=>false)); case 'RECEIPT': - $BD = _("BD"); - $CP = _("CP"); - $CN = _("CN"); + $BD = $type_shortcuts[ST_BANKDEPOSIT]; + $CP = $type_shortcuts[ST_CUSTPAYMENT]; $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 + ".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)); @@ -470,8 +468,11 @@ function add_custom_reports(&$reports) foreach ($extensions as $ext) 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 = company_path()."/reporting/reports_custom.php";
$st_classes$st_reports$st_params