{
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];
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]))
$acc = access_string($name);
$st_classes .= "<a href='"
.$_SERVER['PHP_SELF']."?Class=$class_id'"
- ." style='font-weight:". ($_REQUEST['Class'] == $class_id ? 'bold' : 'normal')."'"
+ ." 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==$_REQUEST['Class'] ? '' : "style='display:none'";
+ $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='repopts_link'"
- ." href='".$_SERVER['PHP_SELF']."?Class=$class_id&rep_id=$report->id'"
- ." style='font-weight:". (@$_GET['rep_id'] == $report->id ? 'bold' : 'normal')."'"
+ ." 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 (@$_REQUEST['rep_id'] == $report->id) {
+ if (@$_REQUEST['REP_ID'] == $report->id) {
$Ajax->activate($id);
}
- if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) {
-
- $action = $path_to_root.'/reporting/prn_redirect.php';
-
+ 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 process') . hidden('REP_ID', $report->id, false).'<br><br>';
$st_params .= $this->getOptions($report->get_controls(), $report->id);
- $st_params .= "\n</form></td></tr></table>\n";
+ $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);
}
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 = $type_shortcuts[ST_SALESINVOICE];
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
- if ($fromcust == ALL_NUMERIC)
+ if ($fromcust == ALL_TEXT)
$cust = _('All');
else
$cust = get_customer_name($fromcust);
$grandtotal = array(0,0,0,0);
$sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master ";
- if ($fromcust != ALL_NUMERIC)
+ if ($fromcust != ALL_TEXT)
$sql .= "WHERE debtor_no=".db_escape($fromcust);
$sql .= " ORDER BY name";
$result = db_query($sql, "The customers could not be retrieved");
$pg = new graph();
}
- if ($fromcust == ALL_NUMERIC)
+ if ($fromcust == ALL_TEXT)
$from = _('All');
else
$from = get_customer_name($fromcust);
$total = array(0,0,0,0, 0);
$sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master";
- if ($fromcust != ALL_NUMERIC)
+ if ($fromcust != ALL_TEXT)
$sql .= " WHERE debtor_no=".db_escape($fromcust);
$sql .= " ORDER BY name";
$result = db_query($sql, "The customers could not be retrieved");
}
$sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, curr_code, curdate() AS tran_date FROM ".TB_PREF."debtors_master";
- if ($customer != ALL_NUMERIC)
+ if ($customer != ALL_TEXT)
$sql .= " WHERE debtor_no = ".db_escape($customer);
else
$sql .= " ORDER by name";
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
- if ($fromsupp == ALL_NUMERIC)
+ if ($fromsupp == ALL_TEXT)
$supp = _('All');
else
$supp = get_supplier_name($fromsupp);
$grandtotal = array(0,0,0,0);
$sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers";
- if ($fromsupp != ALL_NUMERIC)
+ if ($fromsupp != ALL_TEXT)
$sql .= " WHERE supplier_id=".db_escape($fromsupp);
$sql .= " ORDER BY supp_name";
$result = db_query($sql, "The customers could not be retrieved");
$pg = new graph();
}
- if ($fromsupp == ALL_NUMERIC)
+ if ($fromsupp == ALL_TEXT)
$from = _('All');
else
$from = get_supplier_name($fromsupp);
$pastdue2 = _('Over') . " " . $PastDueDays2 . " " . _('Days');
$sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers";
- if ($fromsupp != ALL_NUMERIC)
+ if ($fromsupp != ALL_TEXT)
$sql .= " WHERE supplier_id=".db_escape($fromsupp);
$sql .= " ORDER BY supp_name";
$result = db_query($sql, "The suppliers could not be retrieved");
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
- if ($fromsupp == ALL_NUMERIC)
+ if ($fromsupp == ALL_TEXT)
$from = _('All');
else
$from = get_supplier_name($fromsupp);
$sql = "SELECT supplier_id, supp_name AS name, curr_code, ".TB_PREF."payment_terms.terms FROM ".TB_PREF."suppliers, ".TB_PREF."payment_terms
WHERE ";
- if ($fromsupp != ALL_NUMERIC)
+ if ($fromsupp != ALL_TEXT)
$sql .= "supplier_id=".db_escape($fromsupp)." AND ";
$sql .= "".TB_PREF."suppliers.payment_terms = ".TB_PREF."payment_terms.terms_indicator
ORDER BY supp_name";
AND ".TB_PREF."grn_items.po_detail_item = ".TB_PREF."purch_order_details.po_detail_item
AND qty_recd-quantity_inv <>0 ";
- if ($fromsupp != ALL_NUMERIC)
+ if ($fromsupp != ALL_TEXT)
$sql .= "AND ".TB_PREF."grn_batch.supplier_id =".db_escape($fromsupp)." ";
$sql .= "ORDER BY ".TB_PREF."grn_batch.supplier_id,
".TB_PREF."grn_batch.id";
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
- if ($fromsupp == ALL_NUMERIC)
+ if ($fromsupp == ALL_TEXT)
$from = _('All');
else
$from = get_supplier_name($fromsupp);
else
$loc = get_location_name($location);
- if ($fromcust == ALL_NUMERIC)
+ if ($fromcust == ALL_TEXT)
$fromc = _('All');
else
$fromc = get_customer_name($fromcust);
$cols = array(0, 75, 175, 250, 300, 375, 450, 515);
$headers = array(_('Category'), _('Description'), _('Customer'), _('Qty'), _('Sales'), _('Cost'), _('Contribution'));
- if ($fromcust != ALL_NUMERIC)
+ if ($fromcust != ALL_TEXT)
$headers[2] = '';
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right');
$rep->NewLine();
$rep->fontSize -= 2;
$rep->TextCol(0, 1, $trans['stock_id']);
- if ($fromcust == ALL_NUMERIC)
+ if ($fromcust == ALL_TEXT)
{
$rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1);
$rep->TextCol(2, 3, $trans['debtor_name']);