From 9e1505e431bdeb10c21b7ad6acb45a1d351541ce Mon Sep 17 00:00:00 2001 From: bitbucket Date: Fri, 26 Apr 2024 18:35:31 +0530 Subject: [PATCH 1/3] CHANGE_ getEmployeePolicy API : GWM --- app/Controllers/EmployeeRestController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index f25e56cf..ede94cf0 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1017,13 +1017,15 @@ public function getEmployeePolicy() $id = $this->request->getGet('id'); $emp_code = $this->request->getGet('emp_code'); + $client_id = $this->request->getGet('client_id'); // This is an array containing keys to be removed from the terms and conditions array $keysToRemove = ["removable_keys"]; // Retrieve employee policy data by passing the employee primary key $empPolicy = $this->employeeModel->getEmployeePolicy($id); // Retrieve employee and dependents data by passing the employee code - $employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('is_active', 1 )->where('is_addon_value',0)->findAll(); + $employeeData = $this->employeeModel->where('emp_code',$emp_code)->where('client_id',$client_id) + ->where('is_active', 1 )->where('is_addon_value',0)->findAll(); // dd($empPolicy); if ($empPolicy) { @@ -1032,6 +1034,7 @@ public function getEmployeePolicy() foreach ($empPolicy as $array) { // Reset employee array $empData = $employeeData; + // Removes specific keys from the decoded array and assigns the result to $refusingData $decodedArray = json_decode($array->Policy_Terms); @@ -1045,9 +1048,10 @@ public function getEmployeePolicy() // Construct value for policy type GPA if($getSlabAndGridData['grid_master']['policy_type'] == "GPA"){ - + // Filter employee data where the family_floater_key is 'self' $selfData = array_filter($empData, fn($arr) => trim(strtolower($arr['family_floater_key'])) === 'self'); + $self['is_value_exist'] = true; $self['data']['family_floater_key'] = 'self'; $self['data']['employee_id'] = $id; From abb6ac5ff686f78c9c6e591c331b328e962d299b Mon Sep 17 00:00:00 2001 From: bitbucket Date: Fri, 26 Apr 2024 18:43:43 +0530 Subject: [PATCH 2/3] CHANGE_ in getAddOnPolicy API : GWM --- app/Controllers/EmployeeRestController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index ede94cf0..a9edb868 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1248,8 +1248,8 @@ public function getAddOnPolicy() { try { - $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',1)->findAll(); - $GMCEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('is_addon_value',0)->findAll(); + $addOnEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',1)->findAll(); + $GMCEmployeeData = $this->employeeModel->where('is_active', 1 )->where('emp_code',$this->request->getGet('emp_code'))->where('client_id',$this->request->getGet('client_id'))->where('is_addon_value',0)->findAll(); $clientPolicy = $this->clientPolicyModel->where('client_id',$this->request->getGet('client_id'))->findAll(); From 5aed4a586f859c4b92301aa8ee6125e9f05ba1c0 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Fri, 26 Apr 2024 19:22:52 +0530 Subject: [PATCH 3/3] CHANGE_ in premium amount update :GWM --- app/Controllers/EmployeeRestController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index a9edb868..f53e2808 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -286,7 +286,7 @@ class EmployeeRestController extends AdminController ->where('client_policy_id',$value['policy_details']['client_policy_id'] ) ->where('employee_id' , $value['temp']['emp_id'] ) ->where('is_active', 1 ) - ->set(array('premium'=> $value['policy_details']['rata_premimum'] , 'gst'=> $value['policy_details']['gst'] )) + ->set(array('premium'=> $value['policy_details']['premium'] , 'gst'=> $value['policy_details']['gst'] )) ->update(); }