<html>
<head>
<title>Stock Diary</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
 
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 14px;
}
h1 {
font-size: 20px;
vertical-align: top;
}

table{
      border-collapse: collapse;
}
table.pagehead {
  width: 100%;

}

table.pagehead td.bborder, th.bborder{

  border-bottom: 1px solid black;
   vertical-align: baseline;
}

table.pagehead th.bborder{
  border-bottom: 1px solid black;
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: baseline;

  }

table.pagehead td.rborder{
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: middle;
  width:100%;
  }


</style>
<style type='text/css'>
td{font-family:Arial; color:black; font-size:9pt;}
</style>
</head>
<body>
<!--    <div style="text-align: right;" class="google_header">Page <span class="google_pagenumber">1</span>
    of <span class="google_pagecount">1</span></div>-->
           <div align="center"><img src="images/shared/printimage.jpg"  align="center" valign="top" alt="Posics Technologies" width="220" height="60"/><br>
             <?php echo $companyinfo[0]->COMPANYNAME.', '.$companyinfo[0]->ADDRESS1.', '; ?><br>
               <?php echo $companyinfo[0]->ADDRESS2.', '.$companyinfo[0]->CITY.', '.$companyinfo[0]->REGION ; ?>
                    <br>
                    Phone: <?php echo $companyinfo[0]->PHONE1.', '.$companyinfo[0]->PHONE2.', Fax: '.$companyinfo[0]->FAX ?>
                    <br>
                     Email: <?php echo $companyinfo[0]->EMAIL.', Web: '.$companyinfo[0]->WEBSITE?>
<h3><u><big>Stock Diary</big></u></h3>
</div>
<table class="pagehead">
<tbody>
<tr>
<!--    <td width="70%"  class="bborder">-->
<!--           <div align="center"><img src="http://localhost/app2/images/shared/printlogo.jpg" alt="Posics Technologies" width="75" height="50" /><br>
                <h3><?php echo $companyinfo[0]->COMPANYNAME; ?></h3>
                <?php echo $companyinfo[0]->ADDRESS1.', '.$companyinfo[0]->ADDRESS2.', '.$companyinfo[0]->CITY.', '.$companyinfo[0]->REGION ; ?>
                    <br>
                    Phone: <?php echo $companyinfo[0]->PHONE1.', '.$companyinfo[0]->PHONE2.', Fax: '.$companyinfo[0]->FAX ?>
                    <br>
                    Email: <?php echo $companyinfo[0]->EMAIL.', Web: '.$companyinfo[0]->WEBSITE?>

</div>-->
<!--            </td>-->
    <td width="30%" align="right" class="bborder">
          Date: <?php echo date('d-m-Y', time()); ?><br>
               <br>
        </td>

</tr>
</tbody>
</table>

<?php
echo "<table class='pagehead' cellpadding='5px' frame = 'box'>";
echo "<tbody>";
echo "<thead><tr>
    <th width='15%' align='left' class='bborder'>Warehouse</th><th width='15%' align='center' class='bborder'>Reason</th><th width='15%' align='center' class='bborder'>Date </th><th width='15%' align='center' class='bborder'>Material</th><th width='15%' align='center' class='bborder'>Qty</th><th width='15%' align='center' class='bborder'>Unit price</th><th width='15%' align='center' class='bborder'>Total</th></tr></thead>";
$totallines=0;
$LINETOTAL=0;
$LINETOTAL1=0;
foreach ($stocklines as $value) {
$totallines=$totallines+1;
if($value->REASON==1)
{
    $reason = 'Purchase';
}
else if($value->REASON==2)
{
    $reason = 'Refund (in)';
}
else if($value->REASON==4)
{
    $reason = 'Movement (in)';
}
else if($value->REASON==5)
{
    $reason = 'Production';
}else if($value->REASON==-1)
{
    $reason = 'Sale';
}
else if($value->REASON==-2)
{
    $reason = 'Refund (out)';
}
else if($value->REASON==-3)
{
    $reason = 'Break (out)';
}
else if($value->REASON==-4)
{
    $reason = 'Movement (out)';
}else if($value->REASON==999)
{
    $reason = 'Request';
}
else if($value->REASON==1000)
{
    $reason = 'Crossing';
}

echo "
<tr>
<td class='rborder' align='left'>".$value->LOCATION."</td>
<td class='rborder' align='left'>".$reason."</td>
<td class='rborder' align='center'>".$value->DATENEW."</td>
 <td class='rborder' align='left'>".$value->PRODUCT."</td>
 <td class='rborder' align='center'>$value->UNITS  $value->UOM</td>

<td class='rborder' align='right'>".$this->formatslist->formatCurrencywithHash($value->PRICE)."</td>
 <td class='rborder' align='right'>".$this->formatslist->formatCurrencywithHash($value->TOTAL)."</td>
 </tr>";
$LINETOTAL = $LINETOTAL+($value->TOTAL);
}
while($totallines<24)
{
    $totallines =$totallines+1;
             echo "<tr>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
    <td class='rborder'>&nbsp;</td>
     <td class='rborder'>&nbsp;</td>
       </tr>
       ";
}
    echo "<tr>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
    <td class='bborder'></td>
     <td class='bborder'></td>
        </tr>";

echo "</tbody>";
echo "</table>";
?>
           <?php
    echo "<table align='right'>";
echo "<tbody>";

echo "
             <tr><td><big><b>Grand Total:".number_format($LINETOTAL, 2, '.', ',')."</b></big></td></tr>

    </tr> ";
  echo "</tbody>";
echo "</table>";
?>
    <br><br>
    <table class="pagehead" width="100%">
    <tr>
    <td width="50%">&nbsp;</td>
    <td width="40%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
    </tr>
    <tr>
      

    </table>
</body>

</html>