X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep705.php;h=58c58bec9be142a8fb4b0f0334e185e12ec3cbd1;hb=5a3cbfe6d2df1c8c32edcab8bf93e8a8432a15fc;hp=e035869f3cb4b1bfab44c0c20a3dc1df4c88d7e1;hpb=7fae690528df9b851fba309b71bf7c3b961c9dd9;p=fa-stable.git diff --git a/reporting/rep705.php b/reporting/rep705.php index e035869f..58c58bec 100644 --- a/reporting/rep705.php +++ b/reporting/rep705.php @@ -84,7 +84,7 @@ function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime $result = get_gl_accounts(null, null, $type); while ($account=db_fetch($result)) { - if ($tags != -1) + if ($tags != -1 && is_array($tags) && $tags[0] != false) { if (!is_record_in_tags($tags, TAG_ACCOUNT, $account['account_code'])) continue; @@ -136,7 +136,7 @@ function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime $rep->NewLine(); } - $totals_arr = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension, $dimension2); + $totals_arr = display_type($accounttype["id"], $accounttype["name"], $yr, $mo, $convert, $dec, $rep, $dimension, $dimension2, $tags); for ($i = 1; $i <= 12; $i++) { $total[$i] += $totals_arr[$i]; @@ -163,7 +163,7 @@ function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime function print_annual_expense_breakdown() { - global $path_to_root, $date_system; + global $path_to_root, $SysPrefs; $dim = get_company_pref('use_dimension'); $dimension = $dimension2 = 0; @@ -175,36 +175,37 @@ function print_annual_expense_breakdown() $dimension2 = $_POST['PARAM_2']; $tags = (isset($_POST['PARAM_3']) ? $_POST['PARAM_3'] : -1); $comments = $_POST['PARAM_4']; - $destination = $_POST['PARAM_5']; + $orientation = $_POST['PARAM_5']; + $destination = $_POST['PARAM_6']; } - else if ($dim == 1) + elseif ($dim == 1) { $year = $_POST['PARAM_0']; $dimension = $_POST['PARAM_1']; $tags = (isset($_POST['PARAM_2']) ? $_POST['PARAM_2'] : -1); $comments = $_POST['PARAM_3']; - $destination = $_POST['PARAM_4']; + $orientation = $_POST['PARAM_4']; + $destination = $_POST['PARAM_5']; } else { $year = $_POST['PARAM_0']; $tags = (isset($_POST['PARAM_1']) ? $_POST['PARAM_1'] : -1); $comments = $_POST['PARAM_2']; - $destination = $_POST['PARAM_3']; + $orientation = $_POST['PARAM_3']; + $destination = $_POST['PARAM_4']; } if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else include_once($path_to_root . "/reporting/includes/pdf_report.inc"); + $orientation = ($orientation ? 'L' : 'P'); $dec = 1; - //$pdec = user_percent_dec(); $cols = array(0, 40, 150, 180, 210, 240, 270, 300, 330, 360, 390, 420, 450, 480, 510); //------------0--1---2----3----4----5----6----7----8----10---11---12---13---14---15- - //$yr = date('Y'); - //$mo = date('m'): // from now $sql = "SELECT begin, end, YEAR(end) AS yr, MONTH(end) AS mo FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($year); $result = db_query($sql, "could not get fiscal year"); @@ -214,9 +215,9 @@ function print_annual_expense_breakdown() $yr = $row['yr']; $mo = $row['mo']; $da = 1; - if ($date_system == 1) + if ($SysPrefs->date_system == 1) list($yr, $mo, $da) = jalali_to_gregorian($yr, $mo, $da); - elseif ($date_system == 2) + elseif ($SysPrefs->date_system == 2) list($yr, $mo, $da) = islamic_to_gregorian($yr, $mo, $da); $per12 = strftime('%b',mktime(0,0,0,$mo,$da,$yr)); $per11 = strftime('%b',mktime(0,0,0,$mo-1,$da,$yr)); @@ -250,7 +251,7 @@ function print_annual_expense_breakdown() 5 => array('text' => _('Info'), 'from' => _('Amounts in thousands'), 'to' => '')); } - else if ($dim == 1) + elseif ($dim == 1) { $params = array( 0 => $comments, 1 => array('text' => _("Year"), @@ -271,7 +272,9 @@ function print_annual_expense_breakdown() 'to' => '')); } - $rep = new FrontReport(_('Annual Expense Breakdown'), "AnnualBreakDown", user_pagesize()); + $rep = new FrontReport(_('Annual Expense Breakdown'), "AnnualBreakDown", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); @@ -326,4 +329,3 @@ function print_annual_expense_breakdown() $rep->End(); } -?> \ No newline at end of file