
<!--onLoad="window.print()"-->
<body >
	<?php $this->load->view("common/header"); ?>
	<style type="text/css">
.report_view_th{
	color:#000 !important;
	font-size:12px;	
}

.table-responsive td{
	font-size:11px;
	background-color:#fff !important;	
}
h4{
	font-size:13px;
}
body{
	background-color:#fff !important;
}
.print_header_tbl{
	font-size:13px;
	border:1px;	
}
.print_header_tbl td{
	padding-bottom:5px;
	border:1px;		
}

.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
  border-top: 1px solid #ddd;
  line-height: 1;
  padding: 3px;
  vertical-align: top;
}
</style>
		

<div class="">

         

         
            <div class="modal-body">

 <div style="top:2px;" 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>
<div class="row">
<div class="col-xs-12">

<?php $this->load->view("common/report_header"); ?>

 
 

   </div><!--col-xs-12-->
</div><!--row--> 
<div class="row">
<div class="col-xs-12 text-center">

 <h4 class="text-bold" style="text-decoration:underline">PURCHASE ORDER</h4>

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


<div style="margin-bottom:15px;" class="row">

<div class="col-xs-5 pull-left">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped print-table order-table">
  <tr>
    <td>Supplier :</td>
    <td><?php echo $po_details[0]->supp_company_name ?> </td>
  </tr>
  <tr>
    <td>Vat No. :</td>
    <td></td>
  </tr>
    <tr>
    <td>Fax :</td>
    <td></td>
  </tr>
    <tr>
    <td>Project : </td>
    <td><?php echo $po_details[0]->name ?></td>
  </tr>
</table>
</div>
</div>
<?php //print_r($po_details[0]);?>
<div class="col-xs-4 pull-right">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped print-table order-table">
  <tr>
    <td>PO No. :</td>
    <td>  <?php echo $po_details[0]->po_reference_no ?></td>
  </tr>

    <tr>
    <td> Order Date:</td>
    <td><?php echo $po_details[0]->po_datetime ?></td>
  </tr>
    <tr>
    <td>Company VAT No. :</td>
    <td></td>
  </tr>
      <tr>
    <td>Delivery Date :</td>
    <td><?php echo $po_details[0]->po_delivery_date ?></td>
  </tr>
      <tr>
    <td>Delivered to :</td>
    <td><?php echo $po_details[0]->name ?></td>
  </tr>
      <tr>
    <td>Payment Term  :</td>
    <td><?php echo $po_details[0]->po_payment_term ?> Days</td>
  </tr>
</table>
</div>
</div>
</div>          


<div class="table-responsive">


<table class="table table-bordered table-hover table-striped print-table order-table">
<thead>
<tr class="report_view_th">
<th style="width:50px !important" class="text-center">Item No</th>
<th class="text-center col-sm-3 ">Item Name</th>
<th class="col-sm-1 text-center">Ord. Qty</th>
<th class="col-sm-1 text-center">Unit</th>
<th class="text-center" style="width:50px !important">Rate</th>
<th class="col-sm-1 text-center">Discount</th>
<th class="text-center">Amount</th>

</tr>
</thead>
<tbody>
 <?php 
// print_r($po_item_list);
 $tmpcount=0;
 $tt_grand_tot=0;
  $tt_paid=0;
   $tt_balance=0;
  foreach ($po_item_list as $row)
 {
	 $tmpcount++;
	 /*
	 $total_paid_amount=$row['total_paid_amount'];
	 if (empty($total_paid_amount)) {
		  $pay_st = 'Pending';
		}else{
		  if ($total_paid_amount >= $row['po_total']) {
			$pay_st = 'Paid';
		  }else{
			$pay_st = 'Partial';
		  }
		}
		$tt_grand_tot=$tt_grand_tot+$row['po_total'];
		$tt_paid=$tt_paid+$total_paid_amount;
		$tt_balance=$tt_balance+($row['po_total']-$total_paid_amount);
		*/
 ?>  
<tr>
<td style="text-align:right; width:40px; vertical-align:middle;"><?php echo sprintf("%1d",$tmpcount); ?></td>
<td style="vertical-align:middle;">
 <?php echo $row->product_name; //echo display_date_time_format($row['po_datetime']); ?>  / <?php echo $row->product_code; ?> / <?php echo $row->product_part_no; ?></td>
<td><?php echo $row->poitm_qty;?><?php //echo $row['po_reference_no']; ?></td>
<td><?php echo $row->unit_name;?><?php //echo $row['cus_name']; ?></td>
<td><?php echo $row->product_cost;?> <?php //echo $pay_st; ?></td>

<td class="text-right"><?php echo $row->poitm_dis_val;?>  (<?php echo $row->poitm_dis;?>)<?php //echo number_format($row['po_total'], 2, '.', ','); ?></td>
<td class="text-right"><?php echo number_format($row->sub_total_item, 2, '.', ',');?>  <?php //echo number_format($row['po_total']-$total_paid_amount, 2, '.', ','); ?></td>
</tr>

<?php }?>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;">Total</td>
  <td class="text-right"><?php echo number_format($po_details[0]->po_total, 2, '.', ','); ?>
  </td>
</tr>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;">Discount</td>
  <td class="text-right">(<?php echo $po_details[0]->po_discount ?>)
  <?php echo number_format($po_details[0]->po_discount_amt, 2, '.', ','); ?>
  </td>
</tr>
<?php if ($po_details[0]->po_exepences)
{ ?>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;"><?php echo $po_details[0]->po_exepences_dtls ?></td>
  <td class="text-right"><?php echo number_format($po_details[0]->po_exepences, 2, '.', ','); ?></td>
</tr>
<?php }?>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;">VAT</td>
  <td class="text-right">(<?php echo $po_details[0]->po_vat ?>)
  <?php echo number_format($po_details[0]->po_vat_val, 2, '.', ','); ?>
  </td>
</tr>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;">NBT</td>
  <td class="text-right">(<?php echo $po_details[0]->nbt_fld_val ?>)
  <?php echo number_format($po_details[0]->nbt_amount, 2, '.', ','); ?>
  </td>
</tr>
<tr>
  <td colspan="6" style="text-align:right; width:40px; vertical-align:middle;">Net Total</td>
  <td class="text-right"><?php echo number_format($po_details[0]->po_net_total, 2, '.', ','); ?></td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>



<div class="row">
<br>
<br>

<div class="col-xs-4">

<br/>
Prepared by <br/><br/>
...........................<br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($po_details[0]->prepared_user){
$data['user_details']=$ref_id->get_user_info($po_details[0]->prepared_user);
echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
echo "<br/>". $data['user_details']['user_designation'];
if($po_details[0]->prepared_date!='0000-00-00 00:00:00'){
		  echo "<br/>Date : ".site_date_time($po_details[0]->prepared_date);
	 }

}?>

</div>

<div class="col-xs-4"><br>
Checked  by <br>
<br>
...........................
<br/>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($po_details[0]->checked_user){
$data['user_details']=$ref_id->get_user_info($po_details[0]->checked_user);
echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
echo "<br/>". $data['user_details']['user_designation'];
if($po_details[0]->checked_date!='0000-00-00 00:00:00'){
		  echo "<br/>Date : ".site_date_time($po_details[0]->checked_date);
	 }
}?>
<br>


</div>

<div class="col-xs-4"><br/>Authorized by<br/>

<br/>...........................
 <br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($po_details[0]->authorized_user){
$data['user_details']=$ref_id->get_user_info($po_details[0]->authorized_user);
echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
echo "<br/>". $data['user_details']['user_designation'];
	  if($po_details[0]->authorized_date!='0000-00-00 00:00:00'){
		  echo "<br/>Date : ".site_date_time($po_details[0]->authorized_date);
	 }
}?>
<br>

</div>




<div class="col-xs-4 pull-left">
<br>

<br/>Approved by
<br>
<br>

...........................

<br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($po_details[0]->approved_user){
$data['user_details']=$ref_id->get_user_info($po_details[0]->approved_user);
echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
echo "<br/>". $data['user_details']['user_designation'];
 if($po_details[0]->approved_date!='0000-00-00 00:00:00'){
		  echo "<br/>Date : ".site_date_time($po_details[0]->approved_date);
	 }
}?>

</div>
</div>




<!--<div class="row">

<div class="col-xs-5 pull-right">
<div class="well-sm">
<p>
Created by:  <?php echo $this->session->userdata('ss_user_first_name'); ?> (<?php echo $this->session->userdata('ss_user_group_name'); ?>)</p> <p>
Date: <?php echo display_date_time_format(date("Y-m-d H:i:s")); ?> </p>
</div>
</div>-->
</div>

             
                 <!--/.col-md-12-->

</body>

