X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Finquiry%2Fprofit_loss.php;h=f4a73e129b3147cc4076a14550264a9a71d5a620;hb=f821f29324e963437132a3f6fa7c57fcef5c5f0e;hp=1e236159a2f8172bf0b447f36d084e096817db75;hpb=5b8f4c4b4aa8cf996bc071f116bfce1273200fa2;p=fa-stable.git
diff --git a/gl/inquiry/profit_loss.php b/gl/inquiry/profit_loss.php
index 1e236159..f4a73e12 100644
--- a/gl/inquiry/profit_loss.php
+++ b/gl/inquiry/profit_loss.php
@@ -164,12 +164,10 @@ function inquiry_controls()
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());
+ $_POST['TransFromDate'] = add_days(end_month($date), -user_transaction_days());
date_cells(_("From:"), 'TransFromDate');
date_cells(_("To:"), 'TransToDate');
- //Compare Combo
- global $sel;
$sel = array(_("Accumulated"), _("Period Y-1"), _("Budget"));
echo "
"._("Compare to").": | \n";
echo "";
@@ -184,13 +182,15 @@ function inquiry_controls()
end_table();
hidden('AccGrp');
+
+ return $sel[get_post('Compare')];
}
//----------------------------------------------------------------------------------------------------
-function display_profit_and_loss()
+function display_profit_and_loss($compare)
{
- global $path_to_root, $sel;
+ global $path_to_root;
if (!isset($_POST['Dimension']))
$_POST['Dimension'] = 0;
@@ -201,7 +201,6 @@ function display_profit_and_loss()
$from = $_POST['TransFromDate'];
$to = $_POST['TransToDate'];
- $compare = $_POST['Compare'];
if (isset($_POST["AccGrp"]) && (strlen($_POST['AccGrp']) > 0))
$drilldown = 1; // Deeper Level
@@ -229,12 +228,12 @@ function display_profit_and_loss()
div_start('pl_tbl');
- start_table(TABLESTYLE, "width=50%");
+ start_table(TABLESTYLE, "width='50%'");
$tableheader = " |
-
+
";
@@ -332,9 +331,9 @@ function display_profit_and_loss()
start_form();
-inquiry_controls();
+$sel = inquiry_controls();
-display_profit_and_loss();
+display_profit_and_loss($sel);
end_form();