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); }
$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; } else {
function compute_tax() { $t = new Tax_table(); $t->where('monthly', $this->tax_table_status); $t->where('status', 'percent_over'); $t->get(); $tax = $this->taxable_amount - $this->bracket_amount; // The column in tax table like bracket7 $column = $this->column; $int = intval($t->{$column}); $decimal = floatval($int . "%") / 100; // like 30% to 0.3 $tax = $tax * $decimal; $t->where('monthly', $this->tax_table_status); $t->where('status', 'exemption'); $t->get(); $add_exemption = $t->{$column}; $tax = $tax + $add_exemption; $this->wtax = $tax; $this->total_deduction += $this->wtax; }