From 862299cc38803fd031e4347e362a0a451b6295a3 Mon Sep 17 00:00:00 2001 From: paulcortez Date: Sat, 19 Oct 2024 13:40:58 +0800 Subject: [PATCH] corrected an error on semi-monthly corrected an error on semi-monthly --- app/ClassLib/PayrollComputation.php | 10 ++--- app/Controllers/PayrollController.php | 2 + ...0-19-044929_AddSalComputeOnEmpPayTrans.php | 37 +++++++++++++++++++ app/Entities/EmployeePayTransaction.php | 2 + app/Models/EmployeePayTransactionModel.php | 2 + 5 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 app/Database/Migrations/2024-10-19-044929_AddSalComputeOnEmpPayTrans.php diff --git a/app/ClassLib/PayrollComputation.php b/app/ClassLib/PayrollComputation.php index 4ea43a7..6b72391 100644 --- a/app/ClassLib/PayrollComputation.php +++ b/app/ClassLib/PayrollComputation.php @@ -30,23 +30,23 @@ class PayrollComputation } else if($grossTaxableIncome <= 16666) { - $tax = ($grossTaxableIncome - 10417) * 0.2; + $tax = ($grossTaxableIncome - 10417) * 0.15; } else if($grossTaxableIncome <= 33332) { - $tax = (($grossTaxableIncome - 16667) * 0.25) + 1250; + $tax = (($grossTaxableIncome - 16667) * 0.20) + 937.50; } else if($grossTaxableIncome <= 83332) { - $tax = (($grossTaxableIncome - 33333) * 0.3) + 5416.67; + $tax = (($grossTaxableIncome - 33333) * 0.25) + 4270.70; } else if($grossTaxableIncome <= 333332) { - $tax = (($grossTaxableIncome - 83333) * 0.32) + 20416.67; + $tax = (($grossTaxableIncome - 83333) * 0.30) + 16770.70; } else { - $tax = (($grossTaxableIncome - 333333) * 0.35) + 100416.67; + $tax = (($grossTaxableIncome - 333333) * 0.35) + 91770.70; } return $tax; diff --git a/app/Controllers/PayrollController.php b/app/Controllers/PayrollController.php index da01578..da58b75 100644 --- a/app/Controllers/PayrollController.php +++ b/app/Controllers/PayrollController.php @@ -583,7 +583,9 @@ class PayrollController extends BaseController 'email_address' => $empPayInfo->email_address, 'is_ATM' => $empPayInfo->is_ATM, 'savings_account' => $empPayInfo->savings_account, + 'basic_sal_computation' => $empPayInfo->basic_sal_computation, 'basic_monthly_pay' => $empPayInfo->basic_monthly_pay, + 'basic_semi_monthly_pay' => $empPayInfo->basic_semi_monthly_pay, 'basic_daily_pay' => $empPayInfo->basic_daily_pay, 'basic_hourly_pay' => $empPayInfo->basic_hourly_pay, 'has_cola' => $empPayInfo->has_cola, diff --git a/app/Database/Migrations/2024-10-19-044929_AddSalComputeOnEmpPayTrans.php b/app/Database/Migrations/2024-10-19-044929_AddSalComputeOnEmpPayTrans.php new file mode 100644 index 0000000..0078533 --- /dev/null +++ b/app/Database/Migrations/2024-10-19-044929_AddSalComputeOnEmpPayTrans.php @@ -0,0 +1,37 @@ + [ + 'type' => 'VARCHAR', + 'constraint' => 35, + 'null' => true, + 'after' => 'savings_account', + ], + 'basic_semi_monthly_pay' => [ + 'type' => 'DECIMAL', + 'constraint' => '12,4', + 'null' => false, + 'after' => 'basic_monthly_pay', + ], + ]; + $this->forge->addColumn('emp_pay_trans', $fields); + } + + public function down() + { + $fields = [ + 'basic_sal_computation', + 'basic_semi_monthly_pay' + ]; + + $this->forge->dropColumn('emp_pay_trans', $fields); + } +} diff --git a/app/Entities/EmployeePayTransaction.php b/app/Entities/EmployeePayTransaction.php index abfdcb7..6614801 100644 --- a/app/Entities/EmployeePayTransaction.php +++ b/app/Entities/EmployeePayTransaction.php @@ -24,7 +24,9 @@ class EmployeePayTransaction extends Entity 'email_address' => null, 'is_ATM' => null, 'savings_account' => null, + 'basic_sal_computation' => null, 'basic_monthly_pay' => null, + 'basic_semi_monthly_pay' => null, 'basic_daily_pay' => null, 'basic_hourly_pay' => null, 'has_cola' => null, diff --git a/app/Models/EmployeePayTransactionModel.php b/app/Models/EmployeePayTransactionModel.php index 4247987..f324e64 100644 --- a/app/Models/EmployeePayTransactionModel.php +++ b/app/Models/EmployeePayTransactionModel.php @@ -28,7 +28,9 @@ class EmployeePayTransactionModel extends Model 'email_address', 'is_ATM', 'savings_account', + 'basic_sal_computation', 'basic_monthly_pay', + 'basic_semi_monthly_pay', 'basic_daily_pay', 'basic_hourly_pay', 'has_cola',