X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Freports_classes.inc;h=2d39aca4df2d6340e7d53456425db6671d5d65e9;hb=884c36eec7dbaae89e1f5532cc2c2f8033b010fd;hp=cffe6cb3e793f6fab0f85100fb0a51bcf7171fc0;hpb=55c51a9db64c9fe402d615e204824f8e4cd6a310;p=fa-stable.git diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index cffe6cb3..2d39aca4 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -82,7 +82,7 @@ class BoxReports $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()); + $st_params .= $this->getOptions($report->get_controls(), $report->id); $st_params .= "\n\n"; set_focus('Rep'.$report->id); $Ajax->addUpdate(true, 'rep_form', $st_params); @@ -124,7 +124,7 @@ class BoxReports return $st; } - function getOptions($controls) + function getOptions($controls, $id = 0) { $st = ''; if ($controls == null) @@ -139,6 +139,8 @@ class BoxReports if ($ctrl) break; } if ($ctrl == '') { + 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 != '') { @@ -180,31 +182,35 @@ class BoxReports 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 2010-10-16 Joe Hunt + $date = $_POST[$name]; $st = ""; if ($use_date_picker) $st .= "" @@ -245,7 +251,8 @@ class BoxReports return ""; case 'TEXTBOX': - return ""; + $value = (isset($_POST[$name]) ? $_POST[$name] : ""); + return ""; case 'ACCOUNTS': // not used return gl_account_types_list($name, null, _("No Account Group Filter"), true); @@ -463,8 +470,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";