From 6aa523ce046741e08804dc4d7e26f156a1f747f7 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 7 Oct 2024 09:58:01 +0530 Subject: [PATCH] FIX_LIVE_ISSUE_IN_ENROLLMENT : RV --- app/Controllers/EmployeeController.php | 13 +++++++++--- app/Controllers/EmployeeServiceController.php | 6 ++++++ .../PolicyTransactionController.php | 20 +++++++++++++++---- app/Views/file_list.php | 14 ++++++++++++- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index bff8c812..38ead2cf 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -375,7 +375,7 @@ class EmployeeController extends AdminController } else if ($actionType == 'deletion') { $filePath = ROOTPATH . 'public/sample_excel/sample_deletion.xls'; } else if ($actionType == 'enrollment') { - $filePath = ROOTPATH . 'public/sample_excel/enrollment.xls'; + $filePath = ROOTPATH . 'public/sample_excel/enrollment.xlsx'; }else if ($actionType == 'missed_inception') { $filePath = ROOTPATH . 'public/sample_excel/sample_inception.xls'; } @@ -1194,8 +1194,14 @@ class EmployeeController extends AdminController // $file['action'] = 'si_enhancement'; // $result = []; // !dd($file); - if ($file['action'] == 'inception' || $file['action'] == 'dependent_addition' || $file['action'] == 'addition') { - $result = $this->employeeModel->getEmpListByFileId(file_id: $file_id, emp_status: ['active'], policy_status: ['active']); + if ($file['action'] == 'inception' || $file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'enrollment') { + + if($file['action'] == 'enrollment'){ + $result = $this->employeeModel->getEmpListByFileId(file_id: $file_id, emp_status: ['draft','enrolled'], policy_status: ['draft','enrolled']); + }else{ + $result = $this->employeeModel->getEmpListByFileId(file_id: $file_id, emp_status: ['active'], policy_status: ['active']); + } + // ~dd($result); if (count($result) && $role_id == null) { if(get_role_id() == 1 || get_role_id() == 5){ @@ -1210,6 +1216,7 @@ class EmployeeController extends AdminController $query = "UPDATE employees JOIN employee_polices ON employees.id = employee_polices.employee_id and employees.file_id = $file_id SET employees.emp_status = 'truncated', employee_polices.status = 'truncated', employees.is_active = 0,employee_polices.is_active = 0 WHERE employees.file_id = $file_id"; $db->query($query); $affectedRows = $db->affectedRows(); + // print_r($db->getLastQuery()); die; // $affectedRows = 10; //update file status diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index 826c7e29..ae16ad5d 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -1965,6 +1965,7 @@ public function employeesEnrollmentInsert($params) $value['family_floater_key'] = null; $value['client_id'] = $file['client_id']; $value['client_branch_id'] = $file['client_branch_id']; + $value['file_id'] = $file_id; $value['temp']['emp_id'] = null; // dummy value for using exisitng funciton in model if (strtolower(trim($value['relationship'])) === 'mother' || strtolower(trim($value['relationship'])) === 'Father') { @@ -2059,6 +2060,11 @@ public function employeesEnrollmentInsert($params) } } //end of for loop + $this->fileModel->where('id', $file_id)->set(['status' => 'success','reason' => ''])->update(); + $this->myLogger->logme("error",'{file_id} uploaded success',['file_id' => $file_id]); + + $this->setPullNotification($this->getFileMetaDataByFileId($file_id,'success')); + return true; } diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index a001d0f3..62e7e626 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -95,7 +95,9 @@ class PolicyTransactionController extends BaseController // Policy Transaction Inception public function viewInception() - { + { + $data['page_name'] = 'Policy'; + $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance']; $data['client_type'] = [1 => 'Group', 2 => 'Individual']; $data['issuing_type'] = [1 => 'Fresh', 2 => 'Renewal', 3 => 'Roll Over']; @@ -761,6 +763,8 @@ class PolicyTransactionController extends BaseController // echo '
';
         // !dd($this->getEndorsementDataForEdit(17));
 
+        $data['page_name'] = 'Endorsement';
+
         $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
         $data['client_type'] = [1 => 'Group', 2 => 'Individual'];
 
@@ -1236,6 +1240,8 @@ class PolicyTransactionController extends BaseController
     public function reportBDS()
     {   
 
+        $data['page_name'] = 'BDS Report';
+
         $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
         $data['client_type'] = [1 => 'Group', 2 => 'Individual'];
         $data['issuing_type'] = [1 => 'Fresh', 2 => 'Renewal', 3 => 'Roll Over'];
@@ -1292,7 +1298,9 @@ class PolicyTransactionController extends BaseController
     }
 
     public function reportVarience()
-    {
+    {   
+        $data['page_name'] = 'Variance Report';
+
         $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
         $data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll();
         $data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
@@ -1332,7 +1340,9 @@ class PolicyTransactionController extends BaseController
 
 
     public function reportBusinessList()
-    {
+    {   
+        $data['page_name'] = 'Business Report';
+
         $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
         $data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll();
         $data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
@@ -1370,7 +1380,9 @@ class PolicyTransactionController extends BaseController
 
 
     public function reportFinanceList()
-    {
+    {   
+        $data['page_name'] = 'Finance Report';
+
         $data['issuer'] = [1 => 'JIBS', 2 => 'Nhance'];
         $data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll();
         $data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
diff --git a/app/Views/file_list.php b/app/Views/file_list.php
index c2872c70..2cd80976 100755
--- a/app/Views/file_list.php
+++ b/app/Views/file_list.php
@@ -247,10 +247,11 @@ $('body').on('click', '.upload_button', function() {
 
 
 $('body').on('click', '.truncate2', function(event) {
+
     event.preventDefault();
     // console.log(event);
     var fileId = JSON.parse(this.getAttribute('data-id'));
-    // alert('Hi' + fileId);
+    console.log('Truncate File ID' + fileId);
 
     Swal.fire({
         title: "Do you want to truncate data from uploaded file?",
@@ -260,10 +261,13 @@ $('body').on('click', '.truncate2', function(event) {
     }).then((result) => {
 
         console.log(result);
+
         if (result.isConfirmed) {
+
             $('.loader').fadeIn();
             $('.loader-mask').fadeIn();
             var apiURL = 'employee/truncate/' + fileId;
+            // console.log('Truncate API URL : ', apiURL);
 
             $.ajax({
                 url: apiURL,
@@ -272,6 +276,9 @@ $('body').on('click', '.truncate2', function(event) {
                     "X-Requested-With": "XMLHttpRequest"
                 },
                 success: function(response) {
+
+                    // console.log('Truncate Response', response)
+
                     setTimeout(function() {
                         $('.loader').fadeOut();
                         $('.loader-mask').delay(350).fadeOut('slow');
@@ -294,6 +301,10 @@ $('body').on('click', '.truncate2', function(event) {
                     }
                 },
                 error: function(xhr, status, error) {
+
+                    console.error(xhr.responseText);
+                    console.error(status, error);
+
                     setTimeout(function() {
                         $('.loader').fadeOut();
                         $('.loader-mask').delay(350).fadeOut('slow');
@@ -304,6 +315,7 @@ $('body').on('click', '.truncate2', function(event) {
                 }
             });
         }
+
     });
 })