
<?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:1px;
	vertical-align:top !important;
}
thead { display: table-header-group; }
tfoot { display: table-footer-group; }
.width_cus{
	width:100px !important;
}
.width_qty{
	width:100px !important;
}
</style>



<!--https://css-tricks.com/almanac/properties/p/page-break/-->

<!--onLoad="window.print()-->
<body onLoad="window.print()">
<div class="row">
  <div class="col-xs-12">
  <h3 class="center" style="font-family:'Times New Roman', Times, serif; margin-bottom:3px; letter-spacing:2px;">
 <?php echo $sm_or_det['name'] ?></h3>
 	<!-- --><p class="center">
 	 <?php echo $sm_or_det['address'] ?></p>
   <!-- --><p class="center">
	<?php echo $sm_or_det['phone'];?></p>
    <p class="center">
	<?php echo $sm_or_det['email'];?></p>

    <h5 class="center" style="font-family:'Times New Roman', Times, serif; margin-bottom:3px; letter-spacing:2px;">Customer Bill</h5>
   
<div class="col-xs-6">
<!--<p>Warehouse Name : <?php echo $sm_or_det['name'];?></p>
-->
<p>Reference No : <?php echo $sm_or_det['lot_ref_no'];?></p>

<p>Customer : <?php echo $customer_info['cus_name'];?></p>

<p>Address : <?php echo $customer_info['cus_address'];?></p>

<p>Date : <?php echo $sm_or_det['lot_order_date'];?></p>

<p>Rep Name : <?php echo $sm_or_det['user_first_name']?></p>

<br>
 
</div>
<div class="col-xs-6 pull-right" style="padding-left:160px;">


</div>
</div>
</div>

<div class="print-start">  

<table class="print-table" width="100%" style="border:1px solid #000">
<thead>

<tr class="report_view_th text-center"  style="border:1px solid #000">
<th style="border:1px solid #000; width:40px;" class='width_cus'>No</th>
<th class="col-xs-7" style="border:1px solid #000">Item Code</th>

<th class="width_qty" style="border:1px solid #000";>Quantity</th>
<th class="width_qty" style="border:1px solid #000";>Subtotal</th>
</tr>
</thead>
<tbody>
 
 <?php  
 $tmpcount=0;
 $tot_qty=0;
  $gt = 0;
  foreach ($lot_order_items_details as $row)
 {
	 $tmpcount++;
	 $gt += $row['product_price']*$row['issue_qty'];
	 $tot_qty=$tot_qty+$row['order_qty'];
	 $add_sales_excess_price=$row['add_sales_excess_price'];
	$add_sales_discount_price=$row['add_sales_discount_price'];
	$product_price=$row['product_price'];
	$salse_rep_issue_qty=$row['order_qty'];
	$sub_total=(($add_sales_excess_price+$product_price)*$salse_rep_issue_qty)-$add_sales_discount_price;
 ?>  
<tr>
<td style="text-align:center; vertical-align:middle; border:1px solid #000;"><?php echo $tmpcount ?></td>
<td  style="border:1px solid #000">
 <?php echo $row['product_name']."(".$row['product_code'].")"; ?> </td>
	<td style="text-align:center; vertical-align:middle; border:1px solid #000;"><strong><?php echo number_format($row['issue_qty'], 0, '.', ','); ?></strong></td>
   	<td style="text-align:center; vertical-align:middle; border:1px solid #000;"><strong><?php echo number_format($row['product_price']*$row['issue_qty'], 2, '.', ','); ?></strong></td>
<?php /*?><td style="text-align:right; width:100px; border:1px solid #000;"><?php echo number_format($product_price+$add_sales_excess_price, 2, '.', ','); ?></td><?php */?>
</tr>
<?php }?>




</tbody>
<tfoot>
	<tr>
    	<td colspan="3" style="text-align:right">
        	<strong>Grand Total</strong>
        </td>
        
    	<td style="text-align:right">
        	<strong><?php echo number_format($gt, 2, '.', ',');  ?></strong>
        </td>
    </tr>
</tfoot>
</table>
</div> 
<!-- <br>
 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;No. Items (<?php echo $tmpcount ?>), 
 Total Qty (<?php echo rtrim(str_replace('.00', '', number_format($tot_qty, 2)), '0'); ?>)-->



<div class="col-xs-12"><br>
<br>
<br>

	<div class="col-xs-1" style="">
    	
    </div>
	<div class="col-xs-3" style="text-align:center">
    	<p style="border-top:dashed 1px">Sales.Rep</p>
    </div>
    
    <div class="col-xs-3 pull-right" style="text-align:center">
    	<p style="border-top:dashed 1px">Customer</p>
    </div>
    <div class="col-xs-1" style="">
    	
    </div>
    
<!-- <div class="col-xs-5 pull-right" id="border_print" style="border:1px solid #000;">
 <table width="100%" border="0">
  <tr>
    <td><strong style="font-size:14px;">Sub Total RS</strong></td>
    <td style="text-align:right"><strong style="font-size:14px;"> <?php //echo $sales_rep_issue_details['total_amount'];?></strong></td>
  </tr>
 
</table>


</div>-->


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




<!--print-start-->   

 </body>



