From 9d899bc405f8f9b3ffb345178e4142c24b8ff4f0 Mon Sep 17 00:00:00 2001 From: paulcortez Date: Wed, 4 Dec 2024 16:43:16 +0800 Subject: [PATCH] fix income deduction update fix income deduction update --- app/Controllers/PayrollController.php | 40 ++-- .../payroll/compensationbenefitsview copy.php | 199 ------------------ .../incomedeductiontransupdateview.php | 5 +- 3 files changed, 23 insertions(+), 221 deletions(-) delete mode 100644 app/Views/payroll/compensationbenefitsview copy.php diff --git a/app/Controllers/PayrollController.php b/app/Controllers/PayrollController.php index 416ad49..dfe6e92 100644 --- a/app/Controllers/PayrollController.php +++ b/app/Controllers/PayrollController.php @@ -226,12 +226,12 @@ class PayrollController extends BaseController $incomeDeduction = (new IncomeDeductionModel())->find($indedid); $empPayTransInDeds = $empPayTransInDedModel->getEmpPayTransInDedxEmPayTransByPayTransIdInDedId($paytransid, $indedid); - $empPayTransInDed = new EmpPayTransIncomeDeduction(); + $empPayTransIncomeDeduction = new EmpPayTransIncomeDeduction(); $updateCount = 0; foreach($empPayTransInDeds as $empPayTransInDed) { - $empPayTransInDed->fill([ + $empPayTransIncomeDeduction->fill([ 'emppaytransinded_id' => $empPayTransInDed->emppaytransinded_id, 'emppaytrans_id' => $empPayTransInDed->emppaytrans_id, 'inded_id' => $empPayTransInDed->inded_id, @@ -873,25 +873,23 @@ class PayrollController extends BaseController $payCompute = new PayrollComputation(); $amount = $payCompute->computeIncomeDeductionByComputationType($rawData, $empPayTrans); - $empPayTransInDed->fill( - [ - 'emppaytransinded_id' => (isset($rawData['emppaytransinded_id'])) ? $rawData['emppaytransinded_id'] : null, - 'emppaytrans_id' => $rawData['emppaytrans_id'], - 'inded_id' => $rawData['inded_id'], - 'payslip_display' => $incomeDeduction->payslip_display, - 'inded_name' => $incomeDeduction->inded_name, - 'coa_code' => $incomeDeduction->coa_code, - 'is_income' => $incomeDeduction->is_income, - 'is_taxable' => $incomeDeduction->is_taxable, - 'include_in_gross' => $incomeDeduction->include_in_gross, - 'is_fixed_amt' => $rawData['is_fixed_amt'], - 'is_percent_amt' => $rawData['is_percent_amt'], - 'worked_days_based' => $rawData['worked_days_based'], - 'amount' => $amount, - 'base_amount' => $rawData['amount'], - 'is_override' => $rawData['is_override'] - ] - ); + $empPayTransInDed->fill([ + 'emppaytransinded_id' => (isset($rawData['emppaytransinded_id'])) ? $rawData['emppaytransinded_id'] : null, + 'emppaytrans_id' => $rawData['emppaytrans_id'], + 'inded_id' => $rawData['inded_id'], + 'payslip_display' => $incomeDeduction->payslip_display, + 'inded_name' => $incomeDeduction->inded_name, + 'coa_code' => $incomeDeduction->coa_code, + 'is_income' => $incomeDeduction->is_income, + 'is_taxable' => $incomeDeduction->is_taxable, + 'include_in_gross' => $incomeDeduction->include_in_gross, + 'is_fixed_amt' => $rawData['is_fixed_amt'], + 'is_percent_amt' => $rawData['is_percent_amt'], + 'worked_days_based' => $rawData['worked_days_based'], + 'amount' => $amount, + 'base_amount' => $rawData['amount'], + 'is_override' => $rawData['is_override'] + ]); if ($empPayTransInDedModel->save($empPayTransInDed)) { $this->computeEmployeePayroll($rawData['emppaytrans_id'], true, $empPayTransactionModel, $empPayTransInDedModel); diff --git a/app/Views/payroll/compensationbenefitsview copy.php b/app/Views/payroll/compensationbenefitsview copy.php deleted file mode 100644 index e64bf63..0000000 --- a/app/Views/payroll/compensationbenefitsview copy.php +++ /dev/null @@ -1,199 +0,0 @@ - -extend('templates/adminlte/generalcontent') ?> - - - -section('title') ?>Compensation and BenefitsendSection() ?> - - - -section('css') ?> - - - - -endSection() ?> - - - -section('bodyclass') ?>sidebar-miniendSection() ?> - - - -section('containertitle') ?>Employee Compensation and BenefitsendSection() ?> - - - -section('activebreadcrumb') ?>Compensation and BenefitsendSection() ?> - - - -section('main') ?> - - - - - -
-
-
-
-

List of Payroll Type

-
-
-
- -
-
- - - - -
-
-
-
- -
-
-
- -
-
-
- -
-
-
-

Employee with assigned Compensation and Benefits

- - - - - - - - - - - - - - - - - - - -
Rendering engineBrowserPlatform(s)Engine versionCSS grade
TridentInternet - Explorer 4.0 - Win 95+ 4X
-
-
-

Employee with unassigned Compensation and Benefits

-
-
-
- -
-
-
- -endSection() ?> - - - - -section('js') ?> - - - - - - - - - - - - - - - - - -endSection() ?> - - \ No newline at end of file diff --git a/app/Views/payroll/incomedeductiontransupdateview.php b/app/Views/payroll/incomedeductiontransupdateview.php index c728ea0..b91abdb 100644 --- a/app/Views/payroll/incomedeductiontransupdateview.php +++ b/app/Views/payroll/incomedeductiontransupdateview.php @@ -37,7 +37,7 @@

inded_name ?>

-

Here are the list of payroll transaction and the number of affected transactions when we update this Income or Deduction item.

+

Here are the list of payroll transaction and the number of affected transactions when we update this Income or Deduction item. These are OPEN transaction and should you re-run computation on each employee after an update.

@@ -59,6 +59,9 @@
+