From 43669a337261f091aa43d4c9473d5c796a83ca64 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Wed, 20 Mar 2024 16:15:17 +0530 Subject: [PATCH 1/6] MERGE-PUSH:GWM --- app/Config/Routes.php | 1 - app/Controllers/EmployeeRestController.php | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 95e4900d..ff7cd6f1 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -214,7 +214,6 @@ $routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfi - $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){ $routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); $routes->get("relationshipList", "EmployeeRestController::relationshipList"); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 57dc8789..897cf15d 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -443,17 +443,21 @@ class EmployeeRestController extends AdminController $checkIfExist = $this->employeePolicyModel->where('employee_id', $value->employee_id) ->where('client_policy_id', $value->client_policy_id) ->findAll(); + $getSlabAndGridData = $this->policesModel->getPolicySlabRatesForEmpOnboard($value->client_policy_id,$value->client_id); + $SlabRatesArray = $getSlabAndGridData['slab_rates']; + $premium = $this->findPremiumAmount($SlabRatesArray, $value->basic_cover_si); + // dd($checkIfExist); if ($checkIfExist) { - $empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si,$value->premium); + $empPolicy = $this->employeePolicyModel->updateSiAndPremium($value->client_policy_id, $value->employee_id, $value->basic_cover_si,$premium); }else{ $data['employee_id']= $value->employee_id; $data['client_policy_id']= $value->client_policy_id; $data['basic_cover_si']= $value->basic_cover_si; - $data['premium']= $value->premium; + $data['premium']= $premium; $this->employeePolicyModel->insert($data); } @@ -465,7 +469,15 @@ class EmployeeRestController extends AdminController } } - + public function findPremiumAmount($slabArray,$siAmount) + { + foreach ($slabArray as $key => $value) { + if($value['si'] == $siAmount){ + return $value['premium']; + break; + } + } + } public function relationshipList() { try { From f8680e116223a5a14cec23ba2930bc8ef0a31d45 Mon Sep 17 00:00:00 2001 From: velz Date: Sat, 30 Mar 2024 18:41:53 +0530 Subject: [PATCH 2/6] CHANGE_SPELL_ISSUE --- app/Views/employee_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index db60f466..db203bcd 100644 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -75,7 +75,7 @@ table.dataTable tbody td { Name/code Policy name - Insurar name + Insurer name TPA ID UHID ID Policy status From 17c8f1558fcca740dfb53c4833aee2b8b601c541 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 30 Mar 2024 18:44:54 +0530 Subject: [PATCH 3/6] FIX_KYC_AND_POLICY_MASTER_REDIRECT : RV --- app/Views/kyc_docs.php | 4 +- app/Views/policies.php | 86 +++++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/app/Views/kyc_docs.php b/app/Views/kyc_docs.php index 0ec33c05..6567df7c 100644 --- a/app/Views/kyc_docs.php +++ b/app/Views/kyc_docs.php @@ -324,6 +324,7 @@ $(document).ready(function () { function removeKYCDocs(element) { + var kyc_docs_id_for_reload = $('#kyc_type_id').val(); var id = element.getAttribute('data-id'); var form_action = '' + id; $.ajax({ @@ -338,7 +339,8 @@ $(document).ready(function () { if (res.status == true) { toastr.success('Remove Done!', 'success'); - location.reload(); + // location.reload(); + window.location.href = '' + kyc_docs_id_for_reload; } else { toastr.warning('Remove Not Done!', 'warning'); diff --git a/app/Views/policies.php b/app/Views/policies.php index 83560c37..6ae8f361 100644 --- a/app/Views/policies.php +++ b/app/Views/policies.php @@ -340,57 +340,58 @@ $(document).ready(function () { function loadPoliciesList() { var base_url = ''; - var insurer_branch_action = base_url + policy_type_PrimaryKey; + var insurer_branch_action = base_url + policy_type_PrimaryKey; - if ($('#policy_type_id').val() != '') { - - $('.loader').fadeIn(); - $('.loader-mask').fadeIn(); - $.ajax({ - url: insurer_branch_action, - type: 'GET', - success: function(response) { + if ($('#policy_type_id').val() != '') { + + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + $.ajax({ + url: insurer_branch_action, + type: 'GET', + success: function(response) { - console.log("response", response); + console.log("response", response); - setTimeout(function() { - $('.loader').fadeOut(); - $('.loader-mask').delay(350).fadeOut('slow'); - }, 1000); - var branchTable = ''; - $.each(response.policies, function(index, item) { - console.log(item); - branchTable += ` - - ${item.insurer.name} - ${item.policy.name} - - - - - - `; - }); - $('#policies_list').append(branchTable); - }, - error: function(xhr, status, error) { - console.error(xhr.responseText); - console.error(status, error); + setTimeout(function() { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + }, 1000); + var branchTable = ''; + $.each(response.policies, function(index, item) { + console.log(item); + branchTable += ` + + ${item.insurer.name} + ${item.policy.name} + + + + + + `; + }); + $('#policies_list').append(branchTable); + }, + error: function(xhr, status, error) { + console.error(xhr.responseText); + console.error(status, error); - setTimeout(function() { - $('.loader').fadeOut(); - $('.loader-mask').delay(350).fadeOut('slow'); - toastr.warning('Something Wrong!', 'warning'); - }, 1000); - } - }); - } + setTimeout(function() { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + toastr.warning('Something Wrong!', 'warning'); + }, 1000); + } + }); + } } }); function removePolicies(element) { + var policy_id_for_reload = $('#policy_type_id').val() var id = element.getAttribute('data-id'); var form_action = '' + id; $.ajax({ @@ -407,7 +408,8 @@ function removePolicies(element) { // $('#branch_table').empty(); - location.reload(); + // location.reload(); + window.location.href = '' + policy_id_for_reload; } else { toastr.warning('Remove Not Done!', 'warning'); From 6e19a3485d51bb647cee81968b45b5a7024428cd Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 30 Mar 2024 18:55:46 +0530 Subject: [PATCH 4/6] FAET_ENDORSEMENTLIST --- app/Views/endorsement_list.php | 259 +++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 app/Views/endorsement_list.php diff --git a/app/Views/endorsement_list.php b/app/Views/endorsement_list.php new file mode 100644 index 00000000..75e5509c --- /dev/null +++ b/app/Views/endorsement_list.php @@ -0,0 +1,259 @@ + + +
+
+
+
+
+ + + +
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + + +
+
+
+
+
+
+

