|
|
@ -15,6 +15,8 @@ use App\Models\EmpPayIncomeDeductionModel;
|
|
|
|
use App\Models\SettingsModel;
|
|
|
|
use App\Models\SettingsModel;
|
|
|
|
use App\Models\PayrollScheduleModel;
|
|
|
|
use App\Models\PayrollScheduleModel;
|
|
|
|
use App\Models\PayrollTransactionModel;
|
|
|
|
use App\Models\PayrollTransactionModel;
|
|
|
|
|
|
|
|
use App\Models\EmployeePayTransactionModel;
|
|
|
|
|
|
|
|
use App\Models\EmpPayTransIncomeDeductionModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Entities
|
|
|
|
// Entities
|
|
|
@ -27,6 +29,8 @@ use App\Entities\EmpPayIncomeDeduction;
|
|
|
|
use App\Entities\Settings;
|
|
|
|
use App\Entities\Settings;
|
|
|
|
use App\Entities\PayrollSchedule;
|
|
|
|
use App\Entities\PayrollSchedule;
|
|
|
|
use App\Entities\PayrollTransaction;
|
|
|
|
use App\Entities\PayrollTransaction;
|
|
|
|
|
|
|
|
use App\Entities\EmployeePayTransaction;
|
|
|
|
|
|
|
|
use App\Entities\EmpPayTransIncomeDeduction;
|
|
|
|
|
|
|
|
|
|
|
|
// Class Library
|
|
|
|
// Class Library
|
|
|
|
use App\ClassLib\MiscLib;
|
|
|
|
use App\ClassLib\MiscLib;
|
|
|
@ -50,10 +54,10 @@ class PayrollController extends BaseController
|
|
|
|
$data['tblPayGroup'] = '<p>No groups found.</p>';
|
|
|
|
$data['tblPayGroup'] = '<p>No groups found.</p>';
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$payGroupHTMLTable->setHeading('ID', 'Group Name', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
foreach($payGroups as $group)
|
|
|
|
foreach($payGroups as $group)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$payGroupHTMLTable->setHeading('ID', 'Group Name', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Group Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Group Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$payGroupHTMLTable->addRow($group->pay_group_id, $group->pay_group_code, $group->pay_group_name, "$iconView");
|
|
|
|
$payGroupHTMLTable->addRow($group->pay_group_id, $group->pay_group_code, $group->pay_group_name, "$iconView");
|
|
|
@ -92,10 +96,10 @@ class PayrollController extends BaseController
|
|
|
|
$data['tblIncomeDeduction'] = '<p>No income and deduction found.</p>';
|
|
|
|
$data['tblIncomeDeduction'] = '<p>No income and deduction found.</p>';
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$inDedHTMLTable->setHeading('ID', 'Payslip Display', 'COA Code', 'Deduction Name', 'Income', 'Taxable', 'Include in Gross', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
foreach($incomeDeductions as $incomeDeduction)
|
|
|
|
foreach($incomeDeductions as $incomeDeduction)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$inDedHTMLTable->setHeading('ID', 'Payslip Display', 'COA Code', 'Deduction Name', 'Income', 'Taxable', 'Include in Gross', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$inDedHTMLTable->addRow($incomeDeduction->inded_id, $incomeDeduction->payslip_display, $incomeDeduction->coa_code, $incomeDeduction->income_deduction_name, ($incomeDeduction->is_income) ? 'Yes' : 'No', ($incomeDeduction->is_taxable) ? 'Yes' : 'No', ($incomeDeduction->include_in_gross) ? 'Yes' : 'No', $iconView);
|
|
|
|
$inDedHTMLTable->addRow($incomeDeduction->inded_id, $incomeDeduction->payslip_display, $incomeDeduction->coa_code, $incomeDeduction->income_deduction_name, ($incomeDeduction->is_income) ? 'Yes' : 'No', ($incomeDeduction->is_taxable) ? 'Yes' : 'No', ($incomeDeduction->include_in_gross) ? 'Yes' : 'No', $iconView);
|
|
|
@ -139,10 +143,10 @@ class PayrollController extends BaseController
|
|
|
|
$data['tblPayrollType'] = '<p>No payroll type found.</p>';
|
|
|
|
$data['tblPayrollType'] = '<p>No payroll type found.</p>';
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$payTypeHTMLTable->setHeading('ID', 'Code', 'Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
foreach($payrollTypes as $payrollType)
|
|
|
|
foreach($payrollTypes as $payrollType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$payTypeHTMLTable->setHeading('ID', 'Code', 'Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$payTypeHTMLTable->addRow($payrollType->paytype_id, $payrollType->paytype_code, $payrollType->paytype_name, ($payrollType->is_monthly) ? 'Yes' : 'No', ($payrollType->is_semi_monthly) ? 'Yes' : 'No', ($payrollType->is_daily) ? 'Yes' : 'No', ($payrollType->is_hourly) ? 'Yes' : 'No', $iconView);
|
|
|
|
$payTypeHTMLTable->addRow($payrollType->paytype_id, $payrollType->paytype_code, $payrollType->paytype_name, ($payrollType->is_monthly) ? 'Yes' : 'No', ($payrollType->is_semi_monthly) ? 'Yes' : 'No', ($payrollType->is_daily) ? 'Yes' : 'No', ($payrollType->is_hourly) ? 'Yes' : 'No', $iconView);
|
|
|
@ -197,7 +201,7 @@ class PayrollController extends BaseController
|
|
|
|
public function employeePayrollInfo()
|
|
|
|
public function employeePayrollInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$empPayInfoModel = new EmployeePayrollInfoModel();
|
|
|
|
$empPayInfoModel = new EmployeePayrollInfoModel();
|
|
|
|
$empPayInfos = $empPayInfoModel->getAllEmpPayInfoJoinedEmpPayType();
|
|
|
|
$empPayInfos = $empPayInfoModel->getAllEmpPayInfoXEmpPayType();
|
|
|
|
|
|
|
|
|
|
|
|
$data['employees'] = (new EmployeeModel())->findAll();
|
|
|
|
$data['employees'] = (new EmployeeModel())->findAll();
|
|
|
|
$data['paytypes'] = (new PayrollTypeModel())->findAll();
|
|
|
|
$data['paytypes'] = (new PayrollTypeModel())->findAll();
|
|
|
@ -209,10 +213,10 @@ class PayrollController extends BaseController
|
|
|
|
$data['tblEmpPayInfo'] = '<p>No employee payroll type found.</p>';
|
|
|
|
$data['tblEmpPayInfo'] = '<p>No employee payroll type found.</p>';
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayInfoHTMLTable->setHeading('ID', 'Payroll Type', 'Employee ID', 'Employee Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
foreach($empPayInfos as $empPayInfo)
|
|
|
|
foreach($empPayInfos as $empPayInfo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$empPayInfoHTMLTable->setHeading('ID', 'Payroll Type', 'Employee ID', 'Employee Name', 'Monthly', 'Semi-Monthly', 'Daily', 'Hourly', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$empPayInfoHTMLTable->addRow($empPayInfo->emppay_id, $empPayInfo->paytype_name, $empPayInfo->company_issued_id, $empPayInfo->last_name . ', ' . $empPayInfo->first_name, $empPayInfo->basic_monthly_pay, $empPayInfo->basic_semi_monthly_pay, $empPayInfo->basic_daily_pay, $empPayInfo->basic_hourly_pay, $iconView);
|
|
|
|
$empPayInfoHTMLTable->addRow($empPayInfo->emppay_id, $empPayInfo->paytype_name, $empPayInfo->company_issued_id, $empPayInfo->last_name . ', ' . $empPayInfo->first_name, $empPayInfo->basic_monthly_pay, $empPayInfo->basic_semi_monthly_pay, $empPayInfo->basic_daily_pay, $empPayInfo->basic_hourly_pay, $iconView);
|
|
|
@ -256,7 +260,7 @@ class PayrollController extends BaseController
|
|
|
|
$data['paySchedules'] = (new PayrollScheduleModel())->findAll();
|
|
|
|
$data['paySchedules'] = (new PayrollScheduleModel())->findAll();
|
|
|
|
$data['incomeList'] = $incomeDeductionModel->where("is_income", 1)->findAll();
|
|
|
|
$data['incomeList'] = $incomeDeductionModel->where("is_income", 1)->findAll();
|
|
|
|
$data['deductionList'] = $incomeDeductionModel->where("is_income", 0)->findAll();
|
|
|
|
$data['deductionList'] = $incomeDeductionModel->where("is_income", 0)->findAll();
|
|
|
|
$data['empPayInfos'] = $empPayInfoModel->getAllEmpPayInfoJoinedEmpPayType();
|
|
|
|
$data['empPayInfos'] = $empPayInfoModel->getAllEmpPayInfoXEmpPayType();
|
|
|
|
$data['empLoaded'] = false;
|
|
|
|
$data['empLoaded'] = false;
|
|
|
|
|
|
|
|
|
|
|
|
if($this->request->getGet('empid') != null)
|
|
|
|
if($this->request->getGet('empid') != null)
|
|
|
@ -268,9 +272,9 @@ class PayrollController extends BaseController
|
|
|
|
$iconDelete = '<a href="#" class="ml-3" data-toggle="tooltip" title="Delete Employee Information"><i class="fas fa-trash "></i></a>';
|
|
|
|
$iconDelete = '<a href="#" class="ml-3" data-toggle="tooltip" title="Delete Employee Information"><i class="fas fa-trash "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$data['empLoaded'] = true;
|
|
|
|
$data['empLoaded'] = true;
|
|
|
|
$data['selectedEmployee'] = $empPayInfoModel->getEmpPayInfoJoinedEmpPayTypeByEmpID($this->request->getGet('empid'));
|
|
|
|
$data['selectedEmployee'] = $empPayInfoModel->getEmpPayInfoXEmpPayTypeByEmpID($this->request->getGet('empid'));
|
|
|
|
$data['empPayIncomeList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'), true);
|
|
|
|
$data['empPayIncomeList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedIdIsIncome($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'), true);
|
|
|
|
$data['empPayDeductionList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedId($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'),false);
|
|
|
|
$data['empPayDeductionList'] = $empPayInDedModel->getEmpPayInDedByEmpPayIdSchedIdIsIncome($data['selectedEmployee']->emppay_id, $this->request->getGet('payschedid'),false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return view('payroll/compensationbenefitsview', $data);
|
|
|
|
return view('payroll/compensationbenefitsview', $data);
|
|
|
@ -361,10 +365,10 @@ class PayrollController extends BaseController
|
|
|
|
$data['tblPayTrans'] = '<p>No transactions found.</p>';
|
|
|
|
$data['tblPayTrans'] = '<p>No transactions found.</p>';
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
$payTransHTMLTable->setHeading('ID', 'From', 'To', 'No. of Days', 'Status', 'Remarks', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
foreach($payTrans as $trans)
|
|
|
|
foreach($payTrans as $trans)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$payTransHTMLTable->setHeading('ID', 'From', 'To', 'No. of Days', 'Status', 'Remarks', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$iconEdit = '<a href="/payroll/emppaytrans/'.$trans->paytrans_id.'" class="ml-3" data-toggle="tooltip" title="Edit Payroll Transaction"><i class="fas fa-edit"></i></a>';
|
|
|
|
$iconEdit = '<a href="/payroll/emppaytrans/'.$trans->paytrans_id.'" class="ml-3" data-toggle="tooltip" title="Edit Payroll Transaction"><i class="fas fa-edit"></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
$payTransHTMLTable->addRow($trans->paytrans_id, $trans->payroll_from, $trans->payroll_to, $trans->no_of_days, $trans->is_open ? 'Open' : ' Closed', $trans->remarks, $iconEdit);
|
|
|
|
$payTransHTMLTable->addRow($trans->paytrans_id, $trans->payroll_from, $trans->payroll_to, $trans->no_of_days, $trans->is_open ? 'Open' : ' Closed', $trans->remarks, $iconEdit);
|
|
|
@ -393,11 +397,127 @@ class PayrollController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
public function employeePayrollTransactions($paytransid)
|
|
|
|
public function employeePayrollTransactions($paytransid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$data['paytransid'] = $paytransid;
|
|
|
|
|
|
|
|
$data['paygroupid'] = $this->request->getGet('grpid');
|
|
|
|
$data['paygroupid'] = $this->request->getGet('grpid');
|
|
|
|
|
|
|
|
$data['showInitBtn'] = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$payTrans = (new PayrollTransactionModel())->where('paytrans_id', $paytransid)->first();
|
|
|
|
|
|
|
|
$data['paytransid'] = $paytransid;
|
|
|
|
|
|
|
|
$data['initURL'] = $paytransid.'/'.$data['paygroupid'].'/'.$payTrans->paytype_id;
|
|
|
|
|
|
|
|
|
|
|
|
$data['paygroups'] = (new PayrollGroupModel())->findAll();
|
|
|
|
$data['paygroups'] = (new PayrollGroupModel())->findAll();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTrans = (new EmployeePayTransactionModel())->getEmpPayTransByPayGroupId($data['paygroupid']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable = new \CodeIgniter\View\Table();
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->setTemplate(MiscLib::adminLTETableTemplate());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($empPayTrans == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayTrans = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($data['paygroupid'], $payTrans->paytype_id);
|
|
|
|
|
|
|
|
$data['showInitBtn'] = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->setHeading('ID', 'Company ID', 'Name', 'Branch', 'Daily Basic');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data['tblEmpPayTrans'] = $empPayTransHTMLTable->generate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->setHeading('ID', 'Name', 'Branch', 'Monthly Basic', 'Action');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($empPayTrans as $trans)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$iconView = '<a href="#" class="ml-3" data-toggle="tooltip" title="View Information"><i class="fas fa-eye "></i></a>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransHTMLTable->addRow($trans->employee_id, $trans->last_name . ', ' . $trans->first_name, $trans->branch_code, $trans->basic_monthly_pay, $iconView);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data['tblEmpPayTrans'] = $empPayTransHTMLTable->generate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return view('payroll/emppaytransactionview', $data);
|
|
|
|
return view('payroll/emppaytransactionview', $data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function empPayTransInitializePayroll($paytransid, $paygroupid, $transtypid)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayInfos = (new EmployeePayrollInfoModel())->getEmpPayInfoXEmpPayTypeByPayGrpId($paygroupid, $transtypid);
|
|
|
|
|
|
|
|
$payTrans = (new PayrollTransactionModel())->where('paytrans_id', $paytransid)->first();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($empPayInfos as $empPayInfo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayTransaction = new EmployeePayTransaction();
|
|
|
|
|
|
|
|
$empPayTransactionModel = new EmployeePayTransactionModel();
|
|
|
|
|
|
|
|
$empPayTransaction->fill(
|
|
|
|
|
|
|
|
['paytrans_id' => $paytransid,
|
|
|
|
|
|
|
|
'company_id' => $empPayInfo->company_id,
|
|
|
|
|
|
|
|
'branch_code' => $empPayInfo->branch_code,
|
|
|
|
|
|
|
|
'dept_id' => $empPayInfo->dept_id,
|
|
|
|
|
|
|
|
'job_title_id' => $empPayInfo->job_title_id,
|
|
|
|
|
|
|
|
'pay_group_id' => $empPayInfo->pay_group_id,
|
|
|
|
|
|
|
|
'emp_status_id' => $empPayInfo->emp_status_id,
|
|
|
|
|
|
|
|
'employee_id' => $empPayInfo->employee_id,
|
|
|
|
|
|
|
|
'company_issued_id' => $empPayInfo->company_issued_id,
|
|
|
|
|
|
|
|
'last_name' => $empPayInfo->last_name,
|
|
|
|
|
|
|
|
'first_name' => $empPayInfo->first_name,
|
|
|
|
|
|
|
|
'middle_name' => $empPayInfo->middle_name,
|
|
|
|
|
|
|
|
'suffix' => $empPayInfo->suffix,
|
|
|
|
|
|
|
|
'email_address' => $empPayInfo->email_address,
|
|
|
|
|
|
|
|
'is_ATM' => $empPayInfo->is_ATM,
|
|
|
|
|
|
|
|
'savings_account' => $empPayInfo->savings_account,
|
|
|
|
|
|
|
|
'basic_monthly_pay' => $empPayInfo->basic_monthly_pay,
|
|
|
|
|
|
|
|
'basic_daily_pay' => $empPayInfo->basic_daily_pay,
|
|
|
|
|
|
|
|
'basic_hourly_pay' => $empPayInfo->basic_hourly_pay,
|
|
|
|
|
|
|
|
'has_cola' => $empPayInfo->has_cola,
|
|
|
|
|
|
|
|
'has_philhealth' => $empPayInfo->has_philhealth,
|
|
|
|
|
|
|
|
'has_hdmf' => $empPayInfo->has_hdmf,
|
|
|
|
|
|
|
|
'has_sss' => $empPayInfo->has_sss,
|
|
|
|
|
|
|
|
'has_gsis' => $empPayInfo->has_gsis,
|
|
|
|
|
|
|
|
'actual_work_days' => $payTrans->no_of_days,
|
|
|
|
|
|
|
|
'basic_pay' => $payTrans->no_of_days * $empPayInfo->basic_daily_pay,
|
|
|
|
|
|
|
|
'gross_income' => 0,
|
|
|
|
|
|
|
|
'taxable_income' => 0,
|
|
|
|
|
|
|
|
'nontaxable_income' => 0,
|
|
|
|
|
|
|
|
'income_tax' => 0,
|
|
|
|
|
|
|
|
'total_deduction' => 0,
|
|
|
|
|
|
|
|
'net_pay' => 0]
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransactionModel->save($empPayTransaction);
|
|
|
|
|
|
|
|
$empPayTransId = $empPayTransactionModel->getInsertID();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayInDeds = (new EmpPayIncomeDeductionModel())->getEmpPayInDedByEmpPayIdSchedId($empPayInfo->emppay_id, $payTrans->payschedule_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach($empPayInDeds as $empPayInDed)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$empPayTransInDed = new EmpPayTransIncomeDeduction();
|
|
|
|
|
|
|
|
$empPayTransInDedModel = new EmpPayTransIncomeDeductionModel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransInDed->fill(
|
|
|
|
|
|
|
|
['emppaytrans_id' => $empPayTransId,
|
|
|
|
|
|
|
|
'inded_id' => $empPayInDed->inded_id,
|
|
|
|
|
|
|
|
'payslip_display' => $empPayInDed->payslip_display,
|
|
|
|
|
|
|
|
'inded_name' => $empPayInDed->inded_name,
|
|
|
|
|
|
|
|
'coa_code' => $empPayInDed->coa_code,
|
|
|
|
|
|
|
|
'is_income' => $empPayInDed->is_income,
|
|
|
|
|
|
|
|
'is_taxable' => $empPayInDed->is_taxable,
|
|
|
|
|
|
|
|
'include_in_gross' => $empPayInDed->include_in_gross,
|
|
|
|
|
|
|
|
'is_fixed_amt' => $empPayInDed->is_fixed_amt,
|
|
|
|
|
|
|
|
'is_percent_amt' => $empPayInDed->is_percent_amt,
|
|
|
|
|
|
|
|
'amount' => $empPayInDed->is_fixed_amt ? $empPayInDed->amount : ($empPayInDed->amount / 100) * ($payTrans->no_of_days * $empPayInfo->basic_daily_pay),
|
|
|
|
|
|
|
|
'base_amount' => $empPayInDed->amount,
|
|
|
|
|
|
|
|
'is_override' => $empPayInDed->is_override]
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$empPayTransInDedModel->save($empPayTransInDed);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return redirect()->back()->withInput()->with('message', 'Payroll processed. Please verify the entries.');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|