X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep701.php;h=65211df69e36a05b8cb1c12b3a5ef23495efd6c3;hb=268a54dcfd08aff7113bc3afe8b784f36db2d0d4;hp=8a86114d75fcf8c9372944612ced55aa73e474fa;hpb=0345fa9bbe09a7b64b6afb094cdc9b2c95bd3763;p=fa-stable.git diff --git a/reporting/rep701.php b/reporting/rep701.php index 8a86114d..65211df6 100644 --- a/reporting/rep701.php +++ b/reporting/rep701.php @@ -25,10 +25,10 @@ include_once($path_to_root . "/gl/includes/gl_db.inc"); //---------------------------------------------------------------------------------------------------- -function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) +function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) { $printtitle = 0; //Flag for printing type name - + //Get Accounts directly under this group/type $result = get_gl_accounts(null, null, $type); while ($account=db_fetch($result)) @@ -36,15 +36,15 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) //Print Type Title if it has atleast one non-zero account if (!$printtitle) { - $prefix = ''; - for ($sp=1; $sp<=$level; $sp++) - { - $prefix .= ' '; - } + $prefix = ''; + for ($sp=1; $sp<=$level; $sp++) + { + $prefix .= ' '; + } $printtitle = 1; $rep->row -= 4; $rep->TextCol(0, 1, $type); - $rep->TextCol(1, 4, $prefix.$typename); + $rep->TextCol(1, 4, $prefix.$typename); $rep->row -= 4; $rep->Line($rep->row); $rep->NewLine(); @@ -57,13 +57,13 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) $balance = get_gl_trans_from_to($begin, ToDay(), $account["account_code"], 0); } $rep->TextCol(0, 1, $account['account_code']); - $rep->TextCol(1, 2, $prefix.$account['account_name']); + $rep->TextCol(1, 2, $prefix.$account['account_name']); $rep->TextCol(2, 3, $account['account_code2']); if ($showbalance == 1) $rep->AmountCol(3, 4, $balance, $dec); $rep->NewLine(); } - + //Get Account groups/types under this group/type $result = get_account_types(false, false, $type); while ($accounttype=db_fetch($result)) @@ -79,8 +79,8 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) $rep->Line($rep->row); $rep->NewLine(); } - $nextlevel = $level + 1; - display_type($accounttype["id"], $accounttype["name"].' ('.$typename.')', $dec, $rep, $showbalance, $nextlevel); + $nextlevel = $level + 1; + display_type($accounttype["id"], $accounttype["name"].' ('.$typename.')', $dec, $rep, $showbalance, $nextlevel); } } @@ -96,15 +96,16 @@ function print_Chart_of_Accounts() $showbalance = $_POST['PARAM_0']; $comments = $_POST['PARAM_1']; - $destination = $_POST['PARAM_2']; + $orientation = $_POST['PARAM_2']; + $destination = $_POST['PARAM_3']; if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else include_once($path_to_root . "/reporting/includes/pdf_report.inc"); - $dec = 0; + $orientation = ($orientation ? 'L' : 'P'); - $cols = array(0, 50, 300, 425, 500); + $cols = array(0, 60, 300, 425, 500); $headers = array(_('Account'), _('Account Name'), _('Account Code'), _('Balance')); @@ -112,7 +113,9 @@ function print_Chart_of_Accounts() $params = array(0 => $comments); - $rep = new FrontReport(_('Chart of Accounts'), "ChartOfAccounts", user_pagesize()); + $rep = new FrontReport(_('Chart of Accounts'), "ChartOfAccounts", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); @@ -131,7 +134,7 @@ function print_Chart_of_Accounts() $typeresult = get_account_types(false, $class['cid'], -1); while ($accounttype=db_fetch($typeresult)) { - display_type($accounttype["id"], $accounttype["name"], $dec, $rep, $showbalance, 0); + display_type($accounttype["id"], $accounttype["name"], $dec, $rep, $showbalance, 0); } $rep->NewLine(); } @@ -139,4 +142,3 @@ function print_Chart_of_Accounts() $rep->End(); } -?> \ No newline at end of file