
<?php $this->load->view("common/header"); ?>
<div style="top:5px;" class="panel-tools open">
<button data-toggle="dropdown" class="btn btn-blue dropdown-toggle" onClick="window.print()">
<i class="fa fa-print"></i>
</button>
</div>

<style type="text/css">
th{
	text-align:center !important;
}
.report_view_th{
	color:#000 !important;
	text-align:center !important;	
}
body{
	background-color:#fff !important;
	font-size:12px;
	
}
p{
	margin:0;
}
.modal-body {
  padding: 2px 15px 15px;
  position: relative;
}
body .modal {
/* new custom width */
width: 750px;
/* must be half of the width, minus scrollbar on the left (30px) */
margin-left: -375px;
}
.print-table td, th{
	padding:3px;
	vertical-align:top !important;
}
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
</style>


<style type="text/css" media="print">

.print-table {
	/*page-break-before:avoid;
	page-break-after: avoid;*/
	/*page-break-inside: avoid;*/
	/*page-break-inside:avoid;*/
	width:100%;
	
}
.td_border_bottom_1{
	border-bottom:1px solid #666 !important;	
}
.td_border_bottom_2{
	border-bottom:4px double #666 !important;	
}
.td_border_top_1{
	border-top:1px double #666 !important;	
}
</style>
<!--https://css-tricks.com/almanac/properties/p/page-break/-->

<!--onLoad="window.print()-->


<body onLoad="window.print()" style="margin: 30px !important;">

     <?php //$this->load->view("common/report_header.php"); ?>
     <div class="row">
<div class="col-xs-12 text-center">

<h3>	<?php echo $warehouse_details['name']; ?></h3>

  <p style="font-size:10px;">
  <?php //print_r($warehouse_details);?>
  <?php echo $warehouse_details['address']; ?><br>
Hot	Line: <?php echo $warehouse_details['phone']; ?> 
<br>
<!--All Kinds Of Mobile Phones, Unloking, Software Updating Genuine Mobile Phone Accssories.-->
<?php /*?>&nbsp;&nbsp; Email: <?php echo $warehouse_details['email']; ?> <?php */?>
<br>


</p>
   </div><!--col-xs-12-->
</div><!--row-->


  <div class="row">
  <div class="col-xs-12">
<div class="col-xs-6">
<p>Supplier : <?php echo $grn_rtn_details['supp_company_name']; ?></p>
<p><?php echo $grn_rtn_details['supp_address']; ?><br>
</p>

</div>
<div class="col-xs-4 pull-right">
<p>INVOICE: GRN RETURN </p>
<p>Date: <?php echo display_date_time_format($grn_rtn_details['pur_rtn_datetime']); ?></p>
</div>
</div>
</div>

<div class="print-start">


  

<table class="print-table" width="100%">
<thead>
<tr class="report_view_th">
  <th colspan="7" class="col-xs-1 text-right">
  <span style="float:right;">Invoice No: <?php echo $grn_rtn_details['pur_rtn_reference_no']; ?></span>
  </th>
  </tr>
<tr class="report_view_th text-center">
<th class="col-xs-1" width="20px">No</th>
<th class="col-xs-2">Description</th>
<th class="col-xs-1">Code</th>
<th class="col-xs-1">Quantity</th>
<th class="col-xs-1">Unit Price</th>
<th class="col-xs-1">Discount</th> 
<th class="col-xs-2" align="center">Subtotal</th>
</tr>
</thead>
<tbody>
 <?php 
 $tmpcount=0;
  $sale_mod=new Sales_Model();
  foreach ($pur_rtn_item_list as $row)
 {
	 $tmpcount++;
 ?>  
<tr>
<td style="text-align:center; width:40px; vertical-align:middle;"><?php echo $tmpcount ?></td>
<td style="vertical-align:middle;">
  <?php echo $row['product_name']; ?> 
 (<?php echo $row['product_code']; ?>)
 <?php 
 $sn_list=$sale_mod->get_grn_return_serial_by_id($grn_rtn_details['pur_rtn_id'],$row['pur_rtn_itm_id']);
if(!empty($sn_list)){
echo "<br/> Serial No. ";
foreach ($sn_list as $sn) { 
echo "($sn->pris_number) , ";

}
}
?> 
  </td>
<td style="width: 80px; text-align:center; vertical-align:middle;"><?php echo $row['product_code']; ?></td>
<td style="width: 80px; text-align:center; vertical-align:middle;"><?php echo number_format($row['pur_rtn_itm_quantity'], 2, '.', ''); ?></td>
<td style="text-align:right; width:100px;"><?php echo number_format($row['unit_price'], 2, '.', ','); ?></td>

<td style="width: 100px; text-align:right; vertical-align:middle;"> (<?php echo $row['discount'] ?>) <?php echo number_format($row['discount_val'], 2, '.', ',') ?></td> <td style="text-align:right; width:120px;"><?php echo $row['gross_total']; ?></td>
</tr>
<?php }?>

<?php if ($grn_rtn_details['pur_rtn_inv_discount']){ ?>
<tr>
  <td style="text-align:right; padding-right:10px;" colspan="6">Order Discount</td>
  <td style="text-align:right; padding-right:10px;"><?php echo number_format($grn_rtn_details['sale_inv_discount_amount'], 2, '.', ',') ?></td>
</tr>
<?php }?>
<tr>
<td style="text-align:right; font-weight:bold;" colspan="6">Total Amount 
</td>
<td style="text-align:right; padding-right:10px; font-weight:bold; border-top:1px solid #000; border-bottom:4px double #000;"><?php echo number_format($grn_rtn_details['pur_rtn_inv_total'], 2, '.', ',') ?></td>
</tr>



</tbody>
</table>
</div>



                 
 <div class="row">
     <div class="col-xs-12">
     <p> &nbsp;&nbsp;&nbsp;&nbsp;    Note :  <?php echo $grn_rtn_details['pur_note'];?></p>
     </div>
 <br>
<br>

<div class="col-xs-12">
<div class="col-xs-4"> Prepared by <br>

<br>


</div> <!--col-xs-4-->



<div class="col-xs-3 pull-right">Customer<br>


<br>
</div> <!--col-xs-4-->
   </div><!--col-xs-12-->
                
     <?php $this->load->view("common/print_footer.php"); ?>   
    
</div><!--print-start-->   

 </body>



