From 659be68e4b8dcf163224770f4c28ce5c2a91f954 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Wed, 8 May 2024 11:28:24 +0530 Subject: [PATCH 1/2] CHANGE_ getEmployeeOldPolicy API : GWM --- app/Controllers/EmployeeRestController.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 952709da..f562ef09 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1894,11 +1894,27 @@ function getEmployeeOldPolicy() $result = []; foreach ($ClientPolicyData as $key => $ClientPolicyValue) { + $terms = json_decode($ClientPolicyValue['policy_terms']); + // dd($terms); $data['client_id'] = $ClientPolicyValue['client_id']; $data['client_policy_id'] = $ClientPolicyValue['id']; $data['policy_name'] = $ClientPolicyValue['policy_name']; $data['policy_type'] = $ClientPolicyValue['policy_type']; $data['policy_type'] = $ClientPolicyValue['policy_type']; + $data['policy_start_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_start_date']); + $data['policy_end_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_end_date']); + + if($ClientPolicyValue['policy_type_id'] == 1){ $data['heading'] = 'Group Personal Accident Coverage'; }else + if($ClientPolicyValue['policy_type_id'] == 2){ $data['heading'] = 'Group Medical Coverage'; }else + if($ClientPolicyValue['policy_type_id'] == 3){ $data['heading'] = 'Group Medical Coverage - Parents'; }else + if($ClientPolicyValue['policy_type_id'] == 4){ $data['heading'] = 'Group Medical Coverage - Top Up'; }else + if($ClientPolicyValue['policy_type_id'] == 5){ $data['heading'] = 'Group Medical Coverage - Parents (Top Up)'; } + + if($ClientPolicyValue['policy_type_id'] == 1){ $data['floter_text_heading'] = 'Sum Insured'; } + else + { + if($terms->family_floater == 1){ $data['floter_text_heading'] = 'Floter Sum Insured'; }else{ $data['floter_text_heading'] = 'Sum Insured'; } + } $employee_policy = $this->employeePolicyModel->select('employees.*,employee_polices.employee_id , employee_polices.basic_cover_si , employee_polices.premium , employee_polices.gst , employee_polices.tpa_id , employee_polices.rand_string') ->join('employees', 'employee_polices.employee_id = employees.id', 'left') @@ -1930,4 +1946,17 @@ function getEmployeeOldPolicy() } + +private function convertDateFormatDisplay($dateString) +{ + // Attempt to create a DateTime object from the provided date string + $dateTime = \DateTime::createFromFormat('Y-m-d', $dateString); + + if ($dateTime instanceof \DateTime) { + return $dateTime->format('d-M-Y'); + } else { + return null; + } +} + } \ No newline at end of file From d2856d70f231cf4b7187a1112b139026821f0247 Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Wed, 8 May 2024 14:14:01 +0530 Subject: [PATCH 2/2] CHANGE_AGE_RADIO_IN_GPA_GMS_POLICY_TERMS : AADHAVAN --- app/Controllers/ClientController.php | 22 ++- app/Views/client_onboarding.php | 4 +- app/Views/policy_gmc_terms.php | 256 +++++++++++++++++++++++++-- app/Views/policy_gpa_terms.php | 54 ++++++ 4 files changed, 319 insertions(+), 17 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 3a058335..773eb420 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -1174,7 +1174,8 @@ class ClientController extends AdminController public function policyGMCTerms() { try { - // print_r($this->request->getPost('family_floaters'));die; + // echo "
";
+            // print_r($this->request->getPost());die;
             $this->myLogger->logme('error','Terms CREATE function called');
             
             /*** Client Policy Table Primary Key(ID) ***/
@@ -1183,7 +1184,19 @@ class ClientController extends AdminController
             $data['sum_insured']   =str_replace(',', '',$this->request->getPost("sum_insured"));
             $data['family_floater']   =$this->request->getPost("family_floater");
             $data['corporatebuffer'] = $this->request->getPost("corporatebuffer");
-            $data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];                
+            $data['family_floaters'] = $this->request->getPost("family_floaters") ?? [];        
+            
+            // print_r($this->request->getPost());die;
+            $data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
+            $data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
+            $data['age_ratio']['spouse']['min'] = $this->request->getPost("spouse_min_age");
+            $data['age_ratio']['spouse']['max'] = $this->request->getPost("spouse_max_age");
+            $data['age_ratio']['child']['min'] = $this->request->getPost("child_min_age");
+            $data['age_ratio']['child']['max'] = $this->request->getPost("child_max_age");
+            $data['age_ratio']['elders']['min'] = $this->request->getPost("other_member_min_age");
+            $data['age_ratio']['elders']['max'] = $this->request->getPost("other_member_max_age");
+
+
 
                 // if (!in_array("self", $data['family_floaters'])) {
                 //     array_unshift($data['family_floaters'], "self");
@@ -1254,7 +1267,8 @@ class ClientController extends AdminController
                             $data['family_floaters']['either-parents-pil'] =0;
                         }
                     }
-            
+
+                    $data['family_floaters']['elders_count'] =$this->request->getPost("member_count");
 
             $data['waiverofpreexistingdiseases']   =$this->request->getPost("waiverofpreexistingdiseases");
             if ($data['waiverofpreexistingdiseases'] == 1) {
@@ -1371,6 +1385,8 @@ class ClientController extends AdminController
 
             $data['sumInsured2']   =str_replace(',', '', $this->request->getPost("sumInsured2"));
             $data['totalSumInsured'] =str_replace(',', '',$this->request->getPost("totalSumInsured"));
+            $data['age_ratio']['self']['min'] = $this->request->getPost("self_min_age");
+            $data['age_ratio']['self']['max'] = $this->request->getPost("self_max_age");
             $data['accidentalDeathBenefit'] =str_replace(',', '',$this->request->getPost("accidentalDeathBenefit"));
             $data['permanentTotalDisablement'] =str_replace(',', '',$this->request->getPost("permanentTotalDisablement"));
             $data['permanentPartialDisablement'] =$this->request->getPost("permanentPartialDisablement");
diff --git a/app/Views/client_onboarding.php b/app/Views/client_onboarding.php
index bca575d2..d2e73c99 100644
--- a/app/Views/client_onboarding.php
+++ b/app/Views/client_onboarding.php
@@ -34,6 +34,7 @@ body {
 
 
 
+
 
@@ -95,8 +96,8 @@ body {
- + diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index 25b16341..c6b0de9c 100644 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -1,5 +1,13 @@