<html>
<head>
<title><?php echo $title; ?></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-top: 1px solid black;
  border-bottom: 1px solid black;
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: baseline;

  }

table.pagehead td.rborder{
    border-bottom: 1px solid black;
  border-right: 1px solid black;
  border-left: 1px solid black;
  vertical-align: baseline;
  }


</style>

</head>
<body>

<table class="pagehead">
<tbody>
    <tr>
  <td width="50%" align="right"></td>  <td width="50%" align="right">&nbsp;&nbsp;Printed On: <?php echo $printdate. '&nbsp;' ; ?></td>
</tr>
<tr>
  <td width="50%" align="right"></td>  <td width="50%" align="right">&nbsp;&nbsp;Printed By: <?php echo $user; '&nbsp;';?></td>
</tr>
<tr>
            <td width="50%" class="bborder">
                <h1>Issue Slip</h1>
            </td>
            <td width="50%" align="right" class="bborder">
                <img src="images/shared/printlogo.jpg" alt="Posics Technologies" width="75" height="50" />
            </td>
</tr>
<tr>

    <?php
    if($grntype == 'po'){
    echo '<td width="50%">Movement:' . $grn . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reason: (IN) Purchase&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PO:'. $po[0]->PONUMBER . '</td>' ;
    echo '<td width="50%"></td>' ;
        }
        else{

            switch ($reason) {

                case '1':
        $movetype =  "(IN) Purchase";
        break;
     case '2':
         $movetype =  "(IN) Refund";
        break;
    case '4':
       $movetype =  "(IN) Movement";
        break;
case '5':
        $movetype =  "(IN) Production";
        break;
    case '-1':
        $movetype =  "(OUT) Sale";
        break;
     case '-2':
        $movetype = "(OUT) Refund";
        break;
    case '-3':
        $movetype =  "(OUT) Break";
        break;
      case '-4':
        $movetype =  "(OUT) Movement";
        break;
     case '1000':
        $movetype =  "(OUT) Crossing";
        break;

}

            echo '<td width="50%">Movement:' . $grn . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reason:'. $movetype . '</td>' ;
 echo '<td width="50%"></td>' ;
        }
    ?>
    </tr>




<tr>
           <td width="100%" align="left">


               Issued Date: <?php echo $grnlines[0]->DATEIN ; ?><br><br>

                <?php  if($po !=null){ echo 'Invoice No:'  . $po[0]->INVOICENUMBER.  '<br><br>' ;}?>



              Supplier: <?php if($grnlines[0]->SUPPLIER!=null){ echo $grnlines[0]->SUPPLIER ;} else if(($grnlines[0]->SUPPLIER==null)&&($supplier!=null)) {echo  $supplier[0]->NAME ; } ?><br><br>
               <?php if( $po !=''){ echo 'Notes: :'.  $po[0]->NOTES.'<br><br>' ;} ?>
           
        </td>


</tr>
</tbody>
</table>
    <br><br>
<?php
echo "<table class='pagehead'>";
echo "<tbody>";
echo "<thead><tr>
<th width='15%' align='left' class='bborder'>REF</th><th width='25%' align='left' class='bborder'>ITEM</th><th width='15%' align='left' class='bborder'>LOCATION</th><th width='20%' align='center' class='bborder'>QUANTITY</th><th width='15%' align='center' class='bborder'>UNIT PRICE</th><th width='15%' align='center' class='bborder'>LINE TOTAL</th></tr></thead>";
$totallines=0;
$LINETOTAL=0.0;
foreach ($grnlines as $value) {
$totallines=$totallines+1;
$type=0;
if($value->QUANTITY>0)
{
if($grntype == 'po'){
    echo "
<tr>
<td class='rborder' width='15%' align='left'>$value->REFERENCE</td>
<td class='rborder' width='50%' align='left'>$value->NAME</td>
     <td class='rborder' width='15%' align='left'>$value->LOCATION</td>
<td class='rborder' width='20%' align='center'>$value->QUANTITY $value->UOM</td>
 <td  class='rborder' width='15%' align='right'>".$this->formatslist->formatCurrencywithHash($value->PRICE)."</td>
 <td  class='rborder' align='right'>".$this->formatslist->formatCurrencywithHash($value->TOTAL)."</td>
 </tr>";

}

else{
echo "
<tr>
<td class='rborder' width='15%' align='left'>$value->REFERENCE</td>
<td class='rborder' width='35%' align='left'>$value->NAME</td>
     <td class='rborder' width='15%' align='left'>$value->LOCATION</td>
<td class='rborder' width='20%' align='center'>$value->QUANTITY $value->UOM</td>
 <td class='rborder' width='15%' align='right'>".$this->formatslist->formatCurrencywithHash($value->PRICE)."</td>
 <td class='rborder' align='right'>".$this->formatslist->formatCurrencywithHash($value->TOTAL)."</td>
</tr>";

}
$LINETOTAL = $LINETOTAL+($value->TOTAL);
}
}

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

echo "
             <tr><td><big><b>Grand Total:".$this->formatslist->formatCurrencywithHash($LINETOTAL)."</b></big></td></tr>

    </tr> ";
  echo "</tbody>";
echo "</table>";
?>
<br><br>

Approved By: <br><br>
Approved Date: <br>
</body>
</html>
