
<!--onLoad="window.print()"-->
<body onLoad="window.print()">
	<?php $this->load->view("common/header"); ?>
	<style type="text/css">
	.table-responsive {
		border:0px solid #000 !important;
	}
.report_view_th{
	color:#000 !important;
	font-size:12px;
		
}
.menu_type{
	font-size:11px;
	text-decoration:underline;
	font-weight:600;
}
.warehouse_name_print{
	height:100px;
}
.our_com_des{
	font-size: 9px;
text-align: center;
color:#333;	
}
.table-responsive td{
	font-size:11px;
	background-color:#fff !important;	
	border:0px solid #000 !important;
	padding:0px !important;
}
.table-responsive th{	
	border:0px solid #000 !important;
}
h4{
	font-size:13px;
}
h5{
	font-size:135%;
}
body{
	background-color:#fff !important;
}
.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;	
}
p {
  margin: 0 0 2px !important;
}
.main-menu-price{
	font-size:14px !important;
	
}
h4, .h4, h5, .h5, h6, .h6 {
  margin-bottom: 0px;
  margin-top: 0px;
}
</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 text-center">

<div class="warehouse_name_print"><?php //echo $booking_all_details[0]->name?></div>
<div><?php //echo $booking_all_details[0]->address?> </div>
<div><?php //echo $booking_all_details[0]->phone?> </div>
  
  </div><!--col-xs-12-->
</div><!--row-->  



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

<div style="clear-both"></div>

<div class="col-xs-6 pull-left">
<?php //print_r($booking_all_details);?>

<h4 style="margin-top:10px;">Customer Details</h4>
<p>Name : <?php echo $customer_details['cus_name']; ?></p>
<p>TP :   <?php echo $customer_details['cus_mobile']; ?> &nbsp; <?php echo $customer_details['cus_mobile_2']; ?> &nbsp; <?php echo $customer_details['cus_home_phone']; ?></p>
<p>Address : <?php echo $customer_details['cus_address']; ?></p>
</div>

<div class="col-xs-5 pull-right">
<?php //print_r($booking_all_details);?>
<h4 style="margin-top:10px;">Booking Details</h4>
<p>Booking ID: <?php echo $booking_all_details[0]->bkng_refno?></p>
<?php if ($booking_all_details[0]->bkng_flora_bill_no){ ?>
<p>Flora Bill Number: <?php echo $booking_all_details[0]->bkng_flora_bill_no?></p>
<?php }?>
<p><h5>Function Date : <?php echo date('d/F/Y', strtotime($booking_all_details[0]->bkng_date));?></h5></p>
<p><h5>Function Time : <?php echo $booking_all_details[0]->bkng_time;?></h5></p>



</div>
</div>          

<p>Invoice Date : <?php echo date('d/F/Y', strtotime($booking_all_details[0]->bkng_reg_date));?></p>




<!--Start Booking Menu Items-->

<div class="table-responsive">
<?php //print_r($booking_selected_menu_list);?>
<table class="table  table-hover table-striped print-table order-table">
<thead>
<tr class="report_view_th">
<th>No</th>
<th>Description</th>
<th style="padding-right:20px;" class="text-right">Quantity</th>
<th style="padding-right:20px;" class="text-right">Item Price</th>
<th style="padding-right:20px;" class="text-right">Total</th>
</tr>
</thead>
<tbody>
 <?php 
 
 //get tot menu items
 $tmpcountmenu=0;
 $lastcount=count($booking_selected_menu_list);
  foreach ($booking_selected_menu_list as $row)
 {
	if($row->bkng_itm_type=='' && $row->bkng_extra_item==''){ 
	 $tmpcountmenu++;
	}
 }
 $tmpcount=0;
 $lastcount=count($booking_selected_menu_list);
  foreach ($booking_selected_menu_list as $row)
 {
	if($row->bkng_itm_type=='' && $row->bkng_extra_item==''){ 
	 $tmpcount++;
 ?>  
<tr>
<td style="text-align:center; width:40px; vertical-align:middle;"><?php echo $tmpcount ?></td>
<td style="vertical-align:right;"><?php echo $row->item_name; ?> 
  
  <?php if ($row->bkng_itm_type=='Extra') echo "/ (Extra)";?>
  <?php //if ($row['product_oem_part_number']) echo ", OEM Part No.:".$row['product_oem_part_number']; ?>
</td>
<td> 
<?php if ($tmpcount==$tmpcountmenu){ ?>
<div class="pull-right main-menu-price">
<?php echo $booking_details->menu_name;?> : <?php echo $booking_details->bkng_menu_amount; ?>
</div>
<?php }?>  
</td>
<td> 
<?php if ($tmpcount==$tmpcountmenu){ ?>
<div class="pull-right main-menu-price">
Pax : <?php echo $booking_all_details[0]->bkng_head_count;?>
</div>
<?php }?>  
</td>
<td> 
<?php if ($tmpcount==$tmpcountmenu){ ?>
<div class="pull-right main-menu-price">
 <?php echo number_format((($booking_all_details[0]->bkng_menu_amount)*$booking_all_details[0]->bkng_head_count), 2, '.', ',') ?>
</div>
<?php }?>  
</td>
</td>



</tr>




<?php }
 } // End Menu Item Check
 ?>

 
 <?php

 $tmpcount=0;
 $sub_total_extra_menu_items=0;
  foreach ($booking_selected_menu_list as $row)
 {
	 if($row->bkng_itm_type=='Extra' && $row->bkng_extra_item==''){ 
	 $sub_total_extra_menu_items+=$row->bkng_itm_price;
	 $tmpcount++;
 ?> 
 <?php if($tmpcount==1){  ?> 
  <tr>
    <th><td>  <div class="menu_type"> Extra Menu Items</div></td>
   <td></td>
<td></td>
<td></td>
</tr>
<?php }?>
<tr>
<td style="text-align:center; width:40px; vertical-align:middle;"><?php //echo $tmpcount ?></td>
<td style="vertical-align:middle;"><?php echo $row->item_name; ?> 

  <?php if ($row->bkng_itm_type=='Extra') echo "/ (Extra)";?>
  <?php //if ($row['product_oem_part_number']) echo ", OEM Part No.:".$row['product_oem_part_number']; ?>
  
</td>
<td></td>
<td></td>
<td style="text-align:right; width:120px; padding-right:10px;"><?php echo number_format($row->bkng_itm_price*$booking_all_details[0]->bkng_head_count, 2, '.', ',') ?></td>
</tr>
<?php }
 } // End Menu Item Check
 ?>
 
 <?php if ($booking_selected_extra_item_list){ ?>
<!-- <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4"><strong>Total Amount </strong>
  </td>
<td><div class="td_border_bottom_2 td_border_top_1 text-right"><?php 
  //Multifly Head Count
  $bkng_head_count=$booking_all_details[0]->bkng_head_count;
  $sub_total_extra_menu_items=$sub_total_extra_menu_items*$bkng_head_count;
  echo number_format(($sub_total_extra_menu_items), 2, '.', ',') ?> </div></td>
  </tr>-->
  
   <th>
  <td> <div class="menu_type"> Extra Items</div></td>
   <td></td>
<td></td>
<td></td>
</tr>
<?php }?>
 <?php 
 $tmpcount=0;
 $sub_total_extra_items=0;
  foreach ($booking_selected_extra_item_list as $row)
 {
	 if($row->bkng_itm_type=='' && $row->bkng_extra_item=='Extra'){ 
	 $tmpcount++;
	 $sub_total_extra_items+=$row->tot_amount;
	 
	 
	$um=new Unit_Model();
	$unit_dtls=$um->get_unit_info($row->item_unit);
	$unit_code=$unit_dtls['unit_code'];
 ?>  
<tr>
<td style="text-align:center; width:40px; vertical-align:middle;"><?php //echo $tmpcount ?></td>
<td style="vertical-align:middle;"><?php echo $row->item_name; ?>

  <?php if ($row->bkng_itm_type=='Extra') echo "/ (Extra)";?>
  <?php //if ($row['product_oem_part_number']) echo ", OEM Part No.:".$row['product_oem_part_number']; ?>
  
</td>

<td style="text-align:right; width:120px; padding-right:10px;"><?php echo number_format($row->bkng_itm_price, 2, '.', ',') ?></td>
<td style="text-align:right; width:120px; padding-right:10px;"><?php echo number_format($row->bkng_itm_qty, 2, '.', ',') ?> (<?php echo $unit_code ?>)</td>
<td style="text-align:right; width:120px; padding-right:10px;"><?php echo number_format($row->tot_amount, 2, '.', ',') ?></td>
</tr>
<?php }
 } // End Menu Item Check
 ?>
 <!--<tr>
  <td style="text-align:right; padding-right:10px;" colspan="4"><strong>Total Amount </strong>
  </td>
<td>
<div class="td_border_bottom_2 td_border_top_1 text-right">
<?php echo number_format($sub_total_extra_items, 2, '.', ',') ?>
</div>
</td>
  </tr> -->
  <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4">&nbsp;</td>
<td>

</td>
  </tr>
 <?php if ($booking_all_details[0]->bkng_discount_value!='0.00'){ ?>  
  <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4">

  <strong>Discount</strong>
</td>
<td>
<div class="text-right td_border_bottom_1">
<?php echo number_format($booking_all_details[0]->bkng_per_head_discount_value, 2, '.', ',') ?></div>
</td>
  </tr>
  <?php }?>
 <?php if ($booking_all_details[0]->bkng_per_head_discount_value!='0.00'){ ?> 
    <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4"><strong>Per Head Discount</strong></td>
<td>
<div class="text-right td_border_bottom_1"><?php echo number_format($booking_all_details[0]->bkng_per_head_discount_value, 2, '.', ',') ?></div>
</td>
  </tr>
  <?php }?>
    <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4"><strong>Grand Total</strong></td>
<td>
<div class="td_border_bottom_1 text-right">
<?php 
  echo number_format($booking_all_details[0]->bkng_tot_amount, 2, '.', ',');
  ?></div>
</td>
  </tr>
<?php  
	 $balance_amt=0;
	 $tot_advnc_paid=0;
 foreach ($booking_payment_list as $row){
$tot_advnc_paid+=$row->pymnt_amount;


	 ?>  
     
   <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4">
  <strong>Advance Paid   <?php if($row->pymnt_paying_by!='Cash') echo "($row->pymnt_paying_by)"; ?>
  [Date:<?php echo date('d/M/Y', strtotime($row->pymnt_date_time));?>]</strong>
  </td>
<td>
<div class="td_border_bottom_1 text-right">
<?php echo number_format($row->pymnt_amount, 2, '.', ',') ?>
</div>
</td>
  </tr>
 <?php }
 $balance_amt=$booking_all_details[0]->bkng_tot_amount-$tot_advnc_paid;
 ?> 
   <tr>
  <td style="text-align:right; padding-right:10px;" colspan="4"><strong>Balance Amount</strong></td>
<td>
<div class="text-right td_border_bottom_2">
 <?php 
  echo number_format($balance_amt, 2, '.', ',');
  ?>
</div>
</td>
  </tr>

  
</tbody>
</table>
</div> 
<!--table-responsive-->

<!--End Booking Menu Items-->




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

<div class="clearfix"></div>
<!-- end payment list-->





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


<?php if ($booking_all_details[0]->bkng_note){ ?>
<div class="col-xs-12">
<div class="col-xs-12">
Note: 
	<?php echo $booking_all_details[0]->bkng_note; ?>
    <br>
<br>

    </div>
</div>
<?php }?>

<div class="col-xs-12">
<div class="col-xs-8"> Prepared by: <br>
<br>
...................
<br>
<?php echo $user_details['user_first_name'];?>

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

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

<div class="col-xs-4 pull-right">Customer<br>
<br>
.............................
<br>
</div> <!--col-xs-4-->
   </div><!--col-xs-12-->
                
     <div class="row">
<p class="text-center">
<br>
<div class="our_com_des">
Developed by: Sallelanka Solutions (pvt) Ltd.<br>
 Tel. +94776520755 WEB:www.sallelanka-solutions.com 
 </div>
</p>
</div><!--row-->   
    
</div>
</div>

</div>

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

</body>

