From e76e139f187cea303aa44291ad60bc4ccfc77f1d Mon Sep 17 00:00:00 2001 From: paulcortez Date: Fri, 27 Sep 2024 12:16:05 +0800 Subject: [PATCH 1/4] updated menu names updated menu names --- .../payroll/compensationbenefitsview.php | 284 ++++++++++++------ 1 file changed, 193 insertions(+), 91 deletions(-) diff --git a/app/Views/payroll/compensationbenefitsview.php b/app/Views/payroll/compensationbenefitsview.php index 72f7dc9..41ab6c9 100644 --- a/app/Views/payroll/compensationbenefitsview.php +++ b/app/Views/payroll/compensationbenefitsview.php @@ -169,12 +169,81 @@ + + +
-

List of Payroll Type

+

Select Schedule and Employee

@@ -211,101 +280,129 @@
+ +
+ +
+
+ +
+
+
+
+

Payroll Income and Deduction Details

+
+
+
+
+
-
- -

Payroll Income and Deduction Details

-
-
-

Employee Name: last_name . ', ' . $selectedEmployee->first_name ?>

-

Employee ID: company_issued_id ?>

-
-
-

Basic Salary basic_monthly_pay ?>

-

Date: 20/09/2024

-
-
- - - - - - - - - - - - - - - - - - - - - - - +

Employee Name: last_name . ', ' . $selectedEmployee->first_name ?>

+

Employee ID: company_issued_id ?>

+ +
+

Basic Salary basic_monthly_pay ?>

+

Date: 20/09/2024

+
+ +
DescriptionAmountAction
Basic Salary basic_semi_monthly_pay, 2, ".", ",") ?> 
inded_name ?> amount, 2, ".", ",") ?> 
+ + + + + + + + + basic_semi_monthly_pay; + $taxableGross = $selectedEmployee->basic_semi_monthly_pay; + $deductionTotal = 0; + ?> + + + + + + + + + + + + + + amount; - - endforeach; ?> - - - - - - - - - - - - - - - amount; + if($empPayIncome->is_taxable) $taxableGross += $empPayIncome->amount; + + endforeach; ?> + + + + + + + + + + + + + + + amount; - - endforeach; - ?> - - - - - - - - - - - - - - - -
DescriptionAmountAction
Basic Salary basic_semi_monthly_pay, 2, ".", ",") ?> 
inded_name ?> amount, 2, ".", ",") ?> + + +
Gross Total Php  
inded_name ?>-amount, 2, ".", ",") ?>  
Gross Total Php  
inded_name ?>-amount, 2, ".", ",") ?>  + + +
Total DeductionsPhp   
Net Income Php  
- -

Select an employee first then click on "Load Income & Deduction" button

- -
-
-
- + $deductionTotal += $empPayDeduction->amount; + + endforeach; + ?> + + Total Deductions + Php +   +   + + + + + Net Income +   + Php +   + + + + +

Select an employee first then click on "Load Income & Deduction" button

+ +
+
+
+
@@ -332,6 +429,11 @@ $('.select2').select2(); }); +function editIncome(element) { + + $('#mdlEditIncome').modal('show'); +} + endSection() ?> From 47faf1033c5ebd86ad9c5c850ce817cdb277fad3 Mon Sep 17 00:00:00 2001 From: paulcortez Date: Mon, 30 Sep 2024 16:49:16 +0800 Subject: [PATCH 2/4] editing of comp benifits editing of comp benifits --- app/Config/Auth.php | 2 +- app/Config/Routes.php | 1 + app/Controllers/PayrollController.php | 20 ++- .../payroll/compensationbenefitsview.php | 170 ++++++++++++++---- 4 files changed, 157 insertions(+), 36 deletions(-) diff --git a/app/Config/Auth.php b/app/Config/Auth.php index fcbb0de..eb8bc18 100644 --- a/app/Config/Auth.php +++ b/app/Config/Auth.php @@ -78,7 +78,7 @@ class Auth extends ShieldAuth public array $redirects = [ 'register' => '/hi', 'login' => '/hi', - 'logout' => 'login', + 'logout' => '/login', 'force_reset' => '/', 'permission_denied' => '/', 'group_denied' => '/', diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 2e27a83..c1010e9 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -46,6 +46,7 @@ $routes->post('payroll/addemppayinfo', 'PayrollController::addEmployeePayrollInf $routes->get('payroll/compben', 'PayrollController::employeeCompensationBenefits'); $routes->post('payroll/addcompben', 'PayrollController::addEmployeeCompensationBenefits'); +$routes->post('payroll/delcomben', 'PayrollController::deleteEmployeeCompensationBenefits'); $routes->get('payroll/paysettings', 'PayrollController::payrollSettings'); $routes->post('payroll/paysettings', 'PayrollController::payrollSettings'); diff --git a/app/Controllers/PayrollController.php b/app/Controllers/PayrollController.php index 9669e3d..78b5bd0 100644 --- a/app/Controllers/PayrollController.php +++ b/app/Controllers/PayrollController.php @@ -300,12 +300,26 @@ class PayrollController extends BaseController $rawData['is_override'] = isset($rawData['is_override']) ? 1 : 0; $empPayInDed->fill($rawData); - $empPayInDedModel->save($empPayInDed); - if($empPayInDedModel->getInsertID() == 0) + if($empPayInDedModel->save($empPayInDed)) + { + if(isset($rawData['emppayinded_id'])) + return redirect()->to('/payroll/compben?payschedid='.$this->request->getPost('payschedule_id').'&empid='.$this->request->getPost('emp_id'))->with('message', 'Employee Compensation Benefits edited'); + else + return redirect()->to('/payroll/compben?payschedid='.$this->request->getPost('payschedule_id').'&empid='.$this->request->getPost('emp_id'))->with('message', 'Employee Compensation Benefits Added'); + } + else return redirect()->back()->withInput()->with('error', 'Failed to add employee compensation benefits'); + } + + public function deleteEmployeeCompensationBenefits() + { + $empPayInDedModel = new EmpPayIncomeDeductionModel(); + + if($empPayInDedModel->delete($this->request->getPost('emppayinded_id'))) + return redirect()->to('/payroll/compben?payschedid='.$this->request->getPost('payschedule_id').'&empid='.$this->request->getPost('emp_id'))->with('message', 'Employee Compensation Benefits deleted'); else - return redirect()->to('/payroll/compben?payschedid='.$this->request->getPost('payschedule_id').'&empid='.$this->request->getPost('emp_id'))->with('message', 'Employee Compensation Benefits Added'); + return redirect()->back()->with('error', 'Failed to delete employee compensation benefits'); } public function payrollSettings() diff --git a/app/Views/payroll/compensationbenefitsview.php b/app/Views/payroll/compensationbenefitsview.php index 41ab6c9..2847263 100644 --- a/app/Views/payroll/compensationbenefitsview.php +++ b/app/Views/payroll/compensationbenefitsview.php @@ -62,22 +62,22 @@
- - + +
- - + +
- - + +
- - + +

Override will implement this amount and not the computational amount made like in SSS, Philhealth, Pag-IBIG and taxastion

@@ -131,22 +131,22 @@
- - + +
- - + +
- - + +
- - + +

Override will implement this amount and not the computational amount made like in SSS, Philhealth, Pag-IBIG and taxastion

@@ -189,33 +189,102 @@
- - - + +
- + + + + +
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + +

Override will implement this amount and not the computational amount made like in SSS, Philhealth, Pag-IBIG and taxastion

+
+
+
+ +
+

No Employee Loaded. Please select employee first

+
+ + + + + + + + + + + + +