X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=gl%2Finquiry%2Fprofit_loss.php;h=1543bddc1ba102842f8f071865bf58660b0e72b0;hb=f0f7b444137a81aa1a227cbb041f3d7d7eaa1715;hp=f7ba91767c1055bc9b1282c5f8830d58d90f76e1;hpb=53d942f2a0d20cce5e9c409c6485867ce0869e4d;p=fa-stable.git diff --git a/gl/inquiry/profit_loss.php b/gl/inquiry/profit_loss.php index f7ba9176..1543bddc 100644 --- a/gl/inquiry/profit_loss.php +++ b/gl/inquiry/profit_loss.php @@ -21,11 +21,16 @@ 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); +$compare_types = array( + _("Accumulated"), + _("Period Y-1"), + _("Budget") +); //---------------------------------------------------------------------------------------------------- // Ajax updates @@ -50,7 +55,7 @@ if (isset($_GET["AccGrp"])) //---------------------------------------------------------------------------------------------------- function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $convert, - &$dec, &$pdec, &$rep, $dimension=0, $dimension2=0, $drilldown, $path_to_root) + $dimension=0, $dimension2=0, $drilldown, $path_to_root) { global $levelptr, $k; @@ -63,7 +68,7 @@ function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $co //Get Accounts directly under this group/type $result = get_gl_accounts(null, null, $type); - + while ($account=db_fetch($result)) { $per_balance = get_gl_trans_from_to($from, $to, $account["account_code"], $dimension, $dimension2); @@ -101,7 +106,7 @@ function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $co while ($accounttype=db_fetch($result)) { $totals_arr = display_type($accounttype["id"], $accounttype["name"], $from, $to, $begin, $end, - $compare, $convert, $dec, $pdec, $rep, $dimension, $dimension2, $drilldown, $path_to_root); + $compare, $convert, $dimension, $dimension2, $drilldown, $path_to_root); $per_balance_total += $totals_arr[0]; $acc_balance_total += $totals_arr[1]; } @@ -157,19 +162,24 @@ function Achieve($d1, $d2) function inquiry_controls() { + global $compare_types; + $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), -user_transaction_days()); + date_cells(_("From:"), 'TransFromDate'); date_cells(_("To:"), 'TransToDate'); - //Compare Combo - global $sel; - $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget")); echo "