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);
$dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
- date_cells(_("From:"), 'TransFromDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+ $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
end_page();
-?>
\ No newline at end of file