$rep->Header2($myrow, $branch, $sales_order, $baccount, $j);
$result = get_customer_trans_details($j, $i);
$SubTotal = 0;
while ($myrow2=db_fetch($result))
{
$rep->Header2($myrow, $branch, $sales_order, $baccount, $j);
$result = get_customer_trans_details($j, $i);
$SubTotal = 0;
while ($myrow2=db_fetch($result))
{