|
|
|
@ -517,22 +517,22 @@ class PayrollController extends BaseController
|
|
|
|
|
$data['incomeList'] = $incomeDeductionModel->where("is_income", 1)->findAll();
|
|
|
|
|
$data['deductionList'] = $incomeDeductionModel->where("is_income", 0)->findAll();
|
|
|
|
|
|
|
|
|
|
$empPayTrans = (new EmployeePayTransactionModel())->getEmpPayTransByPayGroupId($data['paygroupid']);
|
|
|
|
|
$empPayTrans = (new EmployeePayTransactionModel())->getEmpPayTransByPayTransIdGroupId($paytransid, $data['paygroupid']);
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable = new \CodeIgniter\View\Table();
|
|
|
|
|
$empPayTransHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
|
|
|
|
|
|
|
|
|
|
if($empPayTrans == null)
|
|
|
|
|
{
|
|
|
|
|
$empPayTrans = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($data['paygroupid'], $payTrans->paytype_id);
|
|
|
|
|
$empPayTrans = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($paytransid, $data['paygroupid'], $payTrans->paytype_id);
|
|
|
|
|
$data['showInitBtn'] = true;
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->setHeading('ID', 'Company ID', 'Name', 'Branch', 'Daily Basic');
|
|
|
|
|
$empPayTransHTMLTable->setHeading('ID', 'Company ID', 'Name', 'Branch', 'Daily Basic', 'Work Days');
|
|
|
|
|
|
|
|
|
|
foreach($empPayTrans as $trans)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->addRow($trans->employee_id, $trans->company_issued_id, $trans->last_name . ', ' . $trans->first_name, $trans->branch_code, $trans->basic_monthly_pay);
|
|
|
|
|
$empPayTransHTMLTable->addRow($trans->employee_id, $trans->company_issued_id, $trans->last_name . ', ' . $trans->first_name, $trans->branch_code, $trans->basic_monthly_pay, $trans->att_work_days);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$data['tblEmpPayTrans'] = $empPayTransHTMLTable->generate();
|
|
|
|
@ -563,7 +563,7 @@ class PayrollController extends BaseController
|
|
|
|
|
|
|
|
|
|
public function empPayTransInitializePayroll($paytransid, $paygroupid, $transtypid)
|
|
|
|
|
{
|
|
|
|
|
$empPayInfos = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($paygroupid, $transtypid);
|
|
|
|
|
$empPayInfos = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($paytransid, $paygroupid, $transtypid);
|
|
|
|
|
$payTrans = (new PayrollTransactionModel())->where('paytrans_id', $paytransid)->first();
|
|
|
|
|
$empPayTransactionModel = new EmployeePayTransactionModel();
|
|
|
|
|
|
|
|
|
@ -598,7 +598,7 @@ class PayrollController extends BaseController
|
|
|
|
|
'has_hdmf' => $empPayInfo->has_hdmf,
|
|
|
|
|
'has_sss' => $empPayInfo->has_sss,
|
|
|
|
|
'has_gsis' => $empPayInfo->has_gsis,
|
|
|
|
|
'actual_work_days' => $payTrans->no_of_days,
|
|
|
|
|
'actual_work_days' => $empPayInfo->att_work_days,
|
|
|
|
|
'basic_pay' => 0,
|
|
|
|
|
'gross_income' => 0,
|
|
|
|
|
'taxable_income' => 0,
|
|
|
|
@ -621,6 +621,10 @@ class PayrollController extends BaseController
|
|
|
|
|
$empPayTransInDedModel = new EmpPayTransIncomeDeductionModel();
|
|
|
|
|
|
|
|
|
|
$payCompute = new PayrollComputation();
|
|
|
|
|
$rawData = ['amount'=>$empPayInDed->amount,
|
|
|
|
|
'is_fixed_amt'=>$empPayInDed->is_fixed_amt,
|
|
|
|
|
'is_percent_amt'=>$empPayInDed->is_percent_amt,
|
|
|
|
|
'worked_days_based'=>$empPayInDed->worked_days_based];
|
|
|
|
|
$amount = $payCompute->computeIncomeDeductionByComputationType($rawData, $empPayTransaction);
|
|
|
|
|
|
|
|
|
|
$empPayTransInDed->fill(
|
|
|
|
|