<div class="print_outer_div" style="width: 210mm;overflow: hidden;margin:auto;padding-top:35px;margin-bottom:25px;display:inline-block;padding:30px 70px">
        <table class="invoiceHeader">
        	<tr>
				  <td colspan="5" valign="top">
					<div>
					 	<img class="order_barcode_image" id="barcode<?php echo $order['id']; ?>"/>
						<script>
							JsBarcode("#barcode<?php echo $order['id']; ?>", "<?php echo $order['customer_order_id']; ?>", {
							  format:"code39",
							  displayValue:false,
							  width: 1,
  							  height: 40,
  							  fontSize: 20,
							  lineColor: "#000"
							});
						</script>
						<br>
						Order No. - <?php echo $order['customer_order_id']; ?>
					</div>
				  </td>
				  <td  height="100px" class="right" align="right" width="40%" >
					<div>
						<?php if($order['docket_number']!=''){ ?>
					 	<img class="order_barcode_image" id="barcode<?php echo $order['id']; ?>_d"/>
						<script>
							JsBarcode("#barcode<?php echo $order['id']; ?>_d", "<?php echo $order['docket_number']; ?>", {
							  format:"code39",
							  displayValue:false,
							  width: 1,
  							  height: 40,
  							  fontSize: 20,
							  lineColor: "#000"
							});
						</script>
						<br>
						Docket No. - <?php echo $order['docket_number']; ?>
						<br>
						<?php } ?>
					</div>
					       <strong>Invoice Details: </strong><?php echo $order['customer_order_id']; ?><br/>
		                   <strong>Invoice Date: </strong><?php echo $order['invoice_date']; ?>
					</td>
				    ss	 
			 </tr>
			 <tr>
				  <td colspan="5" valign="top">
					    <strong><?php echo $company['name']; ?></strong><br />
					    <img class="company_logo_print" src="<?php echo $company['logo_img']; ?>" />
				  </td>
				    <td  height="100px" class="right" align="right" width="40%" >
				    	<strong>Tax Invoice/Bill of Supply/Cash Memo</strong><br/>(Triplicate for Supplier)
				    </td>
			 </tr>
		   	    <tr>
		            <td colspan="5" class="height"><strong>Sold By:</strong><br/>
		               <?php echo $branch['address']; ?>
		               <br />
		               <p>
                            <?php if(!empty($branch['phone']) || !empty($branch['tel_no'])) { ?>
                                Tel No.: <?php echo !empty($branch['phone']) ? $branch['phone'] : ''; ?><?php echo !empty($branch['tel_no']) ? ', '.$branch['tel_no'] : ''; ?>, <br>
                            <?php  } ?>
                            <?php if(!empty($branch['email'])) { ?>
                                E-mail: <?php echo $branch['email']; ?>, <br />
                            <?php  } ?>    
                            <?php if(!empty($company['website'])) { ?>
                                Website: <?php echo $company['website']; ?>
                            <?php  } ?>    
                        </p>
		            </td>
		            <td colspan="1" class="right" align="right"><strong> Billing Address:</strong><br/>
		                <?php echo $customer['customer_name']; ?> <br />
                        <?php if ($order['same_as_shipping'] == 1) { ?>
                            <?php echo $customer['address']; ?>
                            <br /> <?php echo $customer['address_city_name']; ?><br />
                            <?php echo $customer['address_state_name']; ?> - <?php echo $customer['address_pincode']; ?>
                        <?php } else {
                            $CustomerBillingAddress = (array) json_decode($order['customer_billing_address']);
                            echo (isset($CustomerBillingAddress['billing_address'])) ? $CustomerBillingAddress['billing_address'] : '';
                            echo "<br>";
                            echo (isset($CustomerBillingAddress['address_city'])) ? $CustomerBillingAddress['address_city'] : '';
                            echo "<br>";
                            echo (isset($CustomerBillingAddress['address_state'])) ? $CustomerBillingAddress['address_state'] : '';
                            echo '-' . (isset($CustomerBillingAddress['billing_pincode'])) ? $CustomerBillingAddress['billing_pincode'] : '';
                        } ?>
		            </td>
		         </tr>
		         <tr>
			           <td colspan="5" class=" height"><strong>PAN No:</strong> <?php echo $branch['pan_no']; ?><br />
                            <strong>GST Registration No:</strong> <?php echo $branch['gstin']; ?><br />
                        </td>
                        <td colspan="5" class=" " style="text-align: right;"><strong>Shipping Address:</strong><br />
                            <?php echo $customer['customer_name']; ?> <br />
                            <?php echo $customer['address']; ?>
                            <br /> <?php echo $customer['address_city_name']; ?><br />
                            <?php echo $customer['address_state_name']; ?> - <?php echo $customer['address_pincode']; ?><br />
                            <strong>GST Registration No:</strong><br /> <?php echo $customer['gst']; ?>
                        </td>
		         </t> 
		        <tr>
			            <td colspan="5" class=" " style="font-size: ;"><strong>Order Number:</strong> <?php echo  $order['customer_order_id']; ?><br />
                            Order Date: <?php echo  $order['booking_date']; ?>
                        </td>
                        <td colspan="5" class=" " style="text-align: right;">
                            <!-- <strong>Invoice Details: </strong><?php echo $order['customer_order_id']; ?><br/>
                                        <strong>Invoice Date: </strong><?php echo $order['invoice_date']; ?> -->
                        </td>
		         </tr>  
		</table>
		<table class="invoiceContent" >
			 <tr style="border: 1px solid;">
					<td colspan=""  style="padding: 0;">
						<table id="invoice" style="width:100%; border-collapse: collapse;" >
							<tr>
								<th rowspan="2" >S. No.</th>
								<th rowspan="2" style="width:13%">Description</th>
								<th rowspan="2">Unit Price</th>
								<th rowspan="2">Qty</th>
								<th rowspan="2" >Net Amount</th>
								<?php if(count($tax_list)>0){ foreach($tax_list as $tax){ ?>
						           <th colspan="2"><?php echo $tax; ?></th>
								<?php } } ?>
								<th rowspan="2" >Total <br /> Amount</th>
							</tr>
							<tr>
								<?php foreach($tax_list as $tax){
									$$tax = 0; ?>
								<th >Rate</th>
								<th >Amount</th>
								<?php } ?>
						  	</tr>
							<?php 
                            $i=1;
                            $ttlQty=0;
                            $totalGrossAount=0;
                            $TotalTaxAmount=array();
                            foreach($order_item_list as $item){
                                $totalAmount=$item['rate']*$item['qty'];
							?>
                            <tr>	
                                <td ><?php echo $i; ?></td>
                                <td style="text-align: center;">  <strong><?php echo $item['item_name']; ?></strong>  </td>
                                <td ><?php echo $item['rate']; ?></td>
                                <td ><?php echo $item['qty'].' '.json_decode($item['item_detail'])->unit; ?></td>
                                <td ><?php echo $item['amount']; ?></td>
                                    <?php if(count($tax_list)>0){ foreach($tax_list as $tax_id => $tax){ ?>
                                    <td class="">
                                    <?php
                                    $taxRate='0.00';
                                    $taxAmount='0.00';
                                            if(isset($taxItemList[$item['item_id']][$tax_id]))
                                            {
                                            $tax_percentage=$taxItemList[$item['item_id']][$tax_id]['tax_percentage'];
                                            $taxRate=$tax_percentage;
                                            $taxAmount=round($item['rate']*$item['qty']*$tax_percentage/100,2);
                                            $totalAmount = $totalAmount + $taxAmount;
                                            $taxSin=(isset($TotalTaxAmount[$tax_id]))?$TotalTaxAmount[$tax_id]:0;
                                            $TotalTaxAmount[$tax_id]=$taxAmount+$taxSin;
                                            }
                                            echo sprintf("%.2f",$taxRate) ?>%
                                            </td>
                                    <td class="">
                                        <?php echo   sprintf("%.2f",$taxAmount) ?>
                                    </td>
                                    <?php } } ?>
                                <td><?php echo sprintf("%.2f",$totalAmount); ?></td>
                            </tr> 
							<?php 
								$ttlQty += $item['qty'];
								$i++; 
								$totalGrossAount+=$totalAmount;
								} 
							?>
							<tr>
								<td colspan="3" class="right" ><strong>Total</strong></td>
								<td ><strong><?php echo sprintf("%.2f",$ttlQty); ?></strong></td>
								<td ><strong><?php echo $order['gross_amt']; ?></strong></td>
								<?php if(count($tax_list)>0){ foreach($tax_list as $tax_id => $tax){ ?>
								<td ></td>
								<td ><strong><?php echo sprintf("%.2f",(isset($TotalTaxAmount[$tax_id]))?$TotalTaxAmount[$tax_id]:0); ?></strong></td>
								<?php } } ?>
								<td ><strong><?php echo sprintf("%.2f",$totalGrossAount) ; ?></strong></td>
							</tr>
							<tr>
								<td colspan="<?php echo 5+(count($tax_list)*2); ?>" align="right" style="text-align: right;"><strong>Total Tax</strong></td>
								<td align="right" style="text-align: right;"><strong><?php echo $order['tax_amt']; ?></strong></td>
							</tr>
							<tr>
								<td colspan="<?php echo 5+(count($tax_list)*2); ?>" align="right" style="text-align: right;"><strong>Total Discount</strong></td>
								<td align="right" style="text-align: right;"><strong><?php echo $order['discount_amt']; ?></strong></td>
							</tr>
							<tr>
								<td colspan="<?php echo 5+(count($tax_list)*2); ?>" align="right" style="text-align: right;"><strong>Round Off</strong></td>
								<td align="right" style="text-align: right;"><strong><?php echo $order['round_off_amt']; ?></strong></td>
							</tr>
							<tr>
								<td colspan="<?php echo 5+(count($tax_list)*2); ?>" align="right" style="text-align: right;"><strong>Grand Total</strong></td>
								<td class="right" style="text-align: right;"><strong><?php echo $order['net_amt']; ?></strong></td>
							</tr>
						</table>
					</td>
				</tr> 
		</table>
		<table class="invoiceFooter" cellspacing="0" style="border-left:1px solid;border-right:1px solid;margin-top:0;">
		        <tr>
				   <td colspan="6" class="amout" style="font-size:12px;">
					   <strong>Amount in Words:</strong>
				   </td>
				</tr>
				<tr>
					<td colspan="6">
					<strong style="font-size:12px;">
						<?php echo getInWordAmnt($order['net_amt']); ?> ONLY
					</strong>
					</td>
				</tr> 
				<tr>
					<td colspan="6" class="foter">
						<strong style="font-size: 10px;">For <?php echo $company['name']; ?>:</strong>
					</td>
				</tr>
				<tr>
					<td colspan="6" class="fotr">
						<?php if(!empty($branch['sign_img_path'])) {?>
                        <img src="<?php echo base_url($branch['sign_img_path']); ?>" style="float:right;height:30px;vertical-align: middle;padding:10px;max-width: 120px;" />
                        <br />
                        <?php } ?>
					</td>
				</tr>
				<tr>
					<td colspan="6" class="auth" style="border-bottom:1px solid;width: 40%;padding-top: 5px;text-align: right;">
						<strong style="font-size: 10px;">Authorized Signatory</strong>
					</td>
				</tr>
		</table>
</div>
<div class="pagebreak" style="display:inline-block;@media print {.pagebreak { page-break-after:always !important;} }"> </div>
