include_once($path_to_root . "/gl/includes/gl_db.inc");
$js = "";
-if ($use_date_picker)
+if (user_use_date_picker())
$js = get_js_date_picker();
page(_($help_context = "Profit & Loss Drilldown"), false, false, "", $js);
$_POST["TransToDate"] = $_GET["TransToDate"];
if (isset($_GET["Compare"]))
$_POST["Compare"] = $_GET["Compare"];
+if (isset($_GET["Dimension"]))
+ $_POST["Dimension"] = $_GET["Dimension"];
+if (isset($_GET["Dimension2"]))
+ $_POST["Dimension2"] = $_GET["Dimension2"];
if (isset($_GET["AccGrp"]))
$_POST["AccGrp"] = $_GET["AccGrp"];
if ($drilldown && $levelptr == 0)
{
$url = "<a href='$path_to_root/gl/inquiry/gl_account_inquiry.php?TransFromDate="
- . $from . "&TransToDate=" . $to
+ . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
. "&account=" . $account['account_code'] . "'>" . $account['account_code']
." ". $account['account_name'] ."</a>";
//elseif ($drilldown && $type != $_POST["AccGrp"])
{
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
- . $from . "&TransToDate=" . $to . "&Compare=" . $compare
- . "&AccGrp=" . $type ."'>" . $typename ."</a>";
+ . $from . "&TransToDate=" . $to . "&Compare=" . $compare . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
+ . "&AccGrp=" . $type ."'>" . $type . " " . $typename ."</a>";
alt_table_row_color($k);
label_cell($url);
function inquiry_controls()
{
+ $dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
- date_cells(_("From:"), 'TransFromDate', '', null, -30);
+ $date = today();
+ if (!isset($_POST['TransToDate']))
+ $_POST['TransToDate'] = end_month($date);
+ if (!isset($_POST['TransFromDate']))
+ $_POST['TransFromDate'] = add_days(end_month($date), -$_SESSION["wa_current_user"]->prefs->transaction_days());
+ date_cells(_("From:"), 'TransFromDate');
date_cells(_("To:"), 'TransToDate');
//Compare Combo
echo "<td>";
echo array_selector('Compare', null, $sel);
echo "</td>\n";
+ if ($dim >= 1)
+ dimensions_list_cells(_("Dimension")." 1:", 'Dimension', null, true, " ", false, 1);
+ if ($dim > 1)
+ dimensions_list_cells(_("Dimension")." 2:", 'Dimension2', null, true, " ", false, 2);
submit_cells('Show',_("Show"),'','', 'default');
end_table();
{
global $path_to_root, $sel;
- $dim = get_company_pref('use_dimension');
- $dimension = $dimension2 = 0;
+ if (!isset($_POST['Dimension']))
+ $_POST['Dimension'] = 0;
+ if (!isset($_POST['Dimension2']))
+ $_POST['Dimension2'] = 0;
+ $dimension = $_POST['Dimension'];
+ $dimension2 = $_POST['Dimension2'];
$from = $_POST['TransFromDate'];
$to = $_POST['TransToDate'];
if ($TypeTotal[0] != 0 || $TypeTotal[1] != 0 )
{
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
- . $from . "&TransToDate=" . $to . "&Compare=" . $compare
- . "&AccGrp=" . $accounttype['id'] ."'>" . $accounttype['name'] ."</a>";
+ . $from . "&TransToDate=" . $to . "&Compare=" . $compare . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
+ . "&AccGrp=" . $accounttype['id'] ."'>" . $accounttype['id'] . " " . $accounttype['name'] ."</a>";
alt_table_row_color($k);
label_cell($url);
$convert = get_class_type_convert($class["ctype"]);
//Print Class Name
- table_section_title(get_account_type_name($_POST["AccGrp"]),4);
+ table_section_title($_POST["AccGrp"] . " " . get_account_type_name($_POST["AccGrp"]),4);
echo $tableheader;
$classtotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, $compare, $convert,
end_page();
-?>
\ No newline at end of file