Example #1
0
 $d->order_by('report_order');
 $infos = $d->get_by_deduction_agency_id($agency->id);
 ?>
 
 <?php 
 foreach ($infos as $info) {
     ?>
 	
     <?php 
     // To do: we are going to check for active deductions per employee
     $dl = new Deduction_loan();
     $dl->where('employee_id', $employee->id);
     $dl->where('deduction_information_id', $info->id);
     $dl->get();
     $deduct = 0;
     if ($dl->exists()) {
         $deduct = $dl->monthly_due;
         // Deduct from salary
         $net_pay_monthly = $net_pay_monthly - $dl->monthly_due;
     }
     // If tax
     if ($info->code == 'Tax Withheld') {
         $tt = new Tax_table();
         $tt->where('start_range <', $monthly_salary);
         $tt->order_by('start_range', 'DESC');
         $tt->get(1);
         // The tax fix amount
         // If fix amount is not equal to zero meaning the
         // salary is more than 10,000.00
         if ($tt->fix_amount != 0) {
             $tax_with_held = $tt->fix_amount;