}
function getDisplay()
{
- global $path_to_root;
+ global $comp_path, $path_to_root, $use_date_picker;
+
+ $rep_file = $comp_path.'/'.user_company().
+ "/reporting/rep".$this->id.".php";
+ if (!file_exists($rep_file))
+ $rep_file = $path_to_root ."/reporting/rep".$this->id.".php";
+
$st = "
<script language='javascript'>
function displayReport_" . $this->id . "() {
window.open('','REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
document.forms[0].target='REP_WINDOW';
- document.forms[0].action= '" . $path_to_root . "/reporting/rep" . $this->id . ".php';
+ document.forms[0].action= '$rep_file';
document.forms[0].submit();
}
function checkDate(pObj) {
if ($param->param_type == 'DATEBEGINM')
$date = begin_month($date);
elseif ($param->param_type == 'DATEENDM')
- $date = enc_month($date);
+ $date = end_month($date);
elseif ($param->param_type == 'DATEBEGINTAX' || $param->param_type == 'DATEENDTAX')
{
$row = get_company_prefs();
$edate = add_months($date, -$row['tax_last']);
- $edate = enc_month($edate);
+ $edate = end_month($edate);
if ($param->param_type == 'DATEENDTAX')
$date = $edate;
else
$date = begin_month($bdate);
}
}
- //$st .= "<input type='text' name='RP_" . $this->id . "_$index' value='$date' onblur='javascript:checkDate(this)'>";
- $st .= "<input type='text' name='RP_" . $this->id . "_$index' value='$date'>";
+ $name = "RP_" . $this->id . "_$index";
+ //$st .= "<input type='text' name='$name' value='$date' onblur='javascript:checkDate(this)'>";
+ $st .= "<input type='text' name='$name' value='$date'>";
+ if ($use_date_picker)
+ $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";
+
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);
+ break;
case 'COMPARE':
$sel = array(_("Accumulated"), _("Period Y-1"), _("Budget"));
$st .= dup_simple_name_list("RP_" . $this->id . "_$index", $sel);
break;
case 'CUSTOMERS_NO_FILTER':
case 'CUSTOMERS':
- $sql = "SELECT debtor_no, name FROM ".TB_PREF."debtors_master ORDER BY debtor_no";
+ $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;
+ case 'SUPPLIERS_NO_FILTER':
case 'SUPPLIERS':
- $sql = "SELECT supplier_id, supp_name FROM ".TB_PREF."suppliers ORDER BY supplier_id";
- $st .= dup_simple_codeandname_list($sql, "RP_" . $this->id . "_$index", $dummy);
+ $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;
case 'INVOICE':
$IV = _("IV");
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;
+ 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=13 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;
case 'ORDERS':
$sql = "SELECT ".TB_PREF."sales_orders.order_no, concat(".TB_PREF."sales_orders.order_no, '-',
".TB_PREF."debtors_master.name) as IName