<?
session_start();
include("../opendb.php");
include("../test.php");

?>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
	th{background-color:lightsteelblue;color:black}
	td{font-size:12}
.right{text-align:right};
</style>
<center>
<h3>SPARE ADJUSTMENT REPORT </H3>
<?
$re=mysqli_query($db,"select * from adjstock where brcode='$brcode' order by entrydate");
print "<table bgcolor='steelblue' cellspacing=1 cellpadding=2>";
print "<th>Ref No<th>Date <th>Part Code <th>Part Name <th>Rate <th>In QTY <th>Out QTY";
print "<th>Amount <th>Note";
$i=1;
$tinqty=0;
$toutqty=0;
$tamt=0;
while($row=mysqli_fetch_array($re))
{ 
 if($i%2==0)
  print "\n<tr bgcolor='aliceblue'>";
 else
  print "\n<tr bgcolor='white'>";
 print "\n<td>$row[refno]</td><td>".datetohtml($row[entrydate])."</td>";
 print "<td>$row[partcode]</td><td>$row[partname]</td>";
 print "<td align=right>$row[rate]</td><td align=right>$row[qty]</td>";
 print "<td align=right>$row[outqty]</td><td align=right>".putComa($row[gtot])."</td>";
 print "<td>$row[note]</td></tr>";
 $i++;
$tinqty+=$row[qty];
$toutqty+=$row[outqty];
$tamt+=$row[gtot];
}
?>
<tr bgcolor='lightsteelblue'><td colspan=5 align=center><b>Total</b></td>
<td align=right><?print number_format($tinqty,2,'.',',')?></td>
<td align=right><?print $toutqty?></td>
<td align=right><?print putComa($tamt)?></td>
<td>&nbsp;</td></tr>
</table>