Endorsement List

+
+ +
+ + + + + + + + + + + + + + + + + $employee) { ?> + + + + + + + + + + + + + + + + +
SNOName/codePolicy nameInsurar nameTPA IDUHID IDPolicy statusPremiumAction
( )active + +
+
+
+
+
+ + + + \ No newline at end of file From 2530027c4fb03dff26fe62cda97990caa14d6c22 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 1 Apr 2024 09:54:01 +0530 Subject: [PATCH 5/6] FIX_RAC_RATE_AND POLICY_TERM_SHOW_BASED_ON_GPA_GMC : RV --- app/Config/Routes.php | 1 + app/Controllers/EmployeeController.php | 13 ++ app/Models/ClientPolicyModel.php | 3 +- app/Models/EmployeePolicyModel.php | 17 +++ app/Views/client_policy.php | 51 +++++-- app/Views/policy_gmc_terms.php | 6 +- app/Views/policy_gpa_terms.php | 4 +- app/Views/policy_grid.php | 195 ++++++++++++++----------- 8 files changed, 187 insertions(+), 103 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5c613da1..b020c543 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -112,6 +112,7 @@ $routes->group("/employee", ["filter" => "authMVC"], function($routes){ $routes->get("upload", "EmployeeController::employeesUplodWithEvents"); $routes->post("upload", "EmployeeController::employeesUplodWithEvents"); $routes->get("excel_error/(:any)", "EmployeeController::getExcelFileErrors/$1"); + $routes->get("endorsement-list", "EmployeeController::endorsementList"); }); diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 5c76efe6..1c1e0214 100644 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -451,4 +451,17 @@ class EmployeeController extends AdminController } // ------------------------------------------------------------------------------------------- + + public function endorsementList(){ + $data = []; + if(count($this->request->getGet())) + { + $filterData = $this->request->getGet(); + $data['employees'] = $this->employeePolicyModel->getEmployeeEndorsementList(client_id: $filterData['client_id'],policy_id: $filterData['policy_id']); + $data['getData'] = $filterData; + } + + $this->myLogger->logme('error','list called'); + $this->loadLayout('endorsement_list',$data); + } } \ No newline at end of file diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php index 01bc2a2c..8008ad8d 100644 --- a/app/Models/ClientPolicyModel.php +++ b/app/Models/ClientPolicyModel.php @@ -71,12 +71,13 @@ class ClientPolicyModel extends Model ->select('policy_type.policy_type as policy_type_name') ->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code') ->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code') + ->select('policy_type.policy_type as policy_type_name') ->join('insurers', 'insurers.id = client_policy.insurer_id') ->join('insurer_branch', 'client_policy.insurer_branch_id = insurer_branch.id') ->join('tpa', 'tpa.id = client_policy.tpa_id') ->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id') ->join('policies', 'policies.id = client_policy.policy_id') - ->join('policy_type', 'policy_type.id = policies.policy_type_id') + ->join('policy_type', 'policy_type.id = policies.policy_type_id') ->where('client_policy.client_id', $client_id) ->get() ->getResult(); diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 94a6e80e..ca0418b5 100644 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -560,6 +560,23 @@ class EmployeePolicyModel extends Model $this->query($query); } + + public function getEmployeeEndorsementList($client_id,$policy_id) + { + $result = $this->select(['employee_polices.*','pm.name as policy_name','im.short_name as insurer_short_name','ib.branch_name as insurer_branch_name','ib.branch_code as insurer_branch_code','tpam.name as tpa_name','tpam.short_name as tpa_short_name','tpab.branch_code as tpa_branch_code','cm.client_name','cm.short_name as client_short_name','emp.relationship','emp.relationship_code','emp.change_event','emp.emp_code','emp.name','emp.email_corporate','emp.dob','emp.gender','emp.emp_status','emp.is_active as emp_is_active']) + ->join('employees emp', 'employee_polices.employee_id = emp.id') + ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy + ->join('policies pm', 'cp.policy_id = pm.id') //pm - policy master + ->join('insurers im', 'cp.insurer_id = im.id') //im - insurar master + ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurar branch + ->join('tpa tpam', 'cp.tpa_id = tpam.id') //tpam - tpa master + ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id') //tpab - tpa brach + ->join('clients cm', 'cp.client_id = cm.id') //cm - client master + ->where('emp.client_id',$client_id) + ->where('employee_polices.client_policy_id',$policy_id) + ->findAll(); + return ($result); + } //------------------------------------------------------------------ } diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index a4e893ab..ec0afb9c 100644 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -36,8 +36,8 @@
- - + +
@@ -94,12 +94,10 @@
- +
-
-
@@ -159,6 +157,7 @@ $('.btnAdd').click(function(){ + $('#policy_form')[0].reset(); $('#add_form').show(); $('#table_list').hide(); $('.btnBack').show(); @@ -170,12 +169,13 @@ $('#policy').html(''); $('#is_addon').prop('checked', false); $('#policy_form_action').val(''); + $('#policy_status_field').hide() }) $('.btnBack').click(function(){ - + $('#policy_form')[0].reset(); $('#GMC').remove(); $('#GPA').remove(); $('#add_form').hide(); @@ -194,10 +194,22 @@ if (policy_PrimaryKey !== '') { var policyTable = ''; var data = ; + console.log('client_policy_data',data) data.forEach(function(item) { - // console.log("----------------------------"); - // console.log(item); + var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc' + var patternGPA = /gpa/i; // Case insensitive pattern for 'gpa' + var subject = item.policy_type_name; + + if (patternGMC.test(subject)) { + search_term = 'GMC'; + } else if (patternGPA.test(subject)) { + search_term = 'GPA'; + } else { + search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists + } + + console.log('search_term :', search_term) policyTable += ` @@ -211,8 +223,8 @@
@@ -271,7 +283,7 @@ success: function(res) { console.log(res); - + $('#policy_form')[0].reset(); if (res.status === false) { toastr.error('Policy Dose Not Create', 'Error'); return; @@ -295,6 +307,21 @@ $('#policy_table tr').remove(); var policyTable = ''; $.each(res.data, function(index, item) { + + var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc' + var patternGPA = /gpa/i; // Case insensitive pattern for 'gpa' + var subject = item.policy_type_name; + + if (patternGMC.test(subject)) { + search_term = 'GMC'; + } else if (patternGPA.test(subject)) { + search_term = 'GPA'; + } else { + search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists + } + + console.log('search_term :', search_term) + policyTable += ` ${item.insurer_short} - ${item.insurer_branch_name} @@ -307,7 +334,7 @@ diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index 0f556978..3779a258 100644 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -643,9 +643,9 @@ var grid_html = ''; var gmc_policy_type_id = $(this).attr('id'); - + console.log(gmc_policy_type_id) - if(gmc_policy_type_id >= 2){ + if(gmc_policy_type_id == 'GMC'){ $('#policyGMCTerms').css('display', ''); $('#police-tab').css('display', 'none'); @@ -802,6 +802,8 @@ var grid_html = ''; } }); + }else if(gmc_policy_type_id != 'GPA' && gmc_policy_type_id != 'GMC'){ + // toastr.warning('The terms has no data ', 'warning'); } }); diff --git a/app/Views/policy_gpa_terms.php b/app/Views/policy_gpa_terms.php index 9797867c..b20c7f04 100644 --- a/app/Views/policy_gpa_terms.php +++ b/app/Views/policy_gpa_terms.php @@ -446,7 +446,7 @@ var gpa_policy_type_id = $(this).attr('id'); // console.log('gpa_policy_type_id', gpa_policy_type_id) - if(gpa_policy_type_id == '1'){ + if(gpa_policy_type_id == 'GPA'){ $('#policyGPATermsForm').css('display', ''); $('#police-tab').css('display', 'none'); @@ -548,6 +548,8 @@ } }); + }else if(gpa_policy_type_id != 'GPA' && gpa_policy_type_id != 'GMC'){ + toastr.warning("This policy has no policy terms.", 'warning'); } }); diff --git a/app/Views/policy_grid.php b/app/Views/policy_grid.php index 8cc5b360..13655d71 100644 --- a/app/Views/policy_grid.php +++ b/app/Views/policy_grid.php @@ -7,6 +7,9 @@