
<!--onLoad="window.print()"-->
<body onLoad="window.print()">
	<?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">

 <h2 class="text-bold text-left" style=" text-transform: uppercase;">Payment Voucher - Processed</h2>

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

$warehouse_details= $this->Warehouse_Model->get_warehouse_info($mp_details['warehouse_id']);

//print_r($warehouse_details);
?>

<div style="margin-bottom:15px;" class="row">
<?php //print_r($exp_details);?>
<div class="col-xs-6 pull-left">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped print-table order-table">
  <tr>
    <td>Voucher No:</td>
    <td><?php echo $mp_details['payment_system_ref_no']; ?> </td>
  </tr>
  <tr>
    <td>Voucher Date:</td>
    <td><?php echo site_date($mp_details['pay_g_date_time']) ?> </td>
  </tr>
  
  <tr>
    <td>Paying by</td>
    <td><?php echo ($mp_details['p_type_name']); ?></td>
  </tr>
  <tr>
                                             <td>
                                                <?php if($mp_details['p_type_name']=='Cheque') echo 'Cheque'; ?>
                                                No:
                                             </td>
                                             <td><?php if($mp_details['p_type_name']=='Cheque') {echo ($mp_details['cheque_no']);}else{ echo ($mp_details['ref_no']);} ?></td>
                                          </tr>
  <tr>
    <td>Amount:</td>
    <td><?php echo $mp_details['pay_amount'] ?> </td>
  </tr>
  </table>
</div>
</div>


<?php
$ref_id = new User_Model();
	 // print_r($mp_details);
	 ?>

<div class="col-xs-6 pull-right">
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped print-table order-table">
    <tr>
    <td>Print Date/Time :</td>
    <td>  <?php echo site_date_time($mp_details['system_date_time'] ) ?></td>
  </tr>
  <tr>
    <td>User :</td>
    <td>  
   <?php
    $data['user_details']=$ref_id->get_user_info($mp_details['user_id']);

	 echo $data['user_details']['user_first_name'];//.' '.$data['user_details']['user_last_name'];
   
   ?>
    </td>
  </tr>
  <!-- 
  <tr>
    <td>Customer Name :</td>
    <td>  <?php echo $mp_details['supp_company_name'] ?></td>
  </tr>
  -->
  <tr>
    <td>Batch No :</td>
    <td>  <?php echo $mp_details['supp_company_name'] ?></td>
  </tr>
   <tr>
                                             <td>Bank Account :</td>
                                             <td> 
                                                <?php 
                                                   if(isset($mp_details['bank_id'])){
                                                      if($mp_details['p_type_name']!='Cash'){
                                                          
                                                          echo $mp_details['account_no'];
                                                      }
                                                   }
                                                   ?>
                                             </td>
                                          </tr>
                                          <tr>
                                             <td> Bank :</td>
                                             <td>   <?php 
                                                   if(isset($mp_details['bank_id'])){
                                                      if($mp_details['p_type_name']!='Cash'){
                                                          
                                                          echo $mp_details['bank_name'];
                                                      }
                                                   }?></td>
                                          </tr>
 
   
</table>
</div>
</div>
         

<div class="col-xs-12 ">
    Pay able To a sum of :  
    <?php
    	$cheque_amount_in_words=$this->Cheque_Process_Model->convertNumber($mp_details['pay_amount']);
    	echo ucwords($cheque_amount_in_words);
    ?>
    </div>
    
    <div class="col-xs-12 ">
        <br/>
    On Account of.
    </div>
    
    
    <table class="table table-bordered table-hover table-striped print-table order-table">
    <tr>
    <td>Account</td>
    <td> Description</td>
   <!--  <td text-align="center"> Debit</td>
    <td> Credit</td> -->
  </tr>
  <tr>
    <td><?php echo $mp_details['supp_company_name'] ?> </td>
    <td></td>
     <!--
    <td> <?php echo number_format($mp_details['pay_amount'], 2, '.', ','); ?></td>
    <td> 
   
    </td> -->
  </tr>
  <!-- 
  <tr>
    <td></td>
    <td></td>
    
    <td><?php echo number_format($mp_details['pay_amount'], 2, '.', ','); ?> </td>
    <td> <?php //echo number_format($smp_credit_tot, 2, '.', ','); ?></td>
  </tr> -->
  </table>
    
   <div class="col-xs-12 "> 
    Payment Allocation Details
    </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 class="text-center">#</th>
     <th class="text-center">Date</th>
      <th class="text-center">Type</th>
       <th class="text-center">Ref</th>
        <th class="text-center">Inv</th>
         <th class="text-center">..</th>
          <th class="text-center">Net Amount</th>
<th style="width:50px !important" class="text-center"> Paid Amount</th>
<th class="text-center col-sm- ">Due Amount</th>
<th class="text-center col-sm-1">Amount</th>

</tr>
</thead>
<tbody>
 <?php 
 
 $tmpcount=0;
  foreach ($mp_itm_list as $row)
 {
	 $tmpcount++;
	 $grn_return_total = $this->Supplier_Payment_Process_Model->get_grn_return_total_payment($row->invoice_id);
     $balance_amount   =($row->total-$grn_return_total)-$row->allocation_amount;
     $balance_amount   = (float) $balance_amount;
 ?>  
<tr>
<td style="text-align:right; width:40px; vertical-align:middle;"><?php echo sprintf("%1d",$tmpcount); ?></td>
<td><?php echo site_date($row->date);?></td>
<td>Purchase</td>
<td></td>
<td><?php echo $row->reference_no;?></td>
<td></td>
<td class="text-right"><?php echo number_format($row->total, 2, '.', ','); ?></td>
<td class="text-right"><?php echo number_format($row->allocation_amount, 2, '.', ',');?></td>
<td style="vertical-align:middle;" class="text-right"><?php echo number_format($balance_amount, 2, '.', ',');?>
  <?php //$grn_paid_amount; //echo $row->sale_reference_no; //echo display_date_time_format($row['po_datetime']); ?> </td>
<td class="text-right">  <?php //echo number_format($row['po_total']-$total_paid_amount, 2, '.', ','); ?>
<?php echo number_format($row->allocation_amount, 2, '.', ','); ?>
</td>
</tr>

<?php }?>

<!--<tr>
    <td></td>
     <td clspan="2"><b>GRN RETURN</b></td>
      <td></td>
       <td></td>
        <td></td>
         <td></td>
          <td></td>
           <td></td>
            <td></td>
            <td></td>
</tr>-->


 
 <!--<tr>
    <td></td>
     <td clspan="2"><b>SUPPLIER PAYMENT ADJUSTMENT</b></td>
      <td></td>
       <td></td>
        <td></td>
         <td></td>
          <td></td>
           <td></td>
            <td></td>
            <td></td>
</tr>-->

<tr>
  <td colspan="9" style="text-align:right; width:40px; vertical-align:middle;">Total</td>
  <td class="text-right"><?php echo number_format($mp_details['pay_amount'], 2, '.', ','); ?>
  </td>
</tr>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</div> 


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

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

<br/>
Prepared by <br/><br/>
...........................<br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($mp_details['user_id']){
$data['user_details']=$ref_id->get_user_info($mp_details['user_id']);
//echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
//echo "<br/>". $data['user_details']['user_designation'];

}?>

</div>

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

<br/>
Checked by <br/><br/>
...........................<br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($mp_details['user_id']){
$data['user_details']=$ref_id->get_user_info($mp_details['user_id']);
//echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
//echo "<br/>". $data['user_details']['user_designation'];

}?>

</div>

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

<br/>
Approved by <br/><br/>
...........................<br>
<?php  
$ref_id = new User_Model();
?>
<?php 
if($mp_details['user_id']){
$data['user_details']=$ref_id->get_user_info($mp_details['user_id']);
//echo $data['user_details']['user_first_name'].' '.$data['user_details']['user_last_name'];
//echo "<br/>". $data['user_details']['user_designation'];

}?>

</div>

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

<br/>...........................
 <br>
<?php  
$ref_id = new User_Model();
?>

<br>

</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-->
                 
    <div class="row">              
 <div class="col-xs-12">
     <div class="col-xs-12" style="border-top: 2px dotted;">
     <h3 class="text-center">RECEIPT</h3>
     
     </div>
     
     <div class="col-xs-6">
         Receirved Cheque No:  <?php echo ($mp_details['cheque_no']); ?>
         
          <br/> <br/>
         SLR : <?php echo number_format($mp_details['pay_amount'], 2, '.', ','); ?>
         
         <br/> <br/>
         <br/> <br/>
         Date : .....................<br/>
         
         <br/>
         <table>
             
             <tr>
                 <td>Receirved By &nbsp;&nbsp;&nbsp; </td>
                  <td><p>Name : ...................... </p>
                  <p>ID Number : ..................... </p>
                  <p>Signature : ..................... </p>
                  
                  </td>
                 
             </tr>
         </table>
         
         <br/>
         
         
         
         </div>
         
         
         <div class="col-xs-6">
             
             From : <?php echo $warehouse_details['name'] ;?>
             </div>
     
</div>  
</div>
                 
                 

</body>

