- $prev = get_balance($account["account_code"], $dimension, $dimension2, $begin, $from, false, false);
- $curr = get_balance($account["account_code"], $dimension, $dimension2, $from, $to, true, true);
- $tot = get_balance($account["account_code"], $dimension, $dimension2, $begin, $to, false, true);
-
- if ($zero == 0 && !$prev['balance'] && !$curr['balance'] && !$tot['balance'])
- continue;
- $rep->TextCol(0, 1, $account['account_code']);
- $rep->TextCol(1, 2, $account['account_name']);
- if ($balances != 0)
- {
- if ($prev['balance'] >= 0.0)
- $rep->TextCol(2, 3, number_format2($prev['balance'], $dec));
- else
- $rep->TextCol(3, 4, number_format2(abs($prev['balance']), $dec));
- if ($curr['balance'] >= 0.0)
- $rep->TextCol(4, 5, number_format2($curr['balance'], $dec));
- else
- $rep->TextCol(5, 6, number_format2(abs($curr['balance']), $dec));
- if ($tot['balance'] >= 0.0)
- $rep->TextCol(6, 7, number_format2($tot['balance'], $dec));
- else
- $rep->TextCol(7, 8, number_format2(abs($tot['balance']), $dec));
- }
- else
- {
- $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));
- $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'];