$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'];
display_debit_or_credit_cells($prev['balance']);
display_debit_or_credit_cells($curr['balance']);
display_debit_or_credit_cells($tot['balance']);
+
}
else
{
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);
$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;
$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)
$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);