예제 #1
0
 // 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;
         //echo $tax_with_held;
         // Well lets check how much excess
         $excess = $monthly_salary - $tt->start_range;
         $percentage = intval($tt->percentage);
         // Add the excess to tax with held
         $tax_percentage = $excess / 100 * $percentage;
         $tax_with_held = $tax_with_held + $tax_percentage;
         //echo $tax_percentage;
         //echo $excess;
예제 #2
0
 function tax_table()
 {
     $data['page_name'] = '<b>Tax Table</b>';
     $data['msg'] = '';
     $p = new Tax_table();
     $this->load->library('pagination');
     $config['base_url'] = base_url() . 'payroll/remittance/pae/';
     $config['total_rows'] = $p->get()->count();
     $config['per_page'] = '15';
     $this->pagination->initialize($config);
     // How many related records we want to limit ourselves to
     $limit = $config['per_page'];
     // Set the offset for our paging
     $offset = $this->uri->segment(3);
     // Get all positions
     //$p = new Position();
     $p->order_by('id');
     $data['deductions'] = $p->get($limit, $offset);
     $data['main_content'] = 'remittance/tax_table/tax_table';
     return View::make('includes/template', $data);
 }