<!DOCTYPE html>
<html>
<head>
 <title>Invoice List</title>
<style>
body{padding:0px!important;font-size:12px;}
table{
  border-collapse: collapse;}
.item_table {
  border-collapse: collapse;
  font-size:12px!important;
  margin:0px;
}
table.item_table,.item_table th,.item_table td {
  border: 1px solid black; 
  font-family:'Times New Roman', Times, serif;
  padding:1px;
} 

 .second-colom{

      height:100px;

       border-bottom:1px solid;

        text-align:center;

        width:100%;

 }


.nobdr_table, .nobdr_table td{ border:none!important;padding:0px!important}

</style>

</head>
<body style="font-family: 'Times New Roman', Times, serif">

<div class="main" >
    <br>
    <br>
<br>
    <br>
<br>
    <br>
<br>
    <br>
    <br>

<div >
  
<?php 

        if (Yii::app()->user->master_company_code == 'ARK') { 
                $footer_company_name =' ARK Engineering Services (ARK) ';
            }else{
                $footer_company_name =' Ace Centro Enterprises (ACE) ';
            }
            $crm_login_company_id       = Yii::app()->user->master_user_company_id;
        $privillage_modal           = new MasCompanySettings();
        $privillage_condition       = 'crm_company_id='.$crm_login_company_id;
        $privillage_settings_module = $privillage_modal->find(array('condition'=>$privillage_condition));        
        $bonus_quantity             = $privillage_settings_module->bonus_quantity;

        $modelInvoice = Invoice::model()->findByPk($id);
        $settings = MasCompany::model()->findByPk(Yii::app()->user->master_user_company_id);
    ?>
<div  style="width:100%;float: left;margin-top: 10px;font-size:11px;font-family:'Times New Roman', Times, serif;"> 

 <div style="text-align:left; float:left; width:50%;" >

  <div style="float:left;">

  <span style="font-weight:bold;padding-bottom: 6px;float: left;"><?php echo strtoupper($modelInvoice->customer->customer_name); ?></span><br />

  <span style="padding-bottom: 6px;float: left;"><?php echo strtoupper(nl2br($modelInvoice->billing_address)); ?></span>
   <table class="" style="width:100%">
                <tr>
                        <td style="width: 100px">Tel</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;">
                            <?php echo strtoupper($modelInvoice->customer->customer_phone_no); ?>
                        </td>
                </tr>
                <tr>
                    <td>Fax</td>
                        <td>:</td>
                    <td>
                        <?php echo strtoupper($modelInvoice->customer->customer_fax); ?>
                    </td>
                </tr>
                <tr>
                    <td>TRN</td>
                        <td>:</td>
                    <td>
                        <?php echo strtoupper($modelInvoice->customer->customer_trn_no); ?>
                    </td>
                </tr>
                <tr>
                    <td>Attn.</td>
                        <td>:</td>
                    <td>
                        <?php echo  strtoupper($modelInvoice->contact->person_name); ?>
                    </td>
                </tr>
                   <tr>
                    <td><b>TAX INVOICE #</b></td>
                        <td>:</td>
                    <td style="text-align:left;">
                        <b><?php echo /*$modelInvoice->invoice_no.'/'.*/$modelInvoice->id;?></b>
                    </td>
                </tr>
            </table>  
  <!--
  <br />

  Tel	:	<?php echo strtoupper($modelInvoice->customer->customer_phone_no); ?><br />

  Fax	:	<?php echo strtoupper($modelInvoice->customer->customer_fax); ?><br />
  
  TRN	:   <?php echo strtoupper($modelInvoice->customer->customer_trn_no); ?></span><br />

  Attn.	:	<?php echo  strtoupper($modelInvoice->contact->person_name); ?></span><br />

 TAX INVOICE #:	<?php echo /*$modelInvoice->invoice_no.'/'.*/$modelInvoice->id;?></span><br />
 
 -->

  </div>

 </div>

 <div style="text-align:right; float:right;padding-left: 60px; width:40%;" >
     
    <table class="table" style="width:100%">
                <tr>
                <?php
                $modelQuotation         =   Quotes::model()->find(array('condition'=>'file_id="'.$modelInvoice->file_id.'"'));
                $qtn_day_superscript    =   '<sup>'.date('S',STRTOTIME($modelQuotation->qtn_start_date)).'</sup>';
                $qtn_day                =   date('d',STRTOTIME($modelQuotation->qtn_start_date));
                $qtn_month              =   date('M',STRTOTIME($modelQuotation->qtn_start_date));
                $qtn_year               =   date('Y',STRTOTIME($modelQuotation->qtn_start_date));
                $quotation_date         =   $qtn_day.$qtn_day_superscript." ".$qtn_month." ".$qtn_year;
                ?>
                        <td class="bc-tl">Qtn.#/Ord.#</td>
                        <td>
                            <?php echo (!empty($modelQuotation->id))?$modelQuotation->id:"NA";?> / <?php echo (!empty($modelInvoice->order_id))?$modelInvoice->order_id:"NA";?>
                        </td>
                </tr>
                <tr>
                    <td>Invoice Date</td>
                    <td>
                        <?php echo date('d/m/Y',STRTOTIME($modelInvoice->invoice_date));?>
                    </td>
                </tr>
                <tr>
                    <td>Delivery No</td>
                    <td>
                        <?php echo $modelInvoice->delivery_ids;?>
                    </td>
                </tr>
                <tr>
                    <td>Delivery Date</td>
                    <td>
                        <?php 
                        if($modelInvoice->delivery_ids!=''){
                            $model_delivery_note_date = DeliveryNote::model()->findAll(array('condition'=>'id IN ('.$modelInvoice->delivery_ids.')'));
                            $arr_delivery_date=array();
                            foreach($model_delivery_note_date as $b=>$delivery_date){
                              $arr_delivery_date[]=date('d/m/Y',STRTOTIME($delivery_date->delivery_date));
                            }
                        echo implode(',',$arr_delivery_date);
                        }
                        ?>
                    </td>
                </tr>
                <tr>
                    <td>Currency</td>
                    <td>
                        <?php echo $modelInvoice->currencyname->currency_code;?>
                    </td>
                </tr>
                   <tr>
                    <td>LPO</td>
                    <td>
                        <?php echo $modelInvoice->order_lpo_no;
                        if ($modelInvoice->order_lpo_date!='' && $modelInvoice->order_lpo_date!='0000-00-00') {
                            echo ' , '.date("d/m/Y", strtotime($modelInvoice->order_lpo_date));
                        }
                        ?>
                    </td>
                </tr>
                <!--tr>
                    <td colspan="2">
                        <?php //echo $modelInvoice->leadowner->first_name.' '.$modelInvoice->leadowner->last_name.' , '.$modelInvoice->leadowner->phno;?>
                    </td>
                </tr-->
            </table>  
     
     

  <!--span>Date	:	<?php echo date('d/m/Y',STRTOTIME($modelInvoice->invoice_date));?></span><br />

  <span>LPO #	:	<?php echo $modelInvoice->order_details->lpo;?></span><br />
  
  <span>LPO Date 	:	<?php echo date('d/m/Y',STRTOTIME($modelInvoice->invoice_date));?></span><br />
  
  <span>DO #	:	<?php echo $modelInvoice->order_details->lpo;?></span><br />
  
  <span>DO Date	:	<?php echo date('d/m/Y',STRTOTIME($modelInvoice->invoice_date));?></span><br /-->

  </div>

 </div>
<br/>
<br/>
  <div style="float:right;margin-right: 30%; width:60%;padding: 5px 10px; border: 1px solid #7D26CD;border-radius: 4px;font-size:18px;margin-top:4px;margin-bottom:8px;width:270px;" align="center">
                    <b>TAX INVOICE / <span style="font-family:tahoma;">فاتورة ضريبية </span></b>
        </div> 
 <br/>
 <div style="width:100%;float:left;padding-top:10px;font-size:9px; font-family:'Times New Roman', Times, serif">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
            <thead>
                <tr>
                    <th width="5%" align="center" valign="middle" scope="col">Sr #</th>
                     <?php if($type==2){?>
                    <th width="35%" align="center" valign="middle" scope="col">Part No</th>
                    <?php } ?>
                    <?php if($type==3){?>
                    <th width=" " align="center" valign="middle" scope="col">OEM No</th>
                    <?php } ?>
                     <?php if($type==1){?>
                      <th width=" " align="center" valign="middle" scope="col">Item Description</th>
                      <?php } ?>
      <th width="10%" align="center" valign="top" scope="col">Qty</th>
                    
        <th width="8%" align="left" valign="top" scope="col">U. Price<br>(<?php echo $modelInvoice->currencyname->currency_code ?>)
      </th>
        <th width="8%" align="center" valign="top" scope="col">Total </br/>Discount</th>
         <th width="8%" align="left" valign="top" scope="col">Amt<br>(<?php echo $modelInvoice->currencyname->currency_code ?>)
      </th>
        <th width="8%" align="center" valign="top" scope="col">Tax(%)</th>
      <th width="8%" align="center" valign="top" scope="col">Tax Amt</th>
      <th width="10%" align="left" valign="top" scope="col">T. Price<br>(<?php echo $modelInvoice->currencyname->currency_code ?>)
      </th>
                   
                    
                </tr>
            </thead>
            <tbody>
               
                    <?php
                $m=1;
                $condition .= '1=1';
                $col='4';
                if($bonus_quantity=="Y"){
                    $col = $col+1;
                }
                $condition .= ' AND t.invoice_id ="' . $id.'"';
                $total=$total_vat=$total_amount=0;
                $model_invoice_details = InvoiceItem::model()->findAll(array('condition'=>$condition,'order'=>'id asc'));
                foreach ($model_invoice_details as $i =>  $modelInvoiceItem) {
                    $batch_no='';$sl_no='';
                    $quantity_text=$pdt_serial_no='';
                    if($modelInvoiceItem->invoice_item_type=="D"){
                        //Serial No
                        $pdt_description=$modelInvoiceItem->description; 
                        $pdt_serial_no = substr($pdt_description, strpos($pdt_description, "#") + 1);
                        $model_machine_normal_usage =OrderMachinehours::model()->with('machine_order')->find(array('select' => 'count(DISTINCT(work_date)) as id','condition' => 'order_id = "'.$modelInvoice->order_id.'" and work_date>="'.$modelInvoice->invoice_start_date.'" and work_date<="'.$modelInvoice->invoice_end_date.'" AND overtime_type="N" and product_id="'.$modelInvoiceItem->product_id.'" and serial_no="'.$pdt_serial_no.'"'));   
                        $days = $model_machine_normal_usage->id; 
                        $days_text='day';
                        if($days>1){
                           $days_text='days'; 
                        }
                        $quantity_text=' Machine <br/>'.$days.' '.$days_text;
                    }
                    if($modelInvoiceItem->invoice_item_type=="O"){
                        $model_machine_normal_overtime =OrderMachinehours::model()->with('machine_order')->find(array('select' => 'count(t.id) as id','condition' => 'order_id = "'.$modelInvoice->order_id.'" and work_date>="'.$modelInvoice->invoice_start_date.'" and work_date<="'.$modelInvoice->invoice_end_date.'" AND overtime_type="N" and product_id="'.$modelInvoiceItem->product_id.'" AND overtime_hrs!="00:00:00"'));
                        $days =  $model_machine_normal_overtime->id; 
                        $days_text='day';
                        if($days>1){
                           $days_text='days'; 
                        }
                        $quantity_text=' Machine <br/>'.$modelInvoiceItem->duration;
                        if($modelInvoiceItem->duration>1){
                            $quantity_text.=' Hrs';
                        }else{
                            $quantity_text.=' Hr';
                        }
                    }
                    if($modelInvoiceItem->invoice_item_type=="H"){
                        $model_machine_holiday_overtime =OrderMachinehours::model()->with('machine_order')->find(array('select' => 'count(t.id) as id','condition' => 'order_id = "'.$modelInvoice->order_id.'" and work_date>="'.$modelInvoice->invoice_start_date.'" and work_date<="'.$modelInvoice->invoice_end_date.'" AND overtime_type="H" and product_id="'.$modelInvoiceItem->product_id.'" AND overtime_hrs!="00:00:00"'));
                        $days =  $model_machine_holiday_overtime->id; 
                        $days_text='day';
                        if($days>1){
                           $days_text='days'; 
                        }
                        $quantity_text=' Machine <br/>'.$modelInvoiceItem->duration;
                        if($modelInvoiceItem->duration>1){
                            $quantity_text.=' Hrs';
                        }else{
                            $quantity_text.=' Hr';
                        }
                    }
                ?>
                 <tr>
                        <td class="text-center">
                            <?php echo $m;?>
                        </td>
                       
                       <td>
                           <?php if($type==1){echo nl2br($modelInvoiceItem->description);}?>
                             <?php if($type==2){echo nl2br($modelInvoiceItem->product->part_number);}?>
                             <?php if($type==3){echo nl2br($modelInvoiceItem->product->oem_number);}?>
                            <?php ?>
                            <?php if($modelInvoiceItem->product->have_expiry_date=='Y'){
                                    $batch_no=StockLedger::getBatchNoWithExpDate($modelInvoice->delivery_ids,$modelInvoiceItem->product_id,'DELIVERY_NOTE');
                                ?>
							
                            <br/>
                             M/c 1 Sr.# <?php echo $batch_no;?>
                            <?php } ?>
                            <?php if($modelInvoiceItem->product->have_serial_no=='Y'){
                                $sl_no=HiringPackageDetails::getSerialNo($modelInvoice->delivery_ids,$modelInvoiceItem->product_id);
                                if($type==2 || $type==3){
                                ?>                            
                             <br/>M/c 1 Sr.#<?php echo $pdt_serial_no; ?>
                            <?php 
                                }
                                } ?>
                            <br/>
                           <?php if($modelInvoiceItem->invoice_item_type!="S"){ ?>
                            Period : <?php echo date('d/m/Y',STRTOTIME($modelInvoiceItem->invoice_from)).'-'.date('d/m/Y',STRTOTIME($modelInvoiceItem->invoice_to));
                                                                              }?>
                            
                        </td>
                        <td class="text-center"><?php echo (int) $modelInvoiceItem->quantity_hiring.' '.$quantity_text;?></td>
                        <td class="text-right"><?php 
                        if($modelInvoiceItem->unitprice_hiring!=''){
                            $unitprice_hiring_text=$modelInvoiceItem->unitprice_hiring;
                            $num=number_format((float)$unitprice_hiring_text, 2, '.', '');
                            echo Yii::app()->numberFormatter->formatCurrency($num," ");
                            echo str_replace($num, '', $unitprice_hiring_text);
                        }
                            ?></td> 
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoiceItem->deduction_amount," ");?>
                        </td>
                        <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoiceItem->net_amount," ");?>
                        </td> 
                        <td class="text-right">
                            <?php echo (int) $modelInvoiceItem->tax_vat_percentage;?>
                        </td>
                         <td class="text-right">
                            <?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoiceItem->tax_vat_amount," ");?>
                        </td>
                        <td class="text-right"><?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoiceItem->net_amount+$modelInvoiceItem->tax_vat_amount," ");?></td>
                </tr>
                
                    <?php
                        $m=$m+1;
                        $total+=$modelInvoiceItem->net_amount+$modelInvoiceItem->tax_vat_amount;
                        $total_vat+=$modelInvoiceItem->tax_vat_amount;
                        $total_amount+=$modelInvoiceItem->net_amount;
         
        }
        ?>
        
             <tr>
                <td class="text-left"  colspan="5"><b>Total</b></td>
                 <td class="text-right" ><b><?php echo Yii::app()->numberFormatter->formatCurrency($total_amount," ");?></b></td>
                 <td></td>
                <td class="text-right" ><b><?php echo Yii::app()->numberFormatter->formatCurrency($total_vat," ");?></b></td>
                <td class="text-right" ><b><?php echo Yii::app()->numberFormatter->formatCurrency($total," ");?></b></td>
                </tr>  
                    <?php
                    $total_advance_taken=0.00;
                    $model_advance_deduction=InvoiceAdvanceDeduction::model()->findAll(array('condition'=>'invoice_id="'.$id.'"'));
                    if(!empty($model_advance_deduction)){
                        foreach ($model_advance_deduction as $k=>$detail)
                        {
                    ?>
                    <tr>
                        <?php
                        $total-=$detail->advance_deduction;
                        $total_advance_taken+=$detail->advance_without_tax;
                        ?>
                        <td class="text-left"  colspan="5"><b><?php echo $detail->description; ?></b></td>
                        <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($detail->advance_without_tax," ");?></b></td>
                        <td></td>
                        <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($detail->advance_tax_amount," ");?></b></td>
                        <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($detail->advance_deduction," ");?></b></td>
                    </tr>
                    <?php
                        }
                        $invoice_total_amt_without_tax=$total_amount-$total_advance_taken;
                        ?>
                        <tr>
                            <td class="text-left"  colspan="5"><b></b></td>
                             <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($invoice_total_amt_without_tax," ");?></b></td>
                            <td></td>
                            <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoice->total_tax_amount," ");?></b></td>
                            <td class="text-right"><b><?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoice->total_tax_amount+$invoice_total_amt_without_tax," ");?></b></td>
                        </tr>
                    <?php
                    }
                    $grand_total=$modelInvoice->grand_total;
                    $Addition=InvoiceAddition::model()->findAll(array('condition'=>'invoice_id='.$id.' AND calculated_value>0'));
                    $Dedution=InvoiceDeduction::model()->findAll(array('condition'=>'invoice_id='.$id.' AND calculated_value>0'));
                    if(!empty($Addition))
                    {
                        foreach ($Addition as $eachAddition)
                        {
                      ?>
                        <tr>
                            <td class="text-right"  colspan="8"><?php echo MasFooterItems::getFooterItemName($eachAddition->particular); ?></td>
                            <td class="text-right">+<?php echo Yii::app()->numberFormatter->formatCurrency($eachAddition->calculated_value," ");?></td>
                        </tr>
                    <?php
                        }
                    }
                    if(!empty($Dedution))
                    {
                        foreach ($Dedution as $eachDed)
                        {
                      ?>
                        <tr>
                            <td class="text-right"  colspan="8">
                                <?php echo MasFooterItems::getFooterItemName($eachDed->particular);?></td>
                            <td class="text-right"><?php echo '-'.Yii::app()->numberFormatter->formatCurrency($eachDed->calculated_value," ");?></td>
                        </tr>
                        <?php
                        }
                    }
                    ?>
                    <tr>
                        <td class="text-center"  colspan="1"><b>G.Total</b></td>
                        <td colspan="7"><b>
                            <?php if($total > 0){
                                    echo MasCurrency::number_to_currency(number_format(($modelInvoice->grand_total), 2, '.', ''), $modelInvoice->currency);
                                }
                            ?>
                                
                        </b></td>
                        <td class="text-right" ><b><?php echo Yii::app()->numberFormatter->formatCurrency($modelInvoice->grand_total," ");?></b></td>
                    </tr>
                    
                    
                   
             
                        
                   
                          
                           
            </tbody>
        </table>
    </div>
  <?php 
         
         if($modelInvoice->payment_terms!=0)
       {
       ?>
        <div class="box" style="width:100%">
            <h5>Payment Terms</h5>
            <div class="h5sub-details">
                <?php echo nl2br ($modelInvoice->paymentTerm->payment_terms); ?>
            </div>
        </div>
        <?php } ?>
             <?php $model =  OwnerBankDetails::model()->find(array('condition' => 'currency_id='.$modelInvoice->currency)); 
          if(empty($model))
              $model =  OwnerBankDetails::model()->find(array('condition' => 'currency_id=23'));   
          if(!empty($model)){
    ?>
    

          <div class="box"  style="width: 100%;">
                <h5>Bank Details</h5>
                <table class="" style="width:100%">
                <tr>
                        <td style="width: 90px">Account Name</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank_account_name; ?></td>
                        
                        <td style="width: 90px">Account No</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank_ac_no; ?></td>
                </tr>
                <tr>
                        <td style="width: 90px">Bank Name</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank->bank_name; ?></td>
                        
                        <td style="width: 90px">Bank Branch</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank_branch; ?></td>
                </tr>
                <tr>
                        <td style="width: 90px">IBAN #</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank_iban; ?></td>
                        
                        <td style="width: 90px">Swift Code</td>
                        <td style="width: 2px">:</td>
                        <td style="float: left;"><?php echo $model->bank_swift; ?></td>
                </tr>
                </table>
            </div>
          <?php } ?>
        <?php if($modelInvoice->terms_and_conditions!='')
       {
       ?>
    <div style='page-break-after:always'></div>
       <div class="box" style="width:100%">
            <h5>Terms & Conditions</h5>
            <div class="h5sub-details">
                <?php echo nl2br($modelInvoice->terms_and_conditions); ?>
                <br>
                <b>All other Terms and Conditions as per our Quotation# <?php echo $modelQuotation->id;?> dated <?php echo $quotation_date;?>.</b>
            </div>
        </div>
        <?php
       }
      ?>
            <?php if($modelInvoice->notes!='')
       {
       ?>

         <div class="box" style="width:100%">
                <h5>Notes</h5>
                <div class="h5sub-details">
                    <?php echo  nl2br ($modelInvoice->notes); ?>
                </div>
            </div>
            <?php } ?> 
</div>
<br>
<br>

<div style="width:100%;float:left;font-size:12px;margin-top:5px; font-family:'Times New Roman', Times, serif">

 <div style="width:50%;float:left;">
     
      <span>For and on behalf of,</span><br />

 <span><b>ACE CENTRO ENTERPRISES</b></span>

     
  



 </div>

 

  <div style="width:50%;float:left;margin-left:105px;margin-top:5px; font-family:'Times New Roman', Times, serif">

    <span>Terms and conditions accepted by:</span><br />

 <span><b><?php echo strtoupper($modelInvoice->customer->customer_name); ?></b></span>
 </div>

</div>



<div style="width:100%;float:left; text-align:center;font-size:12px;">

 <p style="padding:0px;margin:0px;">Sign</p> 
 <p style="padding:0px;margin:0px;">Date</p> 
 <p style="padding:0px;margin:0px;">Stamp</p> 

</div>



<div style="width:100%;float:left;font-size:12px;">

  <div style="width:50%;float:left; font-family:'Times New Roman', Times, serif">

 
<div style="border-bottom:1px solid #000;width:150px; "></div>

 <span><b>Name:</b></span><br />

 <em>Finance Department</em><br />

 <span>Cell : +971 55 504 0033</span><br />

 </div>

 <div style="width:50%;float:left;font-size:12px;margin-left:105px; font-family:'Times New Roman', Times, serif">

 
<div style="border-bottom:1px solid #000;width:150px;"></div>

<span><b><?php echo  strtoupper($modelInvoice->contact->person_name); ?></b></span><br />
<em><?php if(!empty($modelInvoice->contact->designation)){ echo $modelInvoice->contact->designation;}else{?>Authorized Signatory<?php } ?></em><br />
<span>Cell : <?php echo  strtoupper($modelInvoice->contact->contact_mobile_no); ?></span><br />


 

 </div>

</div>





 </div>






 </div>
 

<htmlpagefooter name="firstfooter">
<div style="text-align:right;width:100%;"><i>Contd...</i></div> 
<div style="text-align:center;width:100%;"><img src="images/innovating.png" /></div> 
    <div style="text-align:center;width:100%;font-size:10px;font-family:'Times New Roman', Times, serif"> This invoice has been electronically generated by<?php echo $footer_company_name;?>on
    <?php  date_default_timezone_set("Asia/Dubai");
        echo date('d/m/Y h:i:s a',strtotime($modelInvoice->created_datetime)); ?> and is valid without signature.
    </div>
</htmlpagefooter>
<sethtmlpagefooter name="firstfooter" page="all" value="on" />
 
 <htmlpagefooter name="lastfooter">
<div style="text-align:right;width:100%;">Contd...</div> 

<div style="text-align:center;width:100%;"><img src="images/innovating.png" /></div>
    <div style="text-align:center;width:100%;font-size:10px;font-family:'Times New Roman', Times, serif"> This invoice has been electronically generated by<?php echo $footer_company_name;?>on
    <?php  date_default_timezone_set("Asia/Dubai");
        echo date('d/m/Y h:i:s a',strtotime($modelInvoice->created_datetime)); ?> and is valid without signature.
    </div>
</htmlpagefooter>
<sethtmlpagefooter name="lastfooter" value="off" />

<htmlpagefooter name="myfooter">
    
<div style="text-align:center;width:100%;"><img src="images/innovating.png" /></div>
        <div style="text-align:center;width:100%;font-size:10px;font-family:'Times New Roman', Times, serif"> This invoice has been electronically generated by<?php echo $footer_company_name;?>on
    <?php  date_default_timezone_set("Asia/Dubai");
        echo date('d/m/Y h:i:s a',strtotime($modelInvoice->created_datetime)); ?> and is valid without signature.
    </div>
</htmlpagefooter>
<sethtmlpagefooter name="myfooter" page="all" value="on" />
 
</body>

</html>


<?php //exit;?>
