Cleanup: removed all closing tags in php files.
[fa-stable.git] / gl / inquiry / profit_loss.php
index 3e7a26f4ff55a58b199df4970a62bc6c013a6fd8..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);
@@ -161,10 +161,10 @@ function inquiry_controls()
     start_table(TABLESTYLE_NOBORDER);
     
        $date = today();
-       if (!isset($_POST['TransFromDate']))
-               $_POST['TransFromDate'] = begin_month($date);
        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');
        
@@ -340,4 +340,3 @@ end_form();
 
 end_page();
 
-?>
\ No newline at end of file