@ -154,7 +154,7 @@ class PayrollController extends BaseController
$incomeDeductions = (new IncomeDeductionModel())->findAll();
$inDedHTMLTable = new \CodeIgniter\View\Table();
$inDedHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
$inDedHTMLTable->setTemplate(MiscLib::adminLTEData Table1 Template("tblIncomeDeduction" ));
if ($incomeDeductions == null)
$data['tblIncomeDeduction'] = '< p > No income and deduction found.< / p > ';
@ -173,7 +173,7 @@ class PayrollController extends BaseController
$iconView = '< a href = "/payroll/indedtransupdate/'.$incomeDeduction->inded_id.'" class = "ml-3" data-toggle = "tooltip" title = "View Affected Transactions" > < i class = "fas fa-eye " > < / i > < / a > ';
$iconEdit = '< a href = "#" class = "ml-3" ' . $ indedHTMLData . ' onclick = "editIncomeDeduction(this)" data-toggle = "tooltip" title = "Edit Deduction Information" > < i class = "fas fa-edit" > < / i > < / a > ';
$iconDelete = '< a href = " # " class = "ml-3" data-toggle = "tooltip" title = "Delete Deduction Information" > < i class = "fas fa-trash" > < / i > < / a > ';
$iconDelete = '< a href = " /payroll/delinded/'.$incomeDeduction->inded_id.'" onclick = "return confirm(\'Are you sure you want to delete this Income or Deduction?\') " class = "ml-3" data-toggle = "tooltip" title = "Delete Deduction Information" > < i class = "fas fa-trash" > < / i > < / a > ';
$inDedHTMLTable->addRow($incomeDeduction->inded_id, $incomeDeduction->payslip_display, $incomeDeduction->inded_name, ($incomeDeduction->is_income) ? 'Yes' : 'No', ($incomeDeduction->is_taxable) ? 'Yes' : 'No', ($incomeDeduction->include_in_gross) ? 'Yes' : 'No', $iconView . ' ' . $iconEdit . ' ' . $iconDelete);
}
@ -256,6 +256,16 @@ class PayrollController extends BaseController
return redirect()->back()->with('message', $updateCount . ' items in Income or Deduction was Successfully Updated');
}
public function deleteIncomeDeduction($indedid)
{
$incomeDeductionModel = new IncomeDeductionModel();
if ($incomeDeductionModel->delete($indedid))
return redirect()->back()->with('message', 'Income or Deduction Successfully Deleted');
else
return redirect()->back()->with('error', 'Failed to delete income or deduction');
}
public function payrollType()
{
$payrollTypes = (new PayrollTypeModel())->findAll();