CHANGE_RACK_RATE_TO_SHOW_ALL_AND_PREMIUM_TYPE_AND_EMP_LIST_UPLOAD_BATCH_LIST_TABLE_ISSUE_FIX : RV

This commit is contained in:
VENKATESHWARAN 2024-05-21 11:22:43 +05:30
parent 7f1073974e
commit dddc960142
14 changed files with 817 additions and 362 deletions

3
.gitignore vendored
View File

@ -22,6 +22,9 @@ writable/debugbar/*
writable/**/*.db writable/**/*.db
writable/**/*.sqlite writable/**/*.sqlite
writable/e_card_template/*
!writable/e_card_template/.gitkeep
vendor/ vendor/
build/ build/

View File

@ -770,18 +770,18 @@ class ClientController extends AdminController
$policy_type = $this->request->getPost('policy_type'); $policy_type = $this->request->getPost('policy_type');
$client_id = $this->request->getPost('client_id'); $client_id = $this->request->getPost('client_id');
$client_policy_id = $this->request->getPost('client_policy_id'); $client_policy_id = $this->request->getPost('client_policy_id');
// $premium_type = $this->request->getPost('premium_type'); $premium_type = $this->request->getPost('premium_type');
if (!empty($client_id) && $client_id != null) { if (!empty($client_id) && $client_id != null) {
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first(); $client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$client_id = $client_policy_data['client_id']; $client_id = $client_policy_data['client_id'];
} }
$policy_grid_id = $this->request->getPost('policy_grid_id'); $policy_grid_id = $this->request->getPost('policy_grid_id');
if($policy_grid_id == 10 || $policy_grid_id == 11){ // if($policy_grid_id == 10 || $policy_grid_id == 11){
$premium_type = 1; // $premium_type = 1;
}else{ // }else{
$premium_type = 2; // $premium_type = 2;
} // }
$si_or_bp = $this->request->getPost('si_or_bp'); $si_or_bp = $this->request->getPost('si_or_bp');
$basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier')); $basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier'));
@ -1122,15 +1122,18 @@ class ClientController extends AdminController
->join('employee_polices ep', "cp.id = ep.client_policy_id AND employees.id = ep.employee_id") ->join('employee_polices ep', "cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
->where("employees.client_id", $record['client_id']) ->where("employees.client_id", $record['client_id'])
->where("employees.emp_status", 'active') ->where("employees.emp_status", 'active')
->where("ep.status", 'active')
->where("employees.is_active", 1)
->where("ep.is_active", 1)
->countAllResults(); ->countAllResults();
$data = $this->employeePolicyModel->select('employee_polices.id') // $data = $this->employeePolicyModel->select('employee_polices.id')
->where('employee_polices.is_active', 1) // ->where('employee_polices.is_active', 1)
->where('employee_polices.client_policy_id', $client_policy_id) // ->where('employee_polices.client_policy_id', $client_policy_id)
->findAll(); // ->findAll();
$emp_count = count($data); // $emp_count = count($data);
// if($emp_count == 0){ // if($emp_count == 0){
// $emp_count = true; // $emp_count = true;
@ -1176,24 +1179,25 @@ class ClientController extends AdminController
if ($search_term === 'GMC') { if ($search_term === 'GMC') {
$resultss = []; // $resultss = [];
$resultss = $results;
try { // try {
foreach ($results as $index => $record) { // foreach ($results as $index => $record) {
// if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) { // // if ($self->self == 1 && $self->spouse == 0 && $self->childrens == 0 && $self->parents == 0 && $self->{'parents-in-law'} == 0 && $self->{'either-parents-pil'} == 0 && $family_floater == 0) {
if ($family_floater == 1) { // if ($family_floater == 1) {
if ($index == '7' || $index == '8' || $index == '9' || $index == '10') { // if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
$resultss[$index] = $record; // $resultss[$index] = $record;
} // }
} else { // } else {
if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') { // if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
$resultss[$index] = $record; // $resultss[$index] = $record;
} // }
} // }
} // }
} catch (\Exception $e) { // } catch (\Exception $e) {
$resultss = $results; // Reset $resultss to an empty array if an exception occurs // $resultss = $results; // Reset $resultss to an empty array if an exception occurs
} // }

View File

@ -960,6 +960,7 @@ class EmpDataServiceController extends BaseController
$file_id = $params['file_id']; $file_id = $params['file_id'];
$file = $this->batchFileModel->find($file_id); $file = $this->batchFileModel->find($file_id);
if (!$file) { if (!$file) {
$data = [ $data = [
'status' => 'failed-4', 'status' => 'failed-4',
]; ];
@ -980,6 +981,15 @@ class EmpDataServiceController extends BaseController
$batch_code = $file['batch_code']; $batch_code = $file['batch_code'];
$user_id = $file['created_by']; $user_id = $file['created_by'];
$get_policy_type = $this->clientPolicyModel
->select('policy_type.policy_type, policies.policy_type_id as policy_type_id')
->join('policies', 'policies.id = client_policy.policy_id')
->join('policy_type', 'policy_type.id = policies.policy_type_id')
->where('client_policy.id', $client_policy_id)
->first();
$status_val = 'success'; $status_val = 'success';
if ($status == 'in-progress-partially') { if ($status == 'in-progress-partially') {
@ -995,16 +1005,21 @@ class EmpDataServiceController extends BaseController
array_pop($excel_data); // Remove footer row array_pop($excel_data); // Remove footer row
$totals = 0; $totals = 0;
$empty_emp_tpa_uh_ids = []; $emp_policy_ids = [];
$emp_details = [];
$tpa_id = [];
$uhid = [];
$emp_count = count($excel_data); $emp_count = count($excel_data);
$db = \Config\Database::connect(); $db = \Config\Database::connect();
foreach ($excel_data as $key => $value) { foreach ($excel_data as $key => $value) {
$name = $value[1]; $name = $value[1];
$emp_code = $value[2]; $emp_code = $value[2];
$tpa_id = $value[15]; $tpa_id[] = $value[15];
$uhid = $value[16]; $uhid[] = $value[16];
$amount = $value[20]; $amount = $value[20];
$totals += $amount; $totals += $amount;
@ -1031,38 +1046,41 @@ class EmpDataServiceController extends BaseController
// Get the result // Get the result
$result = $query->get()->getRowArray(); $result = $query->get()->getRowArray();
if (isset($result['id']) && $result['id'] !== null) { if (isset($result['id']) && $result['id'] !== null) {
$empty_emp_tpa_uh_ids[] = $result['id']; $emp_policy_ids[] = $result['id'];
$emp_details[] = array('id' => $result['id'],'tpa_id' => $value[15], 'uhid' => $value[16]);
} }
$sql = " // $sql = "
UPDATE employee_polices // UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id // JOIN employees ON employees.id = employee_polices.employee_id
SET tpa_id = ? // SET tpa_id = ?
WHERE employees.name = ? // WHERE employees.name = ?
AND employees.emp_code = ? // AND employees.emp_code = ?
AND employee_polices.client_policy_id = ? // AND employee_polices.client_policy_id = ?
AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')"; // AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
$params = [$tpa_id, $name, $emp_code, $client_policy_id]; // $params = [$tpa_id, $name, $emp_code, $client_policy_id];
$db->query($sql, $params); // $db->query($sql, $params);
$sql = " // $sql = "
UPDATE employee_polices // UPDATE employee_polices
JOIN employees ON employees.id = employee_polices.employee_id // JOIN employees ON employees.id = employee_polices.employee_id
SET employee_polices.uhid = ? // SET employee_polices.uhid = ?
WHERE employees.name = ? // WHERE employees.name = ?
AND employees.emp_code = ? // AND employees.emp_code = ?
AND employee_polices.client_policy_id = ? // AND employee_polices.client_policy_id = ?
AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')"; // AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
$params = [$uhid, $name, $emp_code, $client_policy_id]; // $params = [$uhid, $name, $emp_code, $client_policy_id];
$db->query($sql, $params); // $db->query($sql, $params);
} }
$return = $this->employeePolicyModel->bulkUpdate($emp_details);
// Update batch file status and amount // Update batch file status and amount
$this->batchFileModel->update($file_id, [ $this->batchFileModel->update($file_id, [
'count' => $emp_count, 'count' => $emp_count,
@ -1076,14 +1094,13 @@ class EmpDataServiceController extends BaseController
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID total amount for cash deposite : {data}', ['data'=> $totals]); $this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID total amount for cash deposite : {data}', ['data'=> $totals]);
if ($file['insurer_or_tpa'] == 'tpa') { if ($file['insurer_or_tpa'] == 'tpa') {
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID set cashDepositCalculationForInception and sendMailForDownloadingECard in JOB QUEUE'); $this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID set cashDepositCalculationForInception and sendMailForDownloadingECard in JOB QUEUE');
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id); $policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
$depositeData = [ $depositeData = [
'employeeIds' => $empty_emp_tpa_uh_ids, 'employeeIds' => $emp_policy_ids,
'client_id' => $client_id, 'client_id' => $client_id,
'client_policy_id' => $client_policy_id, 'client_policy_id' => $client_policy_id,
'count' => $emp_count, 'count' => $emp_count,
@ -1096,7 +1113,7 @@ class EmpDataServiceController extends BaseController
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [ $r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [
'employeeIds' => $empty_emp_tpa_uh_ids, 'employeeIds' => $emp_policy_ids,
'client_id' => $client_id, 'client_id' => $client_id,
'client_policy_id' => $client_policy_id, 'client_policy_id' => $client_policy_id,
'count' => $emp_count, 'count' => $emp_count,
@ -1105,18 +1122,22 @@ class EmpDataServiceController extends BaseController
'user_id' => $user_id, 'user_id' => $user_id,
]]); ]]);
if($get_policy_type['policy_type_id'] != 1){
$job_details = new Jobs(); $job_details = new Jobs();
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $empty_emp_tpa_uh_ids]); $r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $emp_policy_ids]);
}
// $this->cashDepositCalculationForInception($depositeData); // $this->cashDepositCalculationForInception($depositeData);
// $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids); // $this->sendMailForDownloadingECard($emp_policy_ids);
} }
$file_data = $this->getDataByFileId($file_id, 'success'); $file_data = $this->getDataByFileId($file_id, 'success');
$this->setPullNotification($file_data); $this->setPullNotification($file_data);
return 'Import Inception Updated '. $status_val . '- Updated Count : ' . $emp_count; return 'Import Inception Updated '. $status_val . '- Updated Count : ' . $emp_count;
} }

View File

@ -122,6 +122,25 @@ class PendingActionsController extends AdminController
public function getPendingActionForCorrection() public function getPendingActionForCorrection()
{ {
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'correction')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'correction')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Subquery builder // Subquery builder
$subqueryBuilder = $this->db->table('emp_endorsement') $subqueryBuilder = $this->db->table('emp_endorsement')
->select(' ->select('
@ -151,10 +170,13 @@ class PendingActionsController extends AdminController
// Main query builder // Main query builder
$builder = $this->db->table('clients'); $builder = $this->db->table('clients');
$builder->select(' $builder->select("
subquery.client_name, subquery.client_name,
subquery.client_id, subquery.client_id,
COUNT(subquery.id) AS subquery_count'); COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left'); $builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id'); $builder->groupBy('clients.id');
@ -165,7 +187,7 @@ class PendingActionsController extends AdminController
$results = $query->getResultArray(); $results = $query->getResultArray();
$filteredResults = array_filter($results, function($value) { $filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0; return $value['subquery_count'] != 0;
}); });
@ -176,6 +198,26 @@ class PendingActionsController extends AdminController
public function getPendingActionForSIEnhancement() public function getPendingActionForSIEnhancement()
{ {
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'si_enhancement')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'si_enhancement')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the subquery // Build the subquery
$subqueryBuilder = $this->db->table('emp_endorsement') $subqueryBuilder = $this->db->table('emp_endorsement')
->select(' ->select('
@ -208,13 +250,16 @@ class PendingActionsController extends AdminController
// Build the main query // Build the main query
$builder = $this->db->table('clients'); $builder = $this->db->table('clients');
$builder->select(' $builder->select("
clients.id, clients.id,
subquery.client_name, subquery.client_name,
subquery.client_id, subquery.client_id,
subquery.client_policy_id, subquery.client_policy_id,
subquery.policy_name, subquery.policy_name,
COUNT(subquery.id) AS subquery_count'); COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left'); $builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id'); $builder->groupBy('clients.id');
@ -225,7 +270,7 @@ class PendingActionsController extends AdminController
$results = $query->getResultArray(); $results = $query->getResultArray();
$filteredResults = array_filter($results, function($value) { $filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0; return $value['subquery_count'] != 0;
}); });
@ -236,6 +281,26 @@ class PendingActionsController extends AdminController
public function getPendingActionForDeletion() public function getPendingActionForDeletion()
{ {
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'deletion')
->where('bl.insurer_or_tpa', 'insurer')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_id = clients.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'deletion')
->where('bl.insurer_or_tpa', 'insurer')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the subquery // Build the subquery
$subqueryBuilder = $this->db->table('emp_endorsement') $subqueryBuilder = $this->db->table('emp_endorsement')
->select(' ->select('
@ -268,13 +333,16 @@ class PendingActionsController extends AdminController
// Build the main query // Build the main query
$builder = $this->db->table('clients'); $builder = $this->db->table('clients');
$builder->select(' $builder->select("
clients.id, clients.id,
subquery.client_name, subquery.client_name,
subquery.client_id, subquery.client_id,
subquery.client_policy_id, subquery.client_policy_id,
subquery.policy_name, subquery.policy_name,
COUNT(subquery.id) AS subquery_count'); COUNT(subquery.id) AS subquery_count,
($subQueryExport) AS batch_export_count,
($subQueryImport) AS batch_import_count
");
$builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left'); $builder->join('(' . $subqueryBuilder->getCompiledSelect() . ') AS subquery', 'clients.id = subquery.client_id', 'left');
$builder->groupBy('clients.id'); $builder->groupBy('clients.id');
@ -284,7 +352,7 @@ class PendingActionsController extends AdminController
// Fetch the results // Fetch the results
$results = $query->getResultArray(); $results = $query->getResultArray();
$filteredResults = array_filter($results, function($value) { $filteredResults = array_filter($results, function ($value) {
return $value['subquery_count'] != 0; return $value['subquery_count'] != 0;
}); });
@ -294,26 +362,43 @@ class PendingActionsController extends AdminController
public function getPendingActionForUHIDEmpty() public function getPendingActionForUHIDEmpty()
{ {
// Build the query // Subquery for batch_export_count
$builder = $this->db->table('employee_polices'); $subQueryExport = $this->db->table('batch_files bl')
$builder->select(' ->select('COUNT(*)')
employee_polices.client_policy_id, ->where('bl.client_policy_id = cp.id')
employee_polices.uhid, ->where('bl.actions', 'export')
clients.short_name, ->where('bl.event_type', 'inception')
clients.client_name, ->where('bl.insurer_or_tpa', 'insurer')
policies.name as policy_name, ->getCompiledSelect();
clients.id as client_id
');
$builder->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1');
$builder->join('clients', 'clients.id = client_policy.client_id');
$builder->join('policies', 'policies.id = client_policy.policy_id');
$builder->where('employee_polices.uhid', null);
$builder->where('employee_polices.status', 'active');
$builder->where('employee_polices.is_active', 1);
$builder->groupBy('employee_polices.client_policy_id');
// Execute the query // Subquery for batch_import_count
$query = $builder->get(); $subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = cp.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'insurer')
->where('bl.status', 'success')
->getCompiledSelect();
// Main query
$query = $this->db->table('employee_polices ep')
->select('c.id as client_id')
->select('ep.client_policy_id')
->select('c.client_name')
->select('c.short_name')
->select('p.name as policy_name')
->select('ep.uhid')
->select("($subQueryExport) AS batch_export_count", false)
->select("($subQueryImport) AS batch_import_count", false)
->join('client_policy cp', 'ep.client_policy_id = cp.id AND cp.is_active = 1 AND cp.policy_status = 1')
->join('clients c', 'c.id = cp.client_id')
->join('policies p', 'p.id = cp.policy_id')
->where('ep.uhid IS NULL')
->where('ep.status', 'active')
->where('ep.is_active', 1)
->groupBy('ep.client_policy_id, ep.uhid, c.short_name, p.name')
->get();
// Fetch the results // Fetch the results
$results = $query->getResultArray(); $results = $query->getResultArray();
@ -325,6 +410,25 @@ class PendingActionsController extends AdminController
public function getPendingActionForTPAIDEmpty() public function getPendingActionForTPAIDEmpty()
{ {
// Subquery for batch_export_count
$subQueryExport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = client_policy.id')
->where('bl.actions', 'export')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'tpa')
->getCompiledSelect();
// Subquery for batch_import_count
$subQueryImport = $this->db->table('batch_files bl')
->select('COUNT(*)')
->where('bl.client_policy_id = client_policy.id')
->where('bl.actions', 'import')
->where('bl.event_type', 'inception')
->where('bl.insurer_or_tpa', 'tpa')
->where('bl.status', 'success')
->getCompiledSelect();
// Build the query // Build the query
$builder = $this->db->table('employee_polices'); $builder = $this->db->table('employee_polices');
$builder->select(' $builder->select('
@ -337,6 +441,9 @@ class PendingActionsController extends AdminController
policies.name as policy_name, policies.name as policy_name,
clients.id as client_id clients.id as client_id
'); ');
$builder->select("($subQueryExport) AS batch_export_count", false);
$builder->select("($subQueryImport) AS batch_import_count", false);
$builder->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1'); $builder->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1');
$builder->join('clients', 'clients.id = client_policy.client_id'); $builder->join('clients', 'clients.id = client_policy.client_id');
$builder->join('policies', 'policies.id = client_policy.policy_id'); $builder->join('policies', 'policies.id = client_policy.policy_id');

View File

@ -218,3 +218,23 @@ if (!function_exists('format_indian_number')) {
} }
if (!function_exists('get_username')) {
function get_username($user_id) {
// Connect to the database
$db = \Config\Database::connect();
// Query the database
$query = $db->table('user_profiles')
->select('first_name')
->where('id', $user_id)
->get();
// Get the result
$result = $query->getRow();
// Return the username if found, otherwise return null
return $result ? $result->first_name : null;
}
}

View File

@ -790,4 +790,69 @@ class EmployeePolicyModel extends Model
} }
public function bulkUpdate($emp_details)
{
// Extract IDs, tpa_ids, and uhids
$ids = array_column($emp_details, 'id');
$tpa_ids = array_column($emp_details, 'tpa_id');
$uhids = array_column($emp_details, 'uhid');
// Escape values for SQL
$escapedIds = array_map([$this->db, 'escape'], $ids);
$escapedTpaIds = array_map([$this->db, 'escape'], $tpa_ids);
$escapedUhids = array_map([$this->db, 'escape'], $uhids);
// Construct the CASE statements
$caseTpaId = array_map(function($id, $tpa_id) {
return "WHEN id = $id THEN $tpa_id";
}, $escapedIds, $escapedTpaIds);
$caseUhid = array_map(function($id, $uhid) {
return "WHEN id = $id THEN $uhid";
}, $escapedIds, $escapedUhids);
// Convert cases to a string
$caseTpaIdString = implode(' ', $caseTpaId);
$caseUhidString = implode(' ', $caseUhid);
// Convert ids to a string
$idsString = implode(', ', $escapedIds);
// Construct the SQL query
$sql = "
UPDATE {$this->table}
SET
tpa_id = CASE {$caseTpaIdString} END,
uhid = CASE {$caseUhidString} END
WHERE id IN ({$idsString})
";
// Begin a transaction
$this->db->transBegin();
try {
// Execute the query
$this->db->query($sql);
// Commit the transaction
if ($this->db->transStatus() === FALSE) {
// If something went wrong, rollback
$this->db->transRollback();
throw new \Exception('Bulk update failed.');
} else {
// Otherwise, commit
$this->db->transCommit();
}
return $this->db->getLastQuery();
} catch (\Exception $e) {
// Rollback the transaction on error
$this->db->transRollback();
throw $e;
}
}
} }

View File

@ -1,11 +1,11 @@
<style> <style>
.table-responsive { .table-responsive {
overflow-x: auto; overflow-x: auto;
} }
.reload:hover { .reload:hover {
cursor: pointer; cursor: pointer;
} }
</style> </style>
<div class="col-12"> <div class="col-12">
@ -22,16 +22,17 @@
<thead class="bg-light"> <thead class="bg-light">
<tr> <tr>
<th class="font-weight-medium">SNO</th> <th class="font-weight-medium">SNO</th>
<th class="font-weight-medium">Batch Code</th> <th class="font-weight-medium">Batch <br> Code</th>
<th class="font-weight-medium">File Name</th> <th class="font-weight-medium">File Name</th>
<th class="font-weight-medium">Client</th> <th class="font-weight-medium">Client</th>
<th class="font-weight-medium">Client Policy</th> <th class="font-weight-medium">Client Policy</th>
<th class="font-weight-medium">Event Type</th> <th class="font-weight-medium">Event <br> Type</th>
<th class="font-weight-medium">Insurer/TPA</th> <th class="font-weight-medium">Insurer/ <br> TPA</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium">Action</th>
<th class="font-weight-medium">Count</th> <th class="font-weight-medium">Count</th>
<th class="font-weight-medium">Amount</th> <th class="font-weight-medium">()Amount</th>
<th class="font-weight-medium">status</th> <th class="font-weight-medium">User/Time</th>
<th class="font-weight-medium">Status</th>
</tr> </tr>
</thead> </thead>
@ -44,30 +45,50 @@
<tr> <tr>
<td><b><?php echo ($key + 1) ?></b></td> <td><b><?php echo ($key + 1) ?></b></td>
<td><?php echo $file['batch_code'] ?></td> <td><?php echo $file['batch_code'] ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top" title="<?php echo $file['file_name'] ?>"><?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?></td> <td class="reload" data-toggle="tooltip" data-placement="top"
title="<?php echo $file['file_name'] ?>">
<?php echo strlen($file['file_name']) > 5 ? substr($file['file_name'], 0, 10) . "..." : $file['file_name'] ?>
</td>
<td><?php echo $file['client_short_name'] ?></td> <td><?php echo $file['client_short_name'] ?></td>
<td><?php echo $file['policy_name'] ?></td> <td><?php echo $file['policy_name'] ?></td>
<td><?php echo $file['event_type'] ?></td> <td><?php echo $file['event_type'] ?></td>
<td><?php echo $file['insurer_or_tpa'] ?></td> <td><?php echo $file['insurer_or_tpa'] ?></td>
<td><?php echo $file['actions'] ?></td> <td><?php echo $file['actions'] ?></td>
<td><?php echo $file['count'] ?></td> <td><?php echo $file['count'] ?></td>
<td><?php echo intval($file['amount']) ?></td>
<td class="indian-number"><?php echo intval($file['amount']) ?></td>
<td class="reload" data-toggle="tooltip" data-placement="top" title="<?php echo date('d-M-Y H:i:a', strtotime($file['created_at'])) ?> by <?php echo get_username($file['created_by']) ?>">
<?php echo strlen($file['created_at']) > 5 ? substr(date('d-M-Y H:i:a', strtotime($file['created_at'])), 0, 6) . "..." : $file['created_at'] ?>
</td>
<td> <td>
<?php if ($file['status'] == 'failed') { ?> <?php if ($file['status'] == 'failed') { ?>
<?php echo $file['status']; ?> <a href="<?= base_url('/util/export-import-error-list/') . $file['id'] ?>" class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank" data-toggle="tooltip" data-placement="top" title="Click to show the error"></a> <?php echo $file['status']; ?> <a
href="<?= base_url('/util/export-import-error-list/') . $file['id'] ?>"
class="fe-alert-circle" style="color: #000;" aria-hidden="true" target="_blank"
data-toggle="tooltip" data-placement="top" title="Click to show the error"></a>
<?php } else if ($file['status'] == 'partially success') { ?> <?php } else if ($file['status'] == 'partially success') { ?>
<?php echo $file['status']; ?> <?php echo $file['status']; ?>
<?php if ($file['error_data'] != 0) { ?> <?php if ($file['error_data'] != 0) { ?>
<a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="<?= $file['error_data'] ?>"></a> <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="<?= $file['error_data'] ?>"></a>
<?php } ?> <?php } ?>
<?php } else if ($file['status'] == 'failed-1') { ?> <?php } else if ($file['status'] == 'failed-1') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The list of employees provided has already been updated with the TPA ID."></a> failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The list of employees provided has already been updated with the TPA ID."></a>
<?php } else if ($file['status'] == 'failed-2') { ?> <?php } else if ($file['status'] == 'failed-2') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The list of employees provided has already been updated with the UHID."></a> failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The list of employees provided has already been updated with the UHID."></a>
<?php } else if ($file['status'] == 'failed-3') { ?> <?php } else if ($file['status'] == 'failed-3') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="The Excel record count exceeds the DB record count."></a> failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top"
title="The Excel record count exceeds the DB record count."></a>
<?php } else if ($file['status'] == 'failed-4') { ?> <?php } else if ($file['status'] == 'failed-4') { ?>
failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip" data-placement="top" title="Physical File Not Found."></a> failed <a class="fe-alert-circle" style="color: #000;" data-toggle="tooltip"
data-placement="top" title="Physical File Not Found."></a>
<?php } else { ?> <?php } else { ?>
<?php echo $file['status']; ?> <?php echo $file['status']; ?>
<?php } ?> <?php } ?>
@ -113,3 +134,44 @@
}); });
</script> </script>
<script>
// Function to format a number in Indian Rupees format
function formatNumberInIndianRupees(number) {
const maxLength = 16;
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
// Limit the number of digits
value = value.slice(0, maxLength);
// Format the number with commas using Indian numbering system
const formattedNumber = Number(value).toLocaleString('en-IN');
return formattedNumber;
}
// Function to format numbers based on a class
function formatNumbersByClass(className) {
const elements = document.querySelectorAll(`.${className}`);
console.log('element', elements)
elements.forEach(element => {
const number = parseFloat(element.innerText.replace(/,/g, ''));
console.log('number', number)
if (!isNaN(number)) {
console.log(formatNumberInIndianRupees(number))
element.innerText = formatNumberInIndianRupees(number);
}
});
}
// Format numbers when the DOM content is loaded
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
formatNumbersByClass('indian-number');
}, 500);
});
</script>

View File

@ -1,5 +1,4 @@
<style> <style>
.badge2 { .badge2 {
box-shadow: none; box-shadow: none;
} }
@ -21,7 +20,6 @@
border-radius: .25rem; border-radius: .25rem;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
} }
</style> </style>
<div class="row" id="client_list"> <div class="row" id="client_list">
@ -42,13 +40,17 @@
<!-- <th class="font-weight-medium">Employee code</th> --> <!-- <th class="font-weight-medium">Employee code</th> -->
<th class="font-weight-medium">Name/code</th> <th class="font-weight-medium">Name/code</th>
<th class="font-weight-medium">Policy name</th> <th class="font-weight-medium">Policy name</th>
<th class="font-weight-medium">Insurer name</th> <th class="font-weight-medium">Insurer <br> name</th>
<th class="font-weight-medium">TPA ID</th> <th class="font-weight-medium">TPA ID</th>
<th class="font-weight-medium">UHID</th> <th class="font-weight-medium">UHID</th>
<th class="font-weight-medium">Policy status</th> <th class="font-weight-medium">Policy <br> status</th>
<th class="font-weight-medium">Sum Insured</th> <th class="font-weight-medium">()Sum Insured</th>
<th class="font-weight-medium">Premium</th> <th class="font-weight-medium">()Premium</th>
<th class="font-weight-medium">Action</th> <th class="font-weight-medium" id="rata_premium" data-toggle="tooltip" data-placement="top">
()Pro Rata <br> Premium</th>
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">()GST
</th>
<!-- <th class="font-weight-medium">Action</th> -->
</tr> </tr>
</thead> </thead>
@ -60,8 +62,8 @@
<tr> <tr>
<td><b><?php echo ($key + 1)?></b></td> <td><b><?php echo ($key + 1)?></b></td>
<!-- <td><?php echo $employee['emp_code']?></td> --> <td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> -
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> )</td> <?php echo $employee['relationship']?> )</td>
<td><?php echo $employee['policy_name']?></td> <td><?php echo $employee['policy_name']?></td>
<td><?php echo $employee['insurer_short_name']?></td> <td><?php echo $employee['insurer_short_name']?></td>
<td><?php echo $employee['tpa_id']?></td> <td><?php echo $employee['tpa_id']?></td>
@ -83,9 +85,11 @@
} }
?> ?>
</td> </td>
<td> <?php echo $employee['basic_cover_si']?> </td> <td class="indian-number"> <?php echo $employee['basic_cover_si']?> </td>
<td><?php echo $employee['premium']?></td> <td class="indian-number"><?php echo $employee['premium']?></td>
<td> <td class="indian-number"><?php echo $employee['rata_premimum']?></td>
<td class="indian-number"><?php echo $employee['gst']?></td>
<!-- <td>
<div class="btn-group dropdown"> <div class="btn-group dropdown">
<a href="javascript: void(0);" <a href="javascript: void(0);"
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
@ -103,21 +107,40 @@
Unread</a> Unread</a>
</div> </div>
</div> </div>
</td> </td> -->
</tr> </tr>
<?php }}?> <?php }}?>
</tbody> </tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Total</th>
<th class="indian-number"></th>
<th class="indian-number"></th>
<th></th>
</tr>
</tfoot>
</table> </table>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>
<link rel="stylesheet" href="https://unpkg.com/tippy.js@6/dist/tippy.css">
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script> <script>
$(document).ready(function() {
$(document).ready(function(){
$('#tickets-table').DataTable({ $('#tickets-table').DataTable({
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
@ -142,10 +165,72 @@ $(document).ready(function(){
search: "_INPUT_", search: "_INPUT_",
searchPlaceholder: "Search..." searchPlaceholder: "Search..."
}, },
paging: true , paging: true,
// pagingType: 'full_numbers' // pagingType: 'full_numbers'
}); });
}); });
</script>
<script>
// Function to format a number in Indian Rupees format
function formatNumberInIndianRupees(number) {
const maxLength = 16;
let value = number.toString().replace(/\D/g, ''); // Remove non-numeric characters
// Limit the number of digits
value = value.slice(0, maxLength);
// Format the number with commas using Indian numbering system
const formattedNumber = Number(value).toLocaleString('en-IN');
return formattedNumber;
}
// Function to format numbers based on a class
function formatNumbersByClass(className) {
const elements = document.querySelectorAll(`.${className}`);
elements.forEach(element => {
const number = parseFloat(element.innerText.replace(/,/g, ''));
if (!isNaN(number)) {
element.innerText = formatNumberInIndianRupees(number);
}
});
}
// Format numbers when the DOM content is loaded
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
formatNumbersByClass('indian-number');
}, 500);
});
</script>
<script>
$(document).ready(function() {
var table = $('#tickets-table').DataTable({
"footer": true
});
var sumColumn9 = table.column(9).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
console.log(sumColumn9)
var sumColumn10 = table.column(10).data().reduce(function(a, b) {
return parseFloat(a) + parseFloat(b);
}, 0);
console.log(sumColumn10)
$('#tickets-table tfoot th:eq(9)').html(sumColumn9);
$('#tickets-table tfoot th:eq(10)').html(sumColumn10);
});
</script> </script>

View File

@ -183,7 +183,7 @@ function appendPolicies(data) {
$.each(data, function(index, item) { $.each(data, function(index, item) {
var option = $('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.name text: item.name + ' - ' + item.policy_type
}); });
if (PolicyID == item.id) { if (PolicyID == item.id) {
option.attr('selected', true); option.attr('selected', true);
@ -265,6 +265,4 @@ document.getElementById('toggleIcon').addEventListener('click', function() {
icon.classList.toggle('mdi-chevron-up'); icon.classList.toggle('mdi-chevron-up');
}); });
</script> </script>

View File

@ -540,7 +540,7 @@ function appendPolicies(data) {
$.each(data, function(index, item) { $.each(data, function(index, item) {
var option = $('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.name text: item.name + ' - ' + item.policy_type
}); });
if (client_policy_param == item.id) { if (client_policy_param == item.id) {
option.attr('selected', true); option.attr('selected', true);

View File

@ -353,7 +353,7 @@
$.each(data, function(index, item) { $.each(data, function(index, item) {
var option = $('<option>', { var option = $('<option>', {
value: item.id, value: item.id,
text: item.name text: item.name + ' - ' + item.policy_type
}); });
if (client_policy_param2 == item.id) { if (client_policy_param2 == item.id) {
option.attr('selected', true); option.attr('selected', true);

View File

@ -231,6 +231,9 @@
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
}); });
}); });
},
error: function(xhr, status, error) {
console.error(xhr.responseText); // Log the error response
} }
}); });
@ -248,6 +251,9 @@
method: 'GET', method: 'GET',
success: function(response) { success: function(response) {
fetchMessages(); fetchMessages();
},
error: function(xhr, status, error) {
console.error(xhr.responseText); // Log the error response
} }
}); });
} }
@ -298,7 +304,9 @@
method: 'GET', method: 'GET',
success: function(response) { success: function(response) {
if(response.length == 0){ console.log(response);
if (response.length == 0) {
pendingActionCount = 0; pendingActionCount = 0;
localStorage.setItem('pendingActionCount', pendingActionCount); localStorage.setItem('pendingActionCount', pendingActionCount);
@ -311,7 +319,6 @@
let messagesList = $('#messages-list-2'); let messagesList = $('#messages-list-2');
messagesList.empty(); messagesList.empty();
console.log(response);
response.inception.forEach(function(item, index) { response.inception.forEach(function(item, index) {
@ -324,7 +331,7 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString var url = 'employee/upload?' + queryString
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
@ -334,7 +341,7 @@
var toast_body_data = item.client_name + ' - ' + item.policy_name; var toast_body_data = item.client_name + ' - ' + item.policy_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -364,6 +371,9 @@
response.correction.forEach(function(item, index) { response.correction.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = { var queryParams = {
client_id: item.client_id, client_id: item.client_id,
event: 'correction', event: 'correction',
@ -374,7 +384,7 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab' var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
@ -382,8 +392,15 @@
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'; var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info'; var toast_status_word = 'Info';
var title = 'Correction Export Pending';
if (item.batch_export_count > 0) {
title = 'Correction Import Pending';
}
var toast_body_data = item.client_name; var toast_body_data = item.client_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -395,7 +412,7 @@
</button> </button>
</div> </div>
<div class="toast-body" style="${toast_body_css}"> <div class="toast-body" style="${toast_body_css}">
<strong>Correction Pending</strong><br><br> <strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small> <small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer"> <div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a> <a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
@ -409,10 +426,15 @@
messagesList.append(html); messagesList.append(html);
}
}); });
response.deletion.forEach(function(item, index) { response.deletion.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = { var queryParams = {
client_id: item.client_id, client_id: item.client_id,
@ -426,16 +448,22 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab' var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;'; var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'; var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info'; var toast_status_word = 'Info';
var title = 'Deletion Export Pending';
if (item.batch_export_count > 0) {
title = 'Deletion Import Pending';
}
var toast_body_data = item.client_name + ' - ' + item.policy_name; var toast_body_data = item.client_name + ' - ' + item.policy_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -447,7 +475,7 @@
</button> </button>
</div> </div>
<div class="toast-body" style="${toast_body_css}"> <div class="toast-body" style="${toast_body_css}">
<strong>Deletion Pending</strong><br><br> <strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small> <small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer"> <div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a> <a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
@ -461,10 +489,15 @@
messagesList.append(html); messagesList.append(html);
}
}); });
response.si_enhancement.forEach(function(item, index) { response.si_enhancement.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = { var queryParams = {
client_id: item.client_id, client_id: item.client_id,
client_policy_id: item.client_policy_id, client_policy_id: item.client_policy_id,
@ -476,16 +509,22 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab' var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;'; var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'; var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info'; var toast_status_word = 'Info';
var title = 'SI Enhancement Export Pending';
if (item.batch_export_count > 0) {
title = 'SI Enhancement Import Pending';
}
var toast_body_data = item.client_name + ' - ' + item.policy_name; var toast_body_data = item.client_name + ' - ' + item.policy_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -497,7 +536,7 @@
</button> </button>
</div> </div>
<div class="toast-body" style="${toast_body_css}"> <div class="toast-body" style="${toast_body_css}">
<strong>SI Enhancement Pending</strong><br><br> <strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small> <small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer"> <div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a> <a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
@ -511,10 +550,15 @@
messagesList.append(html); messagesList.append(html);
}
}); });
response.tpa.forEach(function(item, index) { response.tpa.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = { var queryParams = {
client_id: item.client_id, client_id: item.client_id,
client_policy_id: item.client_policy_id, client_policy_id: item.client_policy_id,
@ -526,16 +570,22 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab' var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;'; var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'; var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info'; var toast_status_word = 'Info';
var title = 'TPA Export Pending';
if (item.batch_export_count > 0) {
title = 'TPA Import Pending';
}
var toast_body_data = item.client_name + ' - ' + item.policy_name; var toast_body_data = item.client_name + ' - ' + item.policy_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -547,7 +597,7 @@
</button> </button>
</div> </div>
<div class="toast-body" style="${toast_body_css}"> <div class="toast-body" style="${toast_body_css}">
<strong>TPA ID Update Pending</strong><br><br> <strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small> <small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer"> <div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a> <a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
@ -561,11 +611,16 @@
messagesList.append(html); messagesList.append(html);
}
}); });
response.uhid.forEach(function(item, index) { response.uhid.forEach(function(item, index) {
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
var queryParams = { var queryParams = {
client_id: item.client_id, client_id: item.client_id,
client_policy_id: item.client_policy_id, client_policy_id: item.client_policy_id,
event: 'inception', event: 'inception',
@ -576,16 +631,21 @@
const queryString = objectToQueryString(queryParams); const queryString = objectToQueryString(queryParams);
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab' var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
console.log(url) //console.log(url)
var toast_body_css = 'background : #bfd7eb !important;'; var toast_body_css = 'background : #bfd7eb !important;';
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;'; var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'; var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
var toast_status_word = 'Info'; var toast_status_word = 'Info';
var title = 'Insurer Export Pending';
if (item.batch_export_count > 0) {
title = 'Insurer Import Pending';
}
var toast_body_data = item.client_name + ' - ' + item.policy_name; var toast_body_data = item.client_name + ' - ' + item.policy_name;
console.log(toast_body_data); //console.log(toast_body_data);
var html = ` <li data-id="" data-url="${url}"> var html = ` <li data-id="" data-url="${url}">
<div class="p-3"> <div class="p-3">
@ -597,7 +657,7 @@
</button> </button>
</div> </div>
<div class="toast-body" style="${toast_body_css}"> <div class="toast-body" style="${toast_body_css}">
<strong>UHID Update Pending</strong><br><br> <strong>${title}</strong><br><br>
<small style="position: relative;bottom: 8px;">${toast_body_data}</small> <small style="position: relative;bottom: 8px;">${toast_body_data}</small>
<div class="toast-footer"> <div class="toast-footer">
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a> <a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
@ -611,12 +671,18 @@
messagesList.append(html); messagesList.append(html);
}
}); });
localStorage.setItem('pendingActionCount', pendingActionCount) localStorage.setItem('pendingActionCount', pendingActionCount)
},
error: function(xhr, status, error) {
console.error(xhr.responseText); // Log the error response
} }
}); });
} }

View File

@ -1,6 +1,6 @@
<!-- Modal content for the Large example --> <!-- Modal content for the Large example -->
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" <div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
aria-hidden="true" aria-modal="true" data-backdrop="static"> aria-hidden="true" aria-modal="true" data-backdrop="static" style="padding-right: 15px">
<div class="modal-dialog modal-full-width"> <div class="modal-dialog modal-full-width">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -27,7 +27,7 @@
</select> </select>
</div> </div>
<!-- <div class="form-group col-md-4" style="position: relative; left: 45px;display:none" id="premium_type"> <div class="form-group col-md-4" style="position: relative; left: 45px; display:none" id="premium_type">
<label for="css"> Premium Calculation </label> <label for="css"> Premium Calculation </label>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<input type="radio" id="individual" name="premium_type" value="2"> <input type="radio" id="individual" name="premium_type" value="2">
@ -35,7 +35,7 @@
<input type="radio" id="single" name="premium_type" value="1"> <input type="radio" id="single" name="premium_type" value="1">
<label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label> <label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label>
</div> </div>
</div> --> </div>
</div> </div>
@ -46,7 +46,7 @@
</div> </div>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0" id="hide_smbt_btn">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" <button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnGridSubmit_2">Submit</button> id="btnGridSubmit_2">Submit</button>
</div> </div>
@ -710,10 +710,10 @@ $('body').on('click', '.btnPolicyModel', function() {
var client_policy_id = $(this).data('id'); var client_policy_id = $(this).data('id');
$('#client_policy_id').val(client_policy_id); $('#client_policy_id').val(client_policy_id);
console.log('client_policy_id', client_policy_id) // console.log('client_policy_id', client_policy_id)
var policy_type_string = $(this).attr('id'); var policy_type_string = $(this).attr('id');
console.log('policy_type_string', policy_type_string) // console.log('policy_type_string', policy_type_string)
if (policy_type_string == 'GPA' || policy_type_string == 'GMC') { if (policy_type_string == 'GPA' || policy_type_string == 'GMC') {
@ -733,15 +733,17 @@ $('body').on('click', '.btnPolicyModel', function() {
dataType: 'json', dataType: 'json',
success: function(res) { success: function(res) {
$('#GridForm')[0].reset(); $('#GridForm')[0].reset();
// if(res.family_floater == 1){ if(policy_type_string == 'GMC'){
// $('#premium_type').show(); $('#premium_type').show();
// $('#individual').prop('checked', true) $('#individual').prop('checked', true)
// }else{ }else{
// $('#premium_type').hide(); $('#premium_type').hide();
// $('#individual').prop('checked', false) $('#individual').prop('checked', true)
// } }
setTimeout(function() { setTimeout(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
@ -758,12 +760,13 @@ $('body').on('click', '.btnPolicyModel', function() {
$('#nameOfThePolicy').html(' - ' + res.policy_name); $('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count); $('#grid_emp_count').val(res.count);
if (res.count > 0) { if (res.count > 0) {
console.log('count -- 2', res.count); console.log(' hide submit btn count ', res.count);
$("#btnGridSubmit_2").hide(); $("#hide_smbt_btn").hide();
} else { } else {
$("#btnGridSubmit_2").show(); $("#hide_smbt_btn").show();
console.log('count -- ', res.count); console.log('show submit btn count ', res.count);
} }
if (res.status === false) { if (res.status === false) {
@ -788,24 +791,25 @@ $('body').on('click', '.btnPolicyModel', function() {
}); });
$('#grid').html(policeGridOptionHTML); $('#grid').html(policeGridOptionHTML);
// if (res.premiumData[0].hasOwnProperty('premium_type')) {
// if (res.premiumData[0].premium_type == '2') { if (res.premiumData[0].hasOwnProperty('premium_type')) {
// $('#individual').prop('checked', true) if (res.premiumData[0].premium_type == '2') {
// $('#single').prop('checked', false)
// } else if (res.premiumData[0].premium_type == '1') { $('#individual').prop('checked', true)
$('#single').prop('checked', false)
// $('#single').prop('checked', true) } else if (res.premiumData[0].premium_type == '1') {
// $('#individual').prop('checked', false)
// } else { $('#single').prop('checked', true)
// $('#single').prop('checked', false) $('#individual').prop('checked', false)
// $('#individual').prop('checked', false)
// }
// } } else {
$('#single').prop('checked', false)
$('#individual').prop('checked', true)
}
}
var si_or_bp_value = ''; var si_or_bp_value = '';
@ -858,12 +862,12 @@ $('body').on('click', '.btnPolicyModel', function() {
var id_for_trigger = temp_for_premiumData[0].policy_grid_id; var id_for_trigger = temp_for_premiumData[0].policy_grid_id;
$(`input[name="${id_for_trigger}_si[]"]`).each(function() { $(`input[name="${id_for_trigger}_si[]"]`).each(function() {
console.log($(this)); // console.log($(this));
$(this).trigger('keyup'); $(this).trigger('keyup');
}); });
$(`input[name="${id_for_trigger}_premium[]"]`).each(function() { $(`input[name="${id_for_trigger}_premium[]"]`).each(function() {
console.log($(this)); // console.log($(this));
$(this).trigger('keyup'); $(this).trigger('keyup');
}); });
@ -915,17 +919,26 @@ $('#grid').change(function() {
$('.loader').fadeOut(); $('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow'); $('.loader-mask').delay(350).fadeOut('slow');
}, 1000); }, 1000);
if (res.count > 0) {
// console.log(' hide submit btn count ', res.count);
$("#hide_smbt_btn").hide();
} else {
$("#hide_smbt_btn").show();
// console.log('show submit btn count ', res.count);
}
if (res.premiumData.length > 0 && res.premiumData[0].policy_grid_id === grid_id) { if (res.premiumData.length > 0 && res.premiumData[0].policy_grid_id === grid_id) {
$('#nameOfThePolicy').html(' - ' + res.policy_name); $('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count); $('#grid_emp_count').val(res.count);
if (res.count == false) { if (res.count > 0) {
console.log('count -- 2', res.count); // console.log(' hide submit btn count ', res.count);
$("#btnGridSubmit_2").hide(); $("#hide_smbt_btn").hide();
} else { } else {
$("#btnGridSubmit_2").show(); $("#hide_smbt_btn").show();
console.log('count -- ', res.count); // console.log('show submit btn count ', res.count);
} }
if (res.status === false) { if (res.status === false) {
@ -996,9 +1009,9 @@ var Count = 1
function appendGridtHtml(ui_type = false, data = false, ) { function appendGridtHtml(ui_type = false, data = false, ) {
console.log('appendGridtHtml function called') // console.log('appendGridtHtml function called')
console.log(ui_type) // console.log(ui_type)
console.log(data) // console.log(data)
var html = ''; var html = '';
// console.log('Grid Content',data) // console.log('Grid Content',data)
@ -1007,13 +1020,13 @@ function appendGridtHtml(ui_type = false, data = false, ) {
if (ui_type == '1') { if (ui_type == '1') {
console.log('step 1') // console.log('step 1')
var currentTime = getCurrentTime(); var currentTime = getCurrentTime();
console.log(currentTime); // console.log(currentTime);
if($("#si_or_bp").val() == 1 || data.si_or_bp == '1'){ if($("#si_or_bp").val() == 1 || data.si_or_bp == '1'){
console.log('step 2') // console.log('step 2')
html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" id="removeChild_${Count}"> html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" id="removeChild_${Count}">
<div class="form-group col-md-4" id=""> <div class="form-group col-md-4" id="">
@ -1035,7 +1048,7 @@ function appendGridtHtml(ui_type = false, data = false, ) {
}else if($("#si_or_bp").val() == 3 || data.si_or_bp == '3'){ }else if($("#si_or_bp").val() == 3 || data.si_or_bp == '3'){
console.log('step 3') // console.log('step 3')
html = `<div class="form-row gpa_band_remove" style="width:101%" id="removeChild_${Count}"> html = `<div class="form-row gpa_band_remove" style="width:101%" id="removeChild_${Count}">
@ -1064,7 +1077,7 @@ function appendGridtHtml(ui_type = false, data = false, ) {
} }
console.log('step 4') // console.log('step 4')
} else if (ui_type == '3') { } else if (ui_type == '3') {
@ -1775,10 +1788,10 @@ function checkDuplicate() {
} }
} }
console.log('siValues', siValues); // console.log('siValues', siValues);
console.log('premiumValues', premiumValues); // console.log('premiumValues', premiumValues);
console.log('siDuplicates', siDuplicates); // console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates); // console.log('premiumDuplicates', premiumDuplicates);
if (siDuplicates || premiumDuplicates) { if (siDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning'); toastr.warning('Duplicates found!', 'warning');
@ -1829,12 +1842,12 @@ function checkDuplicate() {
} }
} }
console.log('siValues', siValues); // console.log('siValues', siValues);
console.log('premiumValues', premiumValues); // console.log('premiumValues', premiumValues);
console.log('bandValues', bandValues); // console.log('bandValues', bandValues);
console.log('siDuplicates', siDuplicates); // console.log('siDuplicates', siDuplicates);
console.log('premiumDuplicates', premiumDuplicates); // console.log('premiumDuplicates', premiumDuplicates);
console.log('bandDuplicates', bandDuplicates); // console.log('bandDuplicates', bandDuplicates);
if (siDuplicates || bandDuplicates || premiumDuplicates) { if (siDuplicates || bandDuplicates || premiumDuplicates) {
toastr.warning('Duplicates found!', 'warning'); toastr.warning('Duplicates found!', 'warning');
@ -1883,7 +1896,7 @@ function basicPayMultiple(input) {
function gpaSumInsureMultiplier(element) { function gpaSumInsureMultiplier(element) {
console.log(element); // console.log(element);
var element = $('#gpa_sum_multiplier')[0]; var element = $('#gpa_sum_multiplier')[0];
var sumInsured = $('input[name="gpa_sum_si[]"]'); var sumInsured = $('input[name="gpa_sum_si[]"]');
@ -1990,7 +2003,7 @@ function si_orbp_change_function() {
$('#gmc_add_more').hide(); $('#gmc_add_more').hide();
} }
console.log('gmcBandInput', count) // console.log('gmcBandInput', count)
var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length; var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length;
@ -2049,7 +2062,7 @@ function si_orbp_change_function() {
$('#gmc_add_more2').hide(); $('#gmc_add_more2').hide();
} }
console.log('gmcBandInput', count) // console.log('gmcBandInput', count)
$('#si_or_bp_full_div').css({ $('#si_or_bp_full_div').css({
'display': '', 'display': '',

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>