FIX_LIVE_ISSUE_IN_ENROLLMENT : RV

This commit is contained in:
VENKATESHWARAN 2024-10-07 09:58:01 +05:30
parent 4ad6c93746
commit 6aa523ce04
4 changed files with 45 additions and 8 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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 '<pre>';
// !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();

View File

@ -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 = '<?php echo base_url(); ?>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) {
}
});
}
});
})