From: Joe Hunt Date: Mon, 10 Nov 2008 22:35:53 +0000 (+0000) Subject: [0000081] Trial Balance again minor changes. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=b479258c7b423beb542fd73ad0a10cacbe30fefa;p=textcart.git [0000081] Trial Balance again minor changes. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index deb6b82..f57c9db 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,11 @@ Legend: ! -> Note $ -> Affected files +10-Nov-2008 Joe Hunt +! [0000081] Trial Balance again minor changes. +$ /gl/inquiry/gl_trial_balance.php + /reporting/rep708.php + 07-Nov-2008 Joe Hunt ! [0000081] Changed Trial Balance to show all debits and credits (option to only show balances) $ /gl/inquiry/gl_trial_balance.php diff --git a/gl/inquiry/gl_trial_balance.php b/gl/inquiry/gl_trial_balance.php index 4f44d5b..8d1ad8b 100644 --- a/gl/inquiry/gl_trial_balance.php +++ b/gl/inquiry/gl_trial_balance.php @@ -97,7 +97,7 @@ function display_trial_balance() $k = 0; $accounts = get_gl_accounts(); - + $pdeb = $pcre = $cdeb = $ccre = $tdeb = $tcre = $pbal = $cbal = $tbal = 0; $begin = begin_fiscalyear(); if (date1_greater_date2($begin, $_POST['TransFromDate'])) $begin = $_POST['TransFromDate']; @@ -121,6 +121,7 @@ function display_trial_balance() display_debit_or_credit_cells($prev['balance']); display_debit_or_credit_cells($curr['balance']); display_debit_or_credit_cells($tot['balance']); + } else { @@ -130,30 +131,39 @@ function display_trial_balance() amount_cell($curr['credit']); amount_cell($tot['debit']); amount_cell($tot['credit']); + $pdeb += $prev['debit']; + $pcre += $prev['credit']; + $cdeb += $curr['debit']; + $ccre += $curr['credit']; + $tdeb += $tot['debit']; + $tcre += $tot['credit']; } + $pbal += $prev['balance']; + $cbal += $curr['balance']; + $tbal += $tot['balance']; end_row(); } - $prev = get_balance(null, $begin, $_POST['TransFromDate'], false, false); - $curr = get_balance(null, $_POST['TransFromDate'], $_POST['TransToDate'], true, true); - $tot = get_balance(null, $begin, $_POST['TransToDate'], false, true); + //$prev = get_balance(null, $begin, $_POST['TransFromDate'], false, false); + //$curr = get_balance(null, $_POST['TransFromDate'], $_POST['TransToDate'], true, true); + //$tot = get_balance(null, $begin, $_POST['TransToDate'], false, true); if (!check_value('Balance')) { start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Total") ." - ".$_POST['TransToDate'], "colspan=2"); - amount_cell($prev['debit']); - amount_cell($prev['credit']); - amount_cell($curr['debit']); - amount_cell($curr['credit']); - amount_cell($tot['debit']); - amount_cell($tot['credit']); + amount_cell($pdeb); + amount_cell($pcre); + amount_cell($cdeb); + amount_cell($ccre); + amount_cell($tdeb); + amount_cell($tcre); end_row(); } start_row("class='inquirybg' style='font-weight:bold'"); label_cell(_("Ending Balance") ." - ".$_POST['TransToDate'], "colspan=2"); - display_debit_or_credit_cells($prev['balance']); - display_debit_or_credit_cells($curr['balance']); - display_debit_or_credit_cells($tot['balance']); + display_debit_or_credit_cells($pbal); + display_debit_or_credit_cells($cbal); + display_debit_or_credit_cells($tbal); end_row(); end_table(1); diff --git a/reporting/rep708.php b/reporting/rep708.php index 2c8ebb3..5102a43 100644 --- a/reporting/rep708.php +++ b/reporting/rep708.php @@ -125,6 +125,7 @@ function print_trial_balance() $accounts = get_gl_accounts(); + $pdeb = $pcre = $cdeb = $ccre = $tdeb = $tcre = $pbal = $cbal = $tbal = 0; $begin = begin_fiscalyear(); if (date1_greater_date2($begin, $from)) $begin = $from; @@ -162,7 +163,17 @@ function print_trial_balance() $rep->TextCol(5, 6, number_format2($curr['credit'], $dec)); $rep->TextCol(6, 7, number_format2($tot['debit'], $dec)); $rep->TextCol(7, 8, number_format2($tot['credit'], $dec)); + $pdeb += $prev['debit']; + $pcre += $prev['credit']; + $cdeb += $curr['debit']; + $ccre += $curr['credit']; + $tdeb += $tot['debit']; + $tcre += $tot['credit']; + } + $pbal += $prev['balance']; + $cbal += $curr['balance']; + $tbal += $tot['balance']; $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) @@ -175,35 +186,35 @@ function print_trial_balance() $rep->NewLine(); $rep->Font('bold'); - $prev = get_balance(null, $dimension, $dimension2, $begin, $from, false, false); - $curr = get_balance(null, $dimension, $dimension2, $from, $to, true, true); - $tot = get_balance(null, $dimension, $dimension2, $begin, $to, false, true); + //$prev = get_balance(null, $dimension, $dimension2, $begin, $from, false, false); + //$curr = get_balance(null, $dimension, $dimension2, $from, $to, true, true); + //$tot = get_balance(null, $dimension, $dimension2, $begin, $to, false, true); if ($balances == 0) { $rep->TextCol(0, 2, _("Total")); - $rep->TextCol(2, 3, number_format2($prev['debit'], $dec)); - $rep->TextCol(3, 4, number_format2($prev['credit'], $dec)); - $rep->TextCol(4, 5, number_format2($curr['debit'], $dec)); - $rep->TextCol(5, 6, number_format2($curr['credit'], $dec)); - $rep->TextCol(6, 7, number_format2($tot['debit'], $dec)); - $rep->TextCol(7, 8, number_format2($tot['credit'], $dec)); + $rep->TextCol(2, 3, number_format2($pdeb, $dec)); + $rep->TextCol(3, 4, number_format2($pcre, $dec)); + $rep->TextCol(4, 5, number_format2($cdeb, $dec)); + $rep->TextCol(5, 6, number_format2($ccre, $dec)); + $rep->TextCol(6, 7, number_format2($tdeb, $dec)); + $rep->TextCol(7, 8, number_format2($tcre, $dec)); $rep->NewLine(); } $rep->TextCol(0, 2, _("Ending Balance")); if ($prev['balance'] >= 0.0) - $rep->TextCol(2, 3, number_format2($prev['balance'], $dec)); + $rep->TextCol(2, 3, number_format2($pbal, $dec)); else - $rep->TextCol(3, 4, number_format2(abs($prev['balance']), $dec)); + $rep->TextCol(3, 4, number_format2(abs($pbal), $dec)); if ($curr['balance'] >= 0.0) - $rep->TextCol(4, 5, number_format2($curr['balance'], $dec)); + $rep->TextCol(4, 5, number_format2($cbal, $dec)); else - $rep->TextCol(5, 6, number_format2(abs($curr['balance']), $dec)); + $rep->TextCol(5, 6, number_format2(abs($cbal), $dec)); if ($tot['balance'] >= 0.0) - $rep->TextCol(6, 7, number_format2($tot['balance'], $dec)); + $rep->TextCol(6, 7, number_format2($tbal, $dec)); else - $rep->TextCol(7, 8, number_format2(abs($tot['balance']), $dec)); + $rep->TextCol(7, 8, number_format2(abs($tbal), $dec)); $rep->Line($rep->row - 6);