X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep701.php;h=d03942ffadbbf9b01c45c0b363da760c1375f941;hb=a8b5d60413ff06dd098b58ae6119f085d3c9ea8b;hp=b4f54c9603ea093ed7716cd2ea0151fbc4505270;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/reporting/rep701.php b/reporting/rep701.php index b4f54c96..d03942ff 100644 --- a/reporting/rep701.php +++ b/reporting/rep701.php @@ -25,7 +25,7 @@ include_once($path_to_root . "/gl/includes/gl_db.inc"); //---------------------------------------------------------------------------------------------------- -function display_type ($type, $typename, &$dec, &$rep, $showbalance) +function display_type ($type, $typename, &$dec, &$rep, $showbalance, $level) { $printtitle = 0; //Flag for printing type name @@ -36,12 +36,15 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance) //Print Type Title if it has atleast one non-zero account if (!$printtitle) { + $prefix = ''; + for ($sp=1; $sp<=$level; $sp++) + { + $prefix .= ' '; + } $printtitle = 1; $rep->row -= 4; - $rep->Font('bold'); $rep->TextCol(0, 1, $type); - $rep->TextCol(1, 4, $typename); - $rep->Font(); + $rep->TextCol(1, 4, $prefix.$typename); $rep->row -= 4; $rep->Line($rep->row); $rep->NewLine(); @@ -54,7 +57,7 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance) $balance = get_gl_trans_from_to($begin, ToDay(), $account["account_code"], 0); } $rep->TextCol(0, 1, $account['account_code']); - $rep->TextCol(1, 2, $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); @@ -76,8 +79,8 @@ function display_type ($type, $typename, &$dec, &$rep, $showbalance) $rep->Line($rep->row); $rep->NewLine(); } - - display_type($accounttype["id"], $accounttype["name"], $dec, $rep, $showbalance); + $nextlevel = $level + 1; + display_type($accounttype["id"], $accounttype["name"].' ('.$typename.')', $dec, $rep, $showbalance, $nextlevel); } } @@ -93,12 +96,14 @@ 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"); + $orientation = ($orientation ? 'L' : 'P'); $dec = 0; $cols = array(0, 50, 300, 425, 500); @@ -109,7 +114,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); @@ -128,7 +135,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); + display_type($accounttype["id"], $accounttype["name"], $dec, $rep, $showbalance, 0); } $rep->NewLine(); }