Cleanup: removed all closing tags in php files.
[fa-stable.git] / gl / inquiry / profit_loss.php
index f7ba91767c1055bc9b1282c5f8830d58d90f76e1..1e236159a2f8172bf0b447f36d084e096817db75 100644 (file)
@@ -21,7 +21,7 @@ include_once($path_to_root . "/includes/data_checks.inc");
 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);
@@ -160,7 +160,12 @@ function inquiry_controls()
        $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
@@ -335,4 +340,3 @@ end_form();
 
 end_page();
 
-?>
\ No newline at end of file