?
Current Path : /home1/savoy/public_html/savoyglobal.net/hr/application/views/Timesheet/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/hr/application/views/Timesheet/single_invoice.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); $start_date=$this->mastermodel->convertdateformat($viewinfo->invoice_start_date); $end_date=$this->mastermodel->convertdateformat($viewinfo->invoice_end_date); $poinfo=$this->mastermodel->get_data('payroll_invoice_purchase_order',$viewinfo->invoice_id,'invoice_id'); $purchase_order_id=''; foreach($poinfo as $po) $purchase_order_id.=$po['po_id'].'~'; $job_info=$this->timesheetmodel->get_jobs_info($purchase_order_id); $client_timesheet=$this->timesheetmodel->get_client_timesheet_invoice_info($purchase_order_id,$start_date,$end_date); $manpower_timesheet=$this->timesheetmodel->get_manpower_timesheet_invoice_info($purchase_order_id,$start_date,$end_date); ?> <link href="<?=base_url()?>assets/css/tablesortnew.css" rel="stylesheet" type="text/css"/> <div class="select-bar"> <label><img src="<?=base_url()?>assets/images/backbutton.png" title="Back" class="clickimage" onclick="viewdata('timesheet','viewintimesheetsearch','search_invoice','view_invoice','<?=$_SESSION['pagenum'];?>')" alt="Back" align = "center" width="25" height="25" /> </label> <span class="heading">Invoice Details</span> </div> <fieldset> <?php $attributes=array('id'=>'validateform','class'=>'customForm'); echo form_open('',$attributes); ?> <ul> <li> <label for="data">Timesheet Start Date</label> <div class="record_entry"> <?=$this->mastermodel->convertdatenormalformat($start_date);?> </div> </li> <li> <label for="data">Timesheet End Date</label> <div class="record_entry"> <?=$this->mastermodel->convertdatenormalformat($end_date);?> </div> </li> <input type="hidden" name="invoice_id" id="invoice_id" value="<?=$viewinfo->invoice_id;?>"/> <li> <table class="sort" cellpadding="0" cellspacing="0" width="200px;"> <tr> <th>Customer Name</th> <th>Customer Purchase Order No</th> <th>Site</th> </tr> <tr> <?php $i=1; foreach($job_info as $list) { ?> <td><?=$list['customer_name'];?></td> <td><?=$list['customer_purchase_order_no'];?></td> <td> <?=$list['site_name'];?> <input type="hidden" name="purchase_order_id_<?=$i++;?>" value="<?=$list['purchase_order_id'];?>"/> </td> </tr> <?php } ?> </table> </li> <li> <table class="sortnew"> <tr><th colspan='2' style="text-align: center">Invoice Details</th></tr> <tr> <td>Invoice Date</td> <td> <?php echo $this->mastermodel->convertdatenormalformat($viewinfo->invoice_date); ?> </td> </tr> <tr> <td>Invoice No</td> <td> <?php echo $viewinfo->invoice_no; ?> </td> </tr> <tr> <td>Status</td> <td> <?php echo $viewinfo->invoice_status; ?> </td> </tr> <tr> <td>Remarks</td> <td> <?php echo $viewinfo->invoice_remarks;; ?> </td> </tr> <tr> <td>Document</td><td> <?php if($viewinfo->invoice_document != "") { ?> <a href="<?=base_url()?>assets/uploads/<?=$viewinfo->invoice_document;?>">Download</a> <?php } ?> </td></tr></table> <table class="sortnew"> <tr><th colspan='2' style="text-align: center">Invoice Template</th></tr> <tr> <td>Invoice Heading</td> <td> <?php echo $viewinfo->invoice_heading; ?> </td> </tr> </table> <table class="sortnew"> <tr> <th colspan="3">Invoice Template Header Fields</th> </tr> <tr> <th>Label</th> <th>Value</th> </tr> <?php $i=1; $invoice_fields=$this->mastermodel->get_data('payroll_invoice_field',$viewinfo->invoice_id,'invoice_id'); foreach($invoice_fields as $k=>$row) { ?> <tr> <td><?=$row['label_text']?></td> <td><?=$row['label_value']?></td> </tr> <?php } ?> </table> </li> <li> <table class="sort"> <caption>Invoice Information</caption> <tr> <th>Sl No</th> <th>Trade</th> <th>Manpower</th> <th>Man Hrs</th> <th>Rate/Hr</th> <th>Amount</th> </tr> <?php $slno=1; $grand_total=0; $man=array(); foreach($client_timesheet as $clientsheet) { $normal_hours=$clientsheet['normal_hours']; if($clientsheet['ot_rate']==$clientsheet['normal_rate']&&$clientsheet['hot_rate']==$clientsheet['normal_rate']) { $normal_hours+=$clientsheet['ot_hours']; $normal_hours+=$clientsheet['hot_hours']; $flag=0; } else $flag=1; ?> <tr> <td rowspan="3"><?=$slno++;?></td> <td><?=rtrim($clientsheet['trade_name'], '- ');?></td> <td rowspan="3"><?=$clientsheet['manpower'];?></td> <td style="text-align: right;"> <?php echo number_format($normal_hours,2); ?> </td> <td style="text-align: right;"><?=number_format($clientsheet['normal_rate'],2);?></td> <td style="text-align: right;"> <?php echo number_format($normal_hours*$clientsheet['normal_rate'],2); ?> </td> </tr> <tr> <?php if($flag==1) { ?> <td>OT</td> <td style="text-align: right;"><?=number_format($clientsheet['ot_hours'],2);?></td> <td style="text-align: right;"> <?php echo number_format($clientsheet['ot_rate'],2); ?> </td> <td style="text-align: right;"> <?php echo number_format($clientsheet['ot_hours']*$clientsheet['ot_rate'],2); ?> </td> <?php } ?> </tr> <tr> <?php if($flag==1) { ?> <td>HOT</td> <td style="text-align: right;"><?=number_format($clientsheet['hot_hours'],2);?></td> <td style="text-align: right;"> <?php echo number_format($clientsheet['hot_rate'],2); ?> </td> <td style="text-align: right;"> <?php echo number_format($clientsheet['hot_hours']*$clientsheet['hot_rate'],2); ?> </td> <?php } ?> </tr> <?php $total_amount = $normal_hours*$clientsheet['normal_rate'] + $clientsheet['ot_hours']*$clientsheet['ot_rate'] + $clientsheet['hot_hours']*$clientsheet['hot_rate']; $grand_total+=$total_amount; } ?> <tr> <th colspan="5" style="text-align: right;font-weight: bold;">Total</th> <th style="text-align: right;font-weight: bold;"><?=number_format($grand_total,2);?></th> </tr> </table> </li> </ul> <?php echo form_close();?> </fieldset>