From b726b9530dcce44b46f1ea0e324c09a1ad3b23e8 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Mon, 21 Oct 2024 09:08:10 +0530 Subject: [PATCH 1/6] CHANGE_VIEW_MEMBERS_LIST_PAGE : RV --- app/Views/employee_data_list.php | 68 ++++++++++++++++---------------- app/Views/employee_list.php | 7 ---- app/Views/leads_form.php | 25 ++++++++++-- 3 files changed, 55 insertions(+), 45 deletions(-) diff --git a/app/Views/employee_data_list.php b/app/Views/employee_data_list.php index e3791918..7a6ae90e 100755 --- a/app/Views/employee_data_list.php +++ b/app/Views/employee_data_list.php @@ -34,6 +34,10 @@ position: absolute; } +.right-align-input { + text-align: right; +} + @@ -47,24 +51,23 @@

Employees

- +
- - + - - - - - + - - + - + + + + @@ -86,19 +89,18 @@ - - + - - - - - + - - + - + + + + @@ -132,24 +134,22 @@ - + - - + - - - - - + - - + + + + @@ -174,6 +174,7 @@ if (ticketsTable.length) { ticketsTable.DataTable({ + scrollX: true, dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector @@ -181,9 +182,6 @@ extend: 'csv', text: 'CSV', title: 'Member-List', - exportOptions: { - columns: ':not(:last-child)' - }, }], language: { search: "_INPUT_", diff --git a/app/Views/employee_list.php b/app/Views/employee_list.php index 0d1b3dca..d615e7db 100755 --- a/app/Views/employee_list.php +++ b/app/Views/employee_list.php @@ -115,7 +115,6 @@ var client_id = ''; var client_branch_id = ''; - $(document).ready(function() { console.log("document loaded"); //fetchClientPolicies(); @@ -127,7 +126,6 @@ $(window).on("load", function() { fetchClientPolicies(); }); - function fetchClientPolicies() { $('#loader').show(); var apiURL = '' + 'util/clients-with-policies'; @@ -204,7 +202,6 @@ function fetchClientPolicies() { $('#loader').hide(); } - function appendClients(data) { var clientID = ; $.each(data, function(index, item) { @@ -219,7 +216,6 @@ function appendClients(data) { }); } - function appendBranch(data) { $('#branch_id').empty(); @@ -239,7 +235,6 @@ function appendBranch(data) { }); } - function appendPolicies(data) { $('#policies').empty(); @@ -286,7 +281,6 @@ $(document).ready(function() { }); }); - $(document).ready(function() { $('#branch_id').on('change', function() { @@ -321,7 +315,6 @@ function objectToQueryString(obj) { return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&'); } - function fetchEmpolyeeList(event) { event.preventDefault(); // Prevent default action diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php index 15c97dbe..f00ea8b6 100644 --- a/app/Views/leads_form.php +++ b/app/Views/leads_form.php @@ -537,6 +537,7 @@ function getPolicyData(input) { } } +// Salse team user list data function selecSalsePerson(salse_person_ids) { salse_person_ids = JSON.parse(salse_person_ids); @@ -588,7 +589,7 @@ function addHTMLInput() {
- @@ -602,7 +603,7 @@ function addHTMLInput() {
- @@ -715,7 +716,6 @@ function addHTMLInput() { increment++; // Increment after adding the input } - function removeHTMLInput(element) { const container = document.getElementById('dynamic-form-container'); @@ -849,6 +849,24 @@ $('#lead_type').change(function() { }) +function insurerChange(input, unique_id) { + var lead_type = $('#lead_type').val() + + if(lead_type == 2){ + var val = $(input).val(); + $('#proposed_insurer_'+unique_id).val(val).select2(); + } +} + +function tpaChange(input, unique_id) { + var lead_type = $('#lead_type').val() + + if(lead_type == 2){ + var val = $(input).val(); + $('#proposed_tpa_'+unique_id).val(val).select2(); + } +} + //----------------------------------------------------------------------------------------------------------- function getURLParamsForReport() { @@ -866,4 +884,5 @@ function getURLParamsForReport() { console.log('pt_id', pt_id); // Retain the log if necessary } + \ No newline at end of file From 3ebc9d171a975bb0a102cc9507a57bd5070914b4 Mon Sep 17 00:00:00 2001 From: Smart Date: Wed, 23 Oct 2024 10:29:21 +0530 Subject: [PATCH 2/6] CHANGE_in routes : GWM --- app/Config/Routes.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f8d085da..ccfd0a66 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -390,6 +390,8 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) { $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { + $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); + $routes->post("storeFireBase", "EmployeeRestController::storeFireBase"); $routes->post("saveMpin", "RestAuthenticationController::saveMpin"); $routes->post("updateMpin", "RestAuthenticationController::updateMpin"); From 5637583448623127388d0e3efe8aa4baba25b0e4 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Wed, 23 Oct 2024 12:06:22 +0530 Subject: [PATCH 3/6] FIX_LIVE_ISSUES --- app/Controllers/ClientController.php | 1 + app/Controllers/EmpDataServiceController.php | 134 ++++++++++--------- app/Controllers/EmployeeController.php | 2 + app/Controllers/MasterController.php | 1 + app/Models/EmployeePolicyModel.php | 10 +- app/Views/DashBoard.php | 2 +- app/Views/employee_data_list.php | 4 + app/Views/leads_list.php | 3 + 8 files changed, 90 insertions(+), 67 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 020ff116..c6b3f152 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -2105,6 +2105,7 @@ class ClientController extends AdminController $data['airambulance'] = str_replace(',', '', $this->request->getPost("airambulance")); $data['familytransportationbenefit'] = str_replace(',', '', $this->request->getPost("familytransportationbenefit")); $data['reasonableandcustomarycharges'] = str_replace(',', '', $this->request->getPost("reasonableandcustomarycharges")); + $data['daycaretreatment'] = str_replace(',', '', $this->request->getPost("daycaretreatment")); $data['ayudhtreatmentcover'] = str_replace(',', '', $this->request->getPost("ayudhtreatmentcover")); $data['congenitaldiseasesexternal'] = str_replace(',', '', $this->request->getPost("congenitaldiseasesexternal")); diff --git a/app/Controllers/EmpDataServiceController.php b/app/Controllers/EmpDataServiceController.php index 20353e2f..5cefd249 100755 --- a/app/Controllers/EmpDataServiceController.php +++ b/app/Controllers/EmpDataServiceController.php @@ -312,22 +312,6 @@ class EmpDataServiceController extends BaseController 'db_column_name' => 'total' ] ]; - - // get excel export format structure array - $template_json = $this->clientPolicyModel - ->select('insurer_excel_export_template.jsoncolumns') - ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') - ->where('client_policy.id', $export_data['client_policy_id']) - ->where('insurer_excel_export_template.event_name', $export_data['event_type']) - ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 - ->where('insurer_excel_export_template.type_name', $export_data['actions']) - ->first(); - - if(!empty($template_json) && $template_json != null){ - $excel_header_columns = json_decode($template_json['jsoncolumns'], true); - }else{ - return 6; - } if( $export_data['insurer_or_tpa'] == 'tpa'){ @@ -380,7 +364,7 @@ class EmpDataServiceController extends BaseController [ 'column_index' => 9, 'column_name' => 'DATE OF COVERAGE', - 'db_column_name' => 'date_of_coverage' + 'db_column_name' => 'date_coverage' ], [ 'column_index' => 10, @@ -438,6 +422,22 @@ class EmpDataServiceController extends BaseController 'db_column_name' => 'total' ] ]; + }else{ + // get excel export format structure array + $template_json = $this->clientPolicyModel + ->select('insurer_excel_export_template.jsoncolumns') + ->join('insurer_excel_export_template', 'insurer_excel_export_template.insurer_id = client_policy.insurer_id and insurer_excel_export_template.policy_type_id = client_policy.policy_type_id') + ->where('client_policy.id', $export_data['client_policy_id']) + ->where('insurer_excel_export_template.event_name', $export_data['event_type']) + ->where('insurer_excel_export_template.is_active', 1) //Live issue changes 17-10-2024 + ->where('insurer_excel_export_template.type_name', $export_data['actions']) + ->first(); + + if(!empty($template_json) && $template_json != null){ + $excel_header_columns = json_decode($template_json['jsoncolumns'], true); + }else{ + return 6; + } } $excel_data_info = generate_insurer_based_excel($excel_header_columns, $objects); @@ -1253,20 +1253,26 @@ class EmpDataServiceController extends BaseController $insurer_or_tpa = $file['insurer_or_tpa']; if ($insurer_or_tpa == 'tpa') { - $id = 'tpa_id'; } else if ($insurer_or_tpa == 'insurer') { - $id = 'uhid'; } + $ref_data = [ + 'client_id' => $client_id, + 'client_policy_id' => $client_policy_id, + 'client_branch_id' => $client_branch_id, + 'insurer_or_tpa' => $insurer_or_tpa, + 'event_type' => $file['event_type'], + ]; + $file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name']; $excel_data = $this->readExcelFileToArray($file_name_with_path); $excel_header = $excel_data[0]; unset($excel_data[0]); - array_pop($excel_data); + // array_pop($excel_data); - $inceptionHeader = ['S.No', 'NAME OF EMP/DEP','EMP ID','EMP/DEP TYPE','RELATIONSHIP CODE','DOB','GENDER','PRE EXISTING AILMENTS','BASIC COVER SI','DATE OF COVERAGE','AGE','RELATIONSHIP','REMARKS','POLICY END DATE','NO OF DAYS','TPA ID','UHID','PREMIUM','PR0 RATA PREMIUM','GST','TOTAL']; + $inceptionHeader = ['S.No', 'NAME OF EMP/DEP','EMP ID','EMP/DEP TYPE','RELATIONSHIP CODE','DOB','GENDER','PRE EXISTING AILMENTS','BASIC COVER SI','DATE OF COVERAGE','AGE','RELATIONSHIP','REMARKS','POLICY END DATE','NO OF DAYS','TPA ID','UHID','PREMIUM','PR0 RATA PREMIUM','GST','TOTAL AMOUNT']; foreach ($inceptionHeader as $key => $value) { if($excel_header[$key] != $value){ @@ -1280,49 +1286,50 @@ class EmpDataServiceController extends BaseController $this->setPullNotification($file_data); $this->myLogger->logme('error', 'Inception File Validation -- Upload the worng excel file'); - return ['status' => 'error', 'message' => 'Upload the worng excel file']; + return ['status' => 'error', 'message' => 'Upload the worng excel file', 'excel_header' => $excel_header, 'inception_header' => $inceptionHeader]; } } $emp_count = count($excel_data); - $employee_data = $this->employeePolicyModel - ->select(' - - employee_polices.id as emp_policy_id, - employees.name AS emp_name, - employees.emp_code AS emp_code, - "Has Define" as emp_type, - employees.relationship_code AS emp_relationship_code, - employees.dob AS emp_dob, - employees.gender AS emp_gender, - employee_polices.pre_existing_alignments, - employee_polices.basic_cover_si, - employee_polices.date_coverage, - TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age, - employees.relationship AS emp_relationship, - employees.change_event AS change_event, - employee_polices.policy_end_date, - employee_polices.days, - employee_polices.tpa_id, - employee_polices.uhid, - employee_polices.premium, - employee_polices.rata_premimum, - employee_polices.gst, - (employee_polices.rata_premimum + employee_polices.gst) AS total - ') + $employee_data = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($ref_data, 1); - ->join('employees', 'employees.id = employee_polices.employee_id') - ->where('employee_polices.client_policy_id', $client_policy_id) - ->where('employees.client_id', $client_id) - ->where('employees.client_branch_id', $client_branch_id) - ->where("employee_polices.{$id} IS NULL OR employee_polices.{$id} = ''") - ->where('employee_polices.is_active', 1) - ->where('employee_polices.status', 'active') - ->where('employees.is_active', 1) - ->where('employees.emp_status', 'active') - ->findAll(); + // ->select(' + + // employee_polices.id as emp_policy_id, + // employees.name AS emp_name, + // employees.emp_code AS emp_code, + // "Has Define" as emp_type, + // employees.relationship_code AS emp_relationship_code, + // employees.dob AS emp_dob, + // employees.gender AS emp_gender, + // employee_polices.pre_existing_alignments, + // employee_polices.basic_cover_si, + // employee_polices.date_coverage, + // TIMESTAMPDIFF(YEAR, employees.dob, CURDATE()) AS emp_age, + // employees.relationship AS emp_relationship, + // employees.change_event AS change_event, + // employee_polices.policy_end_date, + // employee_polices.days, + // employee_polices.tpa_id, + // employee_polices.uhid, + // employee_polices.premium, + // employee_polices.rata_premimum, + // employee_polices.gst, + // (employee_polices.rata_premimum + employee_polices.gst) AS total + // ') + + // ->join('employees', 'employees.id = employee_polices.employee_id') + // ->where('employee_polices.client_policy_id', $client_policy_id) + // ->where('employees.client_id', $client_id) + // ->where('employees.client_branch_id', $client_branch_id) + // ->where("employee_polices.{$id} IS NULL OR employee_polices.{$id} = ''") + // ->where('employee_polices.is_active', 1) + // ->where('employee_polices.status', 'active') + // ->where('employees.is_active', 1) + // ->where('employees.emp_status', 'active') + // ->findAll(); @@ -1372,15 +1379,14 @@ class EmpDataServiceController extends BaseController $difference = $emp_data_count - $excel_data_count; $status = 'in-progress'; - if ($excel_data_count < $emp_data_count) { + if ($excel_data_count < $emp_data_count) { $status = 'in-progress-partially'; $partially_updated_data = 'Expected : ' . $emp_data_count . ', ' . 'Updated : ' . $excel_data_count . ', ' . 'difference : ' . $difference; $this->myLogger->logme('error', 'Inception File Validation -- excel file count partially : {data}', ['data' => $partially_updated_data]); } - if ($emp_data_count < $excel_data_count) { $data = [ @@ -1498,11 +1504,11 @@ class EmpDataServiceController extends BaseController ]; } - if ($emp_value['days'] != $excel_data[$key][14]) { + if ($emp_value['no_of_days'] != $excel_data[$key][14]) { $errors[$key][] = [ 'row' => $key, 'column' => 14, - 'db_data' => $emp_value['days'], + 'db_data' => $emp_value['no_of_days'], 'excel_data' => $excel_data[$key][14] ]; } @@ -1516,11 +1522,11 @@ class EmpDataServiceController extends BaseController ]; } - if ($emp_value['rata_premimum'] != $excel_data[$key][18]) { + if ($emp_value['pro_rata_premium'] != $excel_data[$key][18]) { $errors[$key][] = [ 'row' => $key, 'column' => 18, - 'db_data' => $emp_value['rata_premimum'], + 'db_data' => $emp_value['pro_rata_premium'], 'excel_data' => $excel_data[$key][18] ]; } @@ -1557,7 +1563,7 @@ class EmpDataServiceController extends BaseController } } - $batch_list_id[] = $emp_value['emp_policy_id']; + $batch_list_id[] = $emp_value['primaryKey']; } diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 1df4dc16..6ddc5808 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -1399,6 +1399,8 @@ class EmployeeController extends AdminController $error_data = json_decode($file['error_data']); + // dd($error_data); + $file_name_with_path = WRITEPATH . "/uploads/import_excel/" . $file['file_name']; if (!file_exists($file_name_with_path)) { diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index a37da6bd..691234eb 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -175,6 +175,7 @@ class MasterController extends AdminController $editData['action'] = ['import' => 'Import', 'export' => 'Export']; $editData['db_column_name'] = [ + 'S.No.' => 'index', 'Employee Name' => 'emp_name', 'Employee ID' => 'emp_code', 'Date of Birth' => 'emp_dob', diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index f9e11a2b..a0172b1d 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -168,7 +168,7 @@ class EmployeePolicyModel extends Model //------------------------------------------------------------------------------------------------------- - public function getInceptionEmployeeDataForExportExcel($ref_data) + public function getInceptionEmployeeDataForExportExcel($ref_data, $return_type = 0) { $client_policy_id = $ref_data['client_policy_id']; $client_branch_id = $ref_data['client_branch_id']; @@ -269,7 +269,12 @@ class EmployeePolicyModel extends Model // Get the result set $query = $this->db->query($sql); - $results = $query->getResult(); + + if($return_type == 1){ + $results = $query->getResultArray(); + }else{ + $results = $query->getResult(); + } return $results; } @@ -1019,6 +1024,7 @@ class EmployeePolicyModel extends Model try { // Execute the query $this->db->query($sql); + // Commit the transaction if ($this->db->transStatus() === FALSE) { diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php index 16f0ec66..4da6b9c0 100755 --- a/app/Views/DashBoard.php +++ b/app/Views/DashBoard.php @@ -202,7 +202,7 @@ body { - +
From ca0abe663fbee9ffa13dde526c75c874ed1b61ec Mon Sep 17 00:00:00 2001 From: Smart Date: Wed, 23 Oct 2024 14:06:24 +0530 Subject: [PATCH 4/6] CHANGE_ in iAgreeForAddOn : GWM --- app/Controllers/EmployeeRestController.php | 30 ++++++++++++------- .../RestAuthenticationController.php | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index c13eb6ba..0ac4e935 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1856,6 +1856,7 @@ class EmployeeRestController extends AdminController public function iAgreeForAddOn() { + $postData = json_decode($this->request->getBody(), true); $client_policy_id = $postData['client_policy_id']; sort($client_policy_id); @@ -1876,21 +1877,30 @@ class EmployeeRestController extends AdminController $array_list = []; foreach ($client_policy_id as $key => $value) { - foreach ($empData as $empDataKey => $empDataValue) + $policy = $this->clientPolicyModel->where('id',$value)->where('open_for_enrollment',1)->find(); + if($policy) { - $this->employeePolicyModel->where('client_policy_id', $value ) - ->where('is_active', 1 ) - ->where('employee_id', $empDataValue['id'] ) - ->set(array('status'=>'enrolled')) - ->update(); + foreach ($empData as $empDataKey => $empDataValue) + { + $this->employeePolicyModel->where('client_policy_id', $value ) + ->where('is_active', 1 ) + ->where('employee_id', $empDataValue['id'] ) + ->set(array('status'=>'enrolled')) + ->update(); + } + + $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']); + if(count($find) > 0){ + $array_list[] = $find; + } + } - $find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']); - if(count($find) > 0){ - $array_list[] = $find; - } } + print_r($array_list); + die; + $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first(); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index d4256270..a33cff95 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -94,7 +94,7 @@ class RestAuthenticationController extends AdminController { try { $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp_verification; + $otp_verification = $this->request->getJSON()->otp; $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); From f68612d90ceaf065d95ba0356c34fdb1d9ada043 Mon Sep 17 00:00:00 2001 From: Smart Date: Wed, 23 Oct 2024 14:10:10 +0530 Subject: [PATCH 5/6] CHANGE_ in iAgreeForAddOn : GWM --- app/Controllers/EmployeeRestController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 0ac4e935..b4359c53 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -1898,9 +1898,6 @@ class EmployeeRestController extends AdminController } - print_r($array_list); - die; - $notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first(); From 4392468481de0318f7c961473b36939cdf77b325 Mon Sep 17 00:00:00 2001 From: Smart Date: Fri, 25 Oct 2024 11:54:55 +0530 Subject: [PATCH 6/6] CHANGE_ getVerifiedUserData API : GWM --- app/Controllers/RestAuthenticationController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index a33cff95..bed2e473 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -94,9 +94,16 @@ class RestAuthenticationController extends AdminController { try { $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp; + $otp_verification = $this->request->getJSON()->otp_verification; - $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + if (isset($this->request->getJSON()->login_by_hr)) + { + $employeeData = $this->employeeModel->where('id', $this->request->getJSON()->employee_id)->where('relationship', 'self')->first(); + }else{ + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + } + + if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr)) { $auth = HttpRequestHelper::getRequestInfo();
SNO Client/Branch BranchName/codeNameEMP CodeRelationshipDate of Birth Policy name Insurer name TPA ID
-