CHANGE_RACK_RATE_TO_SHOW_ALL_AND_PREMIUM_TYPE_AND_EMP_LIST_UPLOAD_BATCH_LIST_TABLE_ISSUE_FIX : RV
This commit is contained in:
parent
7f1073974e
commit
dddc960142
3
.gitignore
vendored
3
.gitignore
vendored
@ -22,6 +22,9 @@ writable/debugbar/*
|
||||
writable/**/*.db
|
||||
writable/**/*.sqlite
|
||||
|
||||
writable/e_card_template/*
|
||||
!writable/e_card_template/.gitkeep
|
||||
|
||||
|
||||
vendor/
|
||||
build/
|
||||
|
||||
@ -770,18 +770,18 @@ class ClientController extends AdminController
|
||||
$policy_type = $this->request->getPost('policy_type');
|
||||
$client_id = $this->request->getPost('client_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) {
|
||||
$client_policy_data = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||
$client_id = $client_policy_data['client_id'];
|
||||
}
|
||||
$policy_grid_id = $this->request->getPost('policy_grid_id');
|
||||
|
||||
if($policy_grid_id == 10 || $policy_grid_id == 11){
|
||||
$premium_type = 1;
|
||||
}else{
|
||||
$premium_type = 2;
|
||||
}
|
||||
// if($policy_grid_id == 10 || $policy_grid_id == 11){
|
||||
// $premium_type = 1;
|
||||
// }else{
|
||||
// $premium_type = 2;
|
||||
// }
|
||||
|
||||
$si_or_bp = $this->request->getPost('si_or_bp');
|
||||
$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")
|
||||
->where("employees.client_id", $record['client_id'])
|
||||
->where("employees.emp_status", 'active')
|
||||
->where("ep.status", 'active')
|
||||
->where("employees.is_active", 1)
|
||||
->where("ep.is_active", 1)
|
||||
->countAllResults();
|
||||
|
||||
|
||||
$data = $this->employeePolicyModel->select('employee_polices.id')
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
->findAll();
|
||||
// $data = $this->employeePolicyModel->select('employee_polices.id')
|
||||
// ->where('employee_polices.is_active', 1)
|
||||
// ->where('employee_polices.client_policy_id', $client_policy_id)
|
||||
// ->findAll();
|
||||
|
||||
$emp_count = count($data);
|
||||
// $emp_count = count($data);
|
||||
|
||||
// if($emp_count == 0){
|
||||
// $emp_count = true;
|
||||
@ -1176,24 +1179,25 @@ class ClientController extends AdminController
|
||||
|
||||
if ($search_term === 'GMC') {
|
||||
|
||||
$resultss = [];
|
||||
// $resultss = [];
|
||||
$resultss = $results;
|
||||
|
||||
try {
|
||||
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 ($family_floater == 1) {
|
||||
if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
|
||||
$resultss[$index] = $record;
|
||||
}
|
||||
} else {
|
||||
if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
|
||||
$resultss[$index] = $record;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$resultss = $results; // Reset $resultss to an empty array if an exception occurs
|
||||
}
|
||||
// try {
|
||||
// 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 ($family_floater == 1) {
|
||||
// if ($index == '7' || $index == '8' || $index == '9' || $index == '10') {
|
||||
// $resultss[$index] = $record;
|
||||
// }
|
||||
// } else {
|
||||
// if ($index == '0' || $index == '1' || $index == '2' || $index == '3' || $index == '4' || $index == '5' || $index == '6') {
|
||||
// $resultss[$index] = $record;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (\Exception $e) {
|
||||
// $resultss = $results; // Reset $resultss to an empty array if an exception occurs
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@ -960,6 +960,7 @@ class EmpDataServiceController extends BaseController
|
||||
$file_id = $params['file_id'];
|
||||
$file = $this->batchFileModel->find($file_id);
|
||||
if (!$file) {
|
||||
|
||||
$data = [
|
||||
'status' => 'failed-4',
|
||||
];
|
||||
@ -980,6 +981,15 @@ class EmpDataServiceController extends BaseController
|
||||
$batch_code = $file['batch_code'];
|
||||
$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';
|
||||
if ($status == 'in-progress-partially') {
|
||||
|
||||
@ -995,16 +1005,21 @@ class EmpDataServiceController extends BaseController
|
||||
array_pop($excel_data); // Remove footer row
|
||||
|
||||
$totals = 0;
|
||||
$empty_emp_tpa_uh_ids = [];
|
||||
$emp_policy_ids = [];
|
||||
$emp_details = [];
|
||||
$tpa_id = [];
|
||||
$uhid = [];
|
||||
|
||||
$emp_count = count($excel_data);
|
||||
$db = \Config\Database::connect();
|
||||
|
||||
|
||||
foreach ($excel_data as $key => $value) {
|
||||
|
||||
$name = $value[1];
|
||||
$emp_code = $value[2];
|
||||
$tpa_id = $value[15];
|
||||
$uhid = $value[16];
|
||||
$tpa_id[] = $value[15];
|
||||
$uhid[] = $value[16];
|
||||
$amount = $value[20];
|
||||
|
||||
$totals += $amount;
|
||||
@ -1031,38 +1046,41 @@ class EmpDataServiceController extends BaseController
|
||||
// Get the result
|
||||
$result = $query->get()->getRowArray();
|
||||
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 = "
|
||||
UPDATE employee_polices
|
||||
JOIN employees ON employees.id = employee_polices.employee_id
|
||||
SET tpa_id = ?
|
||||
WHERE employees.name = ?
|
||||
AND employees.emp_code = ?
|
||||
AND employee_polices.client_policy_id = ?
|
||||
AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
|
||||
// $sql = "
|
||||
// UPDATE employee_polices
|
||||
// JOIN employees ON employees.id = employee_polices.employee_id
|
||||
// SET tpa_id = ?
|
||||
// WHERE employees.name = ?
|
||||
// AND employees.emp_code = ?
|
||||
// AND employee_polices.client_policy_id = ?
|
||||
// AND (employee_polices.tpa_id IS NULL OR employee_polices.tpa_id = '')";
|
||||
|
||||
$params = [$tpa_id, $name, $emp_code, $client_policy_id];
|
||||
$db->query($sql, $params);
|
||||
// $params = [$tpa_id, $name, $emp_code, $client_policy_id];
|
||||
// $db->query($sql, $params);
|
||||
|
||||
|
||||
|
||||
$sql = "
|
||||
UPDATE employee_polices
|
||||
JOIN employees ON employees.id = employee_polices.employee_id
|
||||
SET employee_polices.uhid = ?
|
||||
WHERE employees.name = ?
|
||||
AND employees.emp_code = ?
|
||||
AND employee_polices.client_policy_id = ?
|
||||
AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
|
||||
// $sql = "
|
||||
// UPDATE employee_polices
|
||||
// JOIN employees ON employees.id = employee_polices.employee_id
|
||||
// SET employee_polices.uhid = ?
|
||||
// WHERE employees.name = ?
|
||||
// AND employees.emp_code = ?
|
||||
// AND employee_polices.client_policy_id = ?
|
||||
// AND (employee_polices.uhid IS NULL OR employee_polices.uhid = '')";
|
||||
|
||||
$params = [$uhid, $name, $emp_code, $client_policy_id];
|
||||
$db->query($sql, $params);
|
||||
// $params = [$uhid, $name, $emp_code, $client_policy_id];
|
||||
// $db->query($sql, $params);
|
||||
}
|
||||
|
||||
$return = $this->employeePolicyModel->bulkUpdate($emp_details);
|
||||
|
||||
// Update batch file status and amount
|
||||
$this->batchFileModel->update($file_id, [
|
||||
'count' => $emp_count,
|
||||
@ -1076,14 +1094,13 @@ class EmpDataServiceController extends BaseController
|
||||
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID total amount for cash deposite : {data}', ['data'=> $totals]);
|
||||
|
||||
|
||||
|
||||
if ($file['insurer_or_tpa'] == 'tpa') {
|
||||
|
||||
$this->myLogger->logme('error', 'importInceptionUpdateTPAandUHID set cashDepositCalculationForInception and sendMailForDownloadingECard in JOB QUEUE');
|
||||
|
||||
$policy_name = $this->getPolicyNameUsingClientPolicyId($client_policy_id);
|
||||
$depositeData = [
|
||||
'employeeIds' => $empty_emp_tpa_uh_ids,
|
||||
'employeeIds' => $emp_policy_ids,
|
||||
'client_id' => $client_id,
|
||||
'client_policy_id' => $client_policy_id,
|
||||
'count' => $emp_count,
|
||||
@ -1096,7 +1113,7 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'cashDepositCalculationForInception','payload' => [
|
||||
'employeeIds' => $empty_emp_tpa_uh_ids,
|
||||
'employeeIds' => $emp_policy_ids,
|
||||
'client_id' => $client_id,
|
||||
'client_policy_id' => $client_policy_id,
|
||||
'count' => $emp_count,
|
||||
@ -1105,18 +1122,22 @@ class EmpDataServiceController extends BaseController
|
||||
'user_id' => $user_id,
|
||||
]]);
|
||||
|
||||
if($get_policy_type['policy_type_id'] != 1){
|
||||
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $empty_emp_tpa_uh_ids]);
|
||||
$job_details = new Jobs();
|
||||
$r = Jobs::addJob(['job_name' => 'sendMailForDownloadingECard','payload' => $emp_policy_ids]);
|
||||
|
||||
}
|
||||
|
||||
// $this->cashDepositCalculationForInception($depositeData);
|
||||
// $this->sendMailForDownloadingECard($empty_emp_tpa_uh_ids);
|
||||
// $this->sendMailForDownloadingECard($emp_policy_ids);
|
||||
|
||||
}
|
||||
|
||||
$file_data = $this->getDataByFileId($file_id, 'success');
|
||||
$this->setPullNotification($file_data);
|
||||
|
||||
|
||||
return 'Import Inception Updated '. $status_val . '- Updated Count : ' . $emp_count;
|
||||
}
|
||||
|
||||
|
||||
@ -122,9 +122,28 @@ class PendingActionsController extends AdminController
|
||||
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
|
||||
$subqueryBuilder = $this->db->table('emp_endorsement')
|
||||
->select('
|
||||
->select('
|
||||
|
||||
clients.client_name as client_name,
|
||||
clients.id as client_id,
|
||||
@ -139,7 +158,7 @@ class PendingActionsController extends AdminController
|
||||
emp_endorsement.status,
|
||||
employees.name as ename
|
||||
')
|
||||
->join('employees', 'emp_endorsement.pk = employees.id AND employees.is_active = 1 AND employees.emp_status = \'active\'')
|
||||
->join('employees', 'emp_endorsement.pk = employees.id AND employees.is_active = 1 AND employees.emp_status = \'active\'')
|
||||
->join('clients', 'employees.client_id = clients.id AND clients.is_active = 1', 'left')
|
||||
->where([
|
||||
'emp_endorsement.actions' => 'c',
|
||||
@ -151,10 +170,13 @@ class PendingActionsController extends AdminController
|
||||
|
||||
// Main query builder
|
||||
$builder = $this->db->table('clients');
|
||||
$builder->select('
|
||||
$builder->select("
|
||||
subquery.client_name,
|
||||
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->groupBy('clients.id');
|
||||
|
||||
@ -165,7 +187,7 @@ class PendingActionsController extends AdminController
|
||||
$results = $query->getResultArray();
|
||||
|
||||
|
||||
$filteredResults = array_filter($results, function($value) {
|
||||
$filteredResults = array_filter($results, function ($value) {
|
||||
return $value['subquery_count'] != 0;
|
||||
});
|
||||
|
||||
@ -176,9 +198,29 @@ class PendingActionsController extends AdminController
|
||||
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
|
||||
$subqueryBuilder = $this->db->table('emp_endorsement')
|
||||
->select('
|
||||
->select('
|
||||
clients.client_name as client_name,
|
||||
clients.id as client_id,
|
||||
client_policy.id as client_policy_id,
|
||||
@ -194,7 +236,7 @@ class PendingActionsController extends AdminController
|
||||
emp_endorsement.name,
|
||||
emp_endorsement.status
|
||||
')
|
||||
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\'')
|
||||
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\'')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1')
|
||||
->join('clients', 'client_policy.client_id = clients.id AND clients.is_active = 1')
|
||||
->join('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1')
|
||||
@ -208,13 +250,16 @@ class PendingActionsController extends AdminController
|
||||
|
||||
// Build the main query
|
||||
$builder = $this->db->table('clients');
|
||||
$builder->select('
|
||||
$builder->select("
|
||||
clients.id,
|
||||
subquery.client_name,
|
||||
subquery.client_id,
|
||||
subquery.client_policy_id,
|
||||
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->groupBy('clients.id');
|
||||
|
||||
@ -225,7 +270,7 @@ class PendingActionsController extends AdminController
|
||||
$results = $query->getResultArray();
|
||||
|
||||
|
||||
$filteredResults = array_filter($results, function($value) {
|
||||
$filteredResults = array_filter($results, function ($value) {
|
||||
return $value['subquery_count'] != 0;
|
||||
});
|
||||
|
||||
@ -236,9 +281,29 @@ class PendingActionsController extends AdminController
|
||||
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
|
||||
$subqueryBuilder = $this->db->table('emp_endorsement')
|
||||
->select('
|
||||
->select('
|
||||
clients.client_name as client_name,
|
||||
clients.id as client_id,
|
||||
client_policy.id as client_policy_id,
|
||||
@ -253,28 +318,31 @@ class PendingActionsController extends AdminController
|
||||
emp_endorsement.name,
|
||||
emp_endorsement.status
|
||||
')
|
||||
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\' AND emp_endorsement.table_name = \'employee_polices\'', 'left')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1', 'left')
|
||||
->join('clients', 'client_policy.client_id = clients.id AND clients.is_active = 1', 'left')
|
||||
->join('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1', 'left')
|
||||
->where([
|
||||
'emp_endorsement.actions' => 'd',
|
||||
'emp_endorsement.is_active' => 1,
|
||||
'emp_endorsement.status' => 'pending',
|
||||
'emp_endorsement.endorsement_id' => null,
|
||||
'emp_endorsement.table_name' => 'employee_polices'
|
||||
])
|
||||
->join('employee_polices', 'emp_endorsement.pk = employee_polices.id AND employee_polices.is_active = 1 AND employee_polices.status = \'active\' AND emp_endorsement.table_name = \'employee_polices\'', 'left')
|
||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id AND client_policy.is_active = 1 AND client_policy.policy_status = 1', 'left')
|
||||
->join('clients', 'client_policy.client_id = clients.id AND clients.is_active = 1', 'left')
|
||||
->join('policies', 'client_policy.policy_id = policies.id AND policies.is_active = 1', 'left')
|
||||
->where([
|
||||
'emp_endorsement.actions' => 'd',
|
||||
'emp_endorsement.is_active' => 1,
|
||||
'emp_endorsement.status' => 'pending',
|
||||
'emp_endorsement.endorsement_id' => null,
|
||||
'emp_endorsement.table_name' => 'employee_polices'
|
||||
])
|
||||
->groupBy('emp_endorsement.pk, emp_endorsement.emp_code, emp_endorsement.actions, emp_endorsement.name');
|
||||
|
||||
// Build the main query
|
||||
$builder = $this->db->table('clients');
|
||||
$builder->select('
|
||||
$builder->select("
|
||||
clients.id,
|
||||
subquery.client_name,
|
||||
subquery.client_id,
|
||||
subquery.client_policy_id,
|
||||
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->groupBy('clients.id');
|
||||
|
||||
@ -284,7 +352,7 @@ class PendingActionsController extends AdminController
|
||||
// Fetch the results
|
||||
$results = $query->getResultArray();
|
||||
|
||||
$filteredResults = array_filter($results, function($value) {
|
||||
$filteredResults = array_filter($results, function ($value) {
|
||||
return $value['subquery_count'] != 0;
|
||||
});
|
||||
|
||||
@ -294,26 +362,43 @@ class PendingActionsController extends AdminController
|
||||
|
||||
public function getPendingActionForUHIDEmpty()
|
||||
{
|
||||
// Build the query
|
||||
$builder = $this->db->table('employee_polices');
|
||||
$builder->select('
|
||||
employee_polices.client_policy_id,
|
||||
employee_polices.uhid,
|
||||
clients.short_name,
|
||||
clients.client_name,
|
||||
policies.name as policy_name,
|
||||
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');
|
||||
// Subquery for batch_export_count
|
||||
$subQueryExport = $this->db->table('batch_files bl')
|
||||
->select('COUNT(*)')
|
||||
->where('bl.client_policy_id = cp.id')
|
||||
->where('bl.actions', 'export')
|
||||
->where('bl.event_type', 'inception')
|
||||
->where('bl.insurer_or_tpa', 'insurer')
|
||||
->getCompiledSelect();
|
||||
|
||||
// Execute the query
|
||||
$query = $builder->get();
|
||||
// Subquery for batch_import_count
|
||||
$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
|
||||
$results = $query->getResultArray();
|
||||
@ -325,6 +410,25 @@ class PendingActionsController extends AdminController
|
||||
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
|
||||
$builder = $this->db->table('employee_polices');
|
||||
$builder->select('
|
||||
@ -337,6 +441,9 @@ class PendingActionsController extends AdminController
|
||||
policies.name as policy_name,
|
||||
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('clients', 'clients.id = client_policy.client_id');
|
||||
$builder->join('policies', 'policies.id = client_policy.policy_id');
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
<style>
|
||||
.table-responsive {
|
||||
overflow-x: auto;
|
||||
}
|
||||
.table-responsive {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.reload:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.reload:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="col-12">
|
||||
@ -22,16 +22,17 @@
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<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">Client</th>
|
||||
<th class="font-weight-medium">Client Policy</th>
|
||||
<th class="font-weight-medium">Event Type</th>
|
||||
<th class="font-weight-medium">Insurer/TPA</th>
|
||||
<th class="font-weight-medium">Event <br> Type</th>
|
||||
<th class="font-weight-medium">Insurer/ <br> TPA</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">Count</th>
|
||||
<th class="font-weight-medium">Amount</th>
|
||||
<th class="font-weight-medium">status</th>
|
||||
<th class="font-weight-medium">(₹)Amount</th>
|
||||
<th class="font-weight-medium">User/Time</th>
|
||||
<th class="font-weight-medium">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -41,39 +42,59 @@
|
||||
foreach ($batch_list as $key => $file) {
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1) ?></b></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><?php echo $file['client_short_name'] ?></td>
|
||||
<td><?php echo $file['policy_name'] ?></td>
|
||||
<td><?php echo $file['event_type'] ?></td>
|
||||
<td><?php echo $file['insurer_or_tpa'] ?></td>
|
||||
<td><?php echo $file['actions'] ?></td>
|
||||
<td><?php echo $file['count'] ?></td>
|
||||
<td><?php echo intval($file['amount']) ?></td>
|
||||
<td>
|
||||
<?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 } else if ($file['status'] == 'partially success') { ?>
|
||||
<?php echo $file['status']; ?>
|
||||
<?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>
|
||||
<?php } ?>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?php } else { ?>
|
||||
<?php echo $file['status']; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<tr>
|
||||
<td><b><?php echo ($key + 1) ?></b></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><?php echo $file['client_short_name'] ?></td>
|
||||
<td><?php echo $file['policy_name'] ?></td>
|
||||
<td><?php echo $file['event_type'] ?></td>
|
||||
<td><?php echo $file['insurer_or_tpa'] ?></td>
|
||||
<td><?php echo $file['actions'] ?></td>
|
||||
<td><?php echo $file['count'] ?></td>
|
||||
|
||||
</tr>
|
||||
<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>
|
||||
<?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 } else if ($file['status'] == 'partially success') { ?>
|
||||
<?php echo $file['status']; ?>
|
||||
<?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>
|
||||
<?php } ?>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?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>
|
||||
<?php } else { ?>
|
||||
<?php echo $file['status']; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php }
|
||||
} ?>
|
||||
|
||||
@ -85,31 +106,72 @@
|
||||
</div><!-- end col -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#datatable-buttons').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Batch List',
|
||||
className: 'my_class',
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
position: "relative",
|
||||
left: "50px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#datatable-buttons').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Batch List',
|
||||
className: 'my_class',
|
||||
}],
|
||||
initComplete: function(settings, json) {
|
||||
$('.my_class').css({
|
||||
position: "relative",
|
||||
left: "50px"
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</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>
|
||||
@ -1,5 +1,4 @@
|
||||
<style>
|
||||
|
||||
.badge2 {
|
||||
box-shadow: none;
|
||||
}
|
||||
@ -21,7 +20,6 @@
|
||||
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;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="client_list">
|
||||
@ -42,13 +40,17 @@
|
||||
<!-- <th class="font-weight-medium">Employee code</th> -->
|
||||
<th class="font-weight-medium">Name/code</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">UHID</th>
|
||||
<th class="font-weight-medium">Policy status</th>
|
||||
<th class="font-weight-medium">Sum Insured</th>
|
||||
<th class="font-weight-medium">Premium</th>
|
||||
<th class="font-weight-medium">Action</th>
|
||||
<th class="font-weight-medium">Policy <br> status</th>
|
||||
<th class="font-weight-medium">(₹)Sum Insured</th>
|
||||
<th class="font-weight-medium">(₹)Premium</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>
|
||||
</thead>
|
||||
|
||||
@ -60,8 +62,8 @@
|
||||
|
||||
<tr>
|
||||
<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>
|
||||
<td><?php echo $employee['name']?>( <?php echo $employee['emp_code']?> -
|
||||
<?php echo $employee['relationship']?> )</td>
|
||||
<td><?php echo $employee['policy_name']?></td>
|
||||
<td><?php echo $employee['insurer_short_name']?></td>
|
||||
<td><?php echo $employee['tpa_id']?></td>
|
||||
@ -83,9 +85,11 @@
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td> <?php echo $employee['basic_cover_si']?> </td>
|
||||
<td><?php echo $employee['premium']?></td>
|
||||
<td>
|
||||
<td class="indian-number"> <?php echo $employee['basic_cover_si']?> </td>
|
||||
<td class="indian-number"><?php echo $employee['premium']?></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">
|
||||
<a href="javascript: void(0);"
|
||||
class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"
|
||||
@ -103,49 +107,130 @@
|
||||
Unread</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</td> -->
|
||||
</tr>
|
||||
<?php }}?>
|
||||
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</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>
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tickets-table').DataTable({
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
"buttons": [{
|
||||
"extend": 'csv',
|
||||
"text": 'CSV',
|
||||
"title": 'Employee-List',
|
||||
"className": 'my_class',
|
||||
"exportOptions": {
|
||||
"columns": ':not(:last-child)'
|
||||
"extend": 'csv',
|
||||
"text": 'CSV',
|
||||
"title": 'Employee-List',
|
||||
"className": 'my_class',
|
||||
"exportOptions": {
|
||||
"columns": ':not(:last-child)'
|
||||
},
|
||||
}],
|
||||
"initComplete": function(settings, json) {
|
||||
$('.my_class').css({
|
||||
"position": "relative",
|
||||
"left": "82px"
|
||||
});
|
||||
},
|
||||
}],
|
||||
"initComplete": function(settings, json) {
|
||||
$('.my_class').css({
|
||||
"position": "relative",
|
||||
"left": "82px"
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true,
|
||||
// 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
|
||||
});
|
||||
},
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
},
|
||||
paging: true ,
|
||||
// pagingType: 'full_numbers'
|
||||
});
|
||||
|
||||
});
|
||||
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>
|
||||
@ -183,7 +183,7 @@ function appendPolicies(data) {
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name
|
||||
text: item.name + ' - ' + item.policy_type
|
||||
});
|
||||
if (PolicyID == item.id) {
|
||||
option.attr('selected', true);
|
||||
@ -265,6 +265,4 @@ document.getElementById('toggleIcon').addEventListener('click', function() {
|
||||
icon.classList.toggle('mdi-chevron-up');
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -540,7 +540,7 @@ function appendPolicies(data) {
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name
|
||||
text: item.name + ' - ' + item.policy_type
|
||||
});
|
||||
if (client_policy_param == item.id) {
|
||||
option.attr('selected', true);
|
||||
|
||||
@ -353,7 +353,7 @@
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.name
|
||||
text: item.name + ' - ' + item.policy_type
|
||||
});
|
||||
if (client_policy_param2 == item.id) {
|
||||
option.attr('selected', true);
|
||||
|
||||
@ -159,9 +159,9 @@
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
// $(document).ready(function() {
|
||||
// $("#playMusic").get(0).play();
|
||||
// });
|
||||
// $(document).ready(function() {
|
||||
// $("#playMusic").get(0).play();
|
||||
// });
|
||||
|
||||
|
||||
console.log('responce', response)
|
||||
@ -231,6 +231,9 @@
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
});
|
||||
|
||||
@ -248,6 +251,9 @@
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
fetchMessages();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -298,7 +304,9 @@
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
if(response.length == 0){
|
||||
console.log(response);
|
||||
|
||||
if (response.length == 0) {
|
||||
|
||||
pendingActionCount = 0;
|
||||
localStorage.setItem('pendingActionCount', pendingActionCount);
|
||||
@ -311,7 +319,6 @@
|
||||
let messagesList = $('#messages-list-2');
|
||||
messagesList.empty();
|
||||
|
||||
console.log(response);
|
||||
|
||||
response.inception.forEach(function(item, index) {
|
||||
|
||||
@ -324,7 +331,7 @@
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString
|
||||
console.log(url)
|
||||
//console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
@ -334,7 +341,7 @@
|
||||
|
||||
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}">
|
||||
<div class="p-3">
|
||||
@ -364,28 +371,38 @@
|
||||
|
||||
response.correction.forEach(function(item, index) {
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
event: 'correction',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
console.log(url)
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
event: 'correction',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
var toast_body_data = item.client_name;
|
||||
console.log(toast_body_data);
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
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;
|
||||
//console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -395,7 +412,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@ -407,12 +424,17 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
response.deletion.forEach(function(item, index) {
|
||||
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
|
||||
client_id: item.client_id,
|
||||
@ -426,16 +448,22 @@
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
console.log(url)
|
||||
//console.log(url)
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
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;
|
||||
console.log(toast_body_data);
|
||||
//console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
@ -447,7 +475,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@ -461,33 +489,44 @@
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
response.si_enhancement.forEach(function(item, index) {
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'si_enhancement',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
console.log(url)
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'si_enhancement',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
var toast_body_data = item.client_name + ' - ' + item.policy_name;
|
||||
console.log(toast_body_data);
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
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;
|
||||
//console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -497,7 +536,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@ -509,35 +548,46 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
response.tpa.forEach(function(item, index) {
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'tpa',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
console.log(url)
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'tpa',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
var toast_body_data = item.client_name + ' - ' + item.policy_name;
|
||||
console.log(toast_body_data);
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
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;
|
||||
//console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -547,7 +597,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@ -559,35 +609,45 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
response.uhid.forEach(function(item, index) {
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'insurer',
|
||||
actions: 'export',
|
||||
};
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
var queryParams = {
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
console.log(url)
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'insurer',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
var toast_body_data = item.client_name + ' - ' + item.policy_name;
|
||||
console.log(toast_body_data);
|
||||
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_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'Insurer Export Pending';
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
if (item.batch_export_count > 0) {
|
||||
|
||||
title = 'Insurer Import Pending';
|
||||
}
|
||||
|
||||
var toast_body_data = item.client_name + ' - ' + item.policy_name;
|
||||
//console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
@ -597,7 +657,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<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>
|
||||
<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>
|
||||
@ -609,14 +669,20 @@
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
localStorage.setItem('pendingActionCount', pendingActionCount)
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<!-- Modal content for the Large example -->
|
||||
<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-content">
|
||||
<div class="modal-header">
|
||||
@ -27,7 +27,7 @@
|
||||
</select>
|
||||
</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>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<input type="radio" id="individual" name="premium_type" value="2">
|
||||
@ -35,7 +35,7 @@
|
||||
<input type="radio" id="single" name="premium_type" value="1">
|
||||
<label for="single" style="position: relative;top: 5px;left: 5px;"> Single Insurance </label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
</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"
|
||||
id="btnGridSubmit_2">Submit</button>
|
||||
</div>
|
||||
@ -710,10 +710,10 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
|
||||
var client_policy_id = $(this).data('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');
|
||||
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') {
|
||||
|
||||
@ -733,15 +733,17 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
|
||||
|
||||
$('#GridForm')[0].reset();
|
||||
|
||||
// if(res.family_floater == 1){
|
||||
// $('#premium_type').show();
|
||||
// $('#individual').prop('checked', true)
|
||||
// }else{
|
||||
// $('#premium_type').hide();
|
||||
// $('#individual').prop('checked', false)
|
||||
// }
|
||||
if(policy_type_string == 'GMC'){
|
||||
$('#premium_type').show();
|
||||
$('#individual').prop('checked', true)
|
||||
}else{
|
||||
$('#premium_type').hide();
|
||||
$('#individual').prop('checked', true)
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
@ -758,12 +760,13 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||
$('#grid_emp_count').val(res.count);
|
||||
|
||||
|
||||
if (res.count > 0) {
|
||||
console.log('count -- 2', res.count);
|
||||
$("#btnGridSubmit_2").hide();
|
||||
console.log(' hide submit btn count ', res.count);
|
||||
$("#hide_smbt_btn").hide();
|
||||
} else {
|
||||
$("#btnGridSubmit_2").show();
|
||||
console.log('count -- ', res.count);
|
||||
$("#hide_smbt_btn").show();
|
||||
console.log('show submit btn count ', res.count);
|
||||
}
|
||||
|
||||
if (res.status === false) {
|
||||
@ -787,25 +790,26 @@ $('body').on('click', '.btnPolicyModel', function() {
|
||||
'</option>';
|
||||
});
|
||||
$('#grid').html(policeGridOptionHTML);
|
||||
|
||||
|
||||
// if (res.premiumData[0].hasOwnProperty('premium_type')) {
|
||||
if (res.premiumData[0].hasOwnProperty('premium_type')) {
|
||||
|
||||
// if (res.premiumData[0].premium_type == '2') {
|
||||
if (res.premiumData[0].premium_type == '2') {
|
||||
|
||||
// $('#individual').prop('checked', true)
|
||||
// $('#single').prop('checked', false)
|
||||
$('#individual').prop('checked', true)
|
||||
$('#single').prop('checked', false)
|
||||
|
||||
// } else if (res.premiumData[0].premium_type == '1') {
|
||||
} else if (res.premiumData[0].premium_type == '1') {
|
||||
|
||||
// $('#single').prop('checked', true)
|
||||
// $('#individual').prop('checked', false)
|
||||
$('#single').prop('checked', true)
|
||||
$('#individual').prop('checked', false)
|
||||
|
||||
// } else {
|
||||
// $('#single').prop('checked', false)
|
||||
// $('#individual').prop('checked', false)
|
||||
// }
|
||||
} else {
|
||||
$('#single').prop('checked', false)
|
||||
$('#individual').prop('checked', true)
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
$(`input[name="${id_for_trigger}_si[]"]`).each(function() {
|
||||
console.log($(this));
|
||||
// console.log($(this));
|
||||
$(this).trigger('keyup');
|
||||
});
|
||||
|
||||
$(`input[name="${id_for_trigger}_premium[]"]`).each(function() {
|
||||
console.log($(this));
|
||||
// console.log($(this));
|
||||
$(this).trigger('keyup');
|
||||
});
|
||||
|
||||
@ -915,17 +919,26 @@ $('#grid').change(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 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) {
|
||||
|
||||
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||
$('#grid_emp_count').val(res.count);
|
||||
|
||||
if (res.count == false) {
|
||||
console.log('count -- 2', res.count);
|
||||
$("#btnGridSubmit_2").hide();
|
||||
if (res.count > 0) {
|
||||
// console.log(' hide submit btn count ', res.count);
|
||||
$("#hide_smbt_btn").hide();
|
||||
} else {
|
||||
$("#btnGridSubmit_2").show();
|
||||
console.log('count -- ', res.count);
|
||||
$("#hide_smbt_btn").show();
|
||||
// console.log('show submit btn count ', res.count);
|
||||
}
|
||||
|
||||
if (res.status === false) {
|
||||
@ -996,9 +1009,9 @@ var Count = 1
|
||||
|
||||
function appendGridtHtml(ui_type = false, data = false, ) {
|
||||
|
||||
console.log('appendGridtHtml function called')
|
||||
console.log(ui_type)
|
||||
console.log(data)
|
||||
// console.log('appendGridtHtml function called')
|
||||
// console.log(ui_type)
|
||||
// console.log(data)
|
||||
|
||||
var html = '';
|
||||
// console.log('Grid Content',data)
|
||||
@ -1007,13 +1020,13 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
||||
|
||||
if (ui_type == '1') {
|
||||
|
||||
console.log('step 1')
|
||||
// console.log('step 1')
|
||||
var currentTime = getCurrentTime();
|
||||
console.log(currentTime);
|
||||
// console.log(currentTime);
|
||||
|
||||
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}">
|
||||
<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'){
|
||||
|
||||
console.log('step 3')
|
||||
// console.log('step 3')
|
||||
|
||||
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') {
|
||||
|
||||
@ -1775,10 +1788,10 @@ function checkDuplicate() {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('siValues', siValues);
|
||||
console.log('premiumValues', premiumValues);
|
||||
console.log('siDuplicates', siDuplicates);
|
||||
console.log('premiumDuplicates', premiumDuplicates);
|
||||
// console.log('siValues', siValues);
|
||||
// console.log('premiumValues', premiumValues);
|
||||
// console.log('siDuplicates', siDuplicates);
|
||||
// console.log('premiumDuplicates', premiumDuplicates);
|
||||
|
||||
if (siDuplicates || premiumDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
@ -1829,12 +1842,12 @@ function checkDuplicate() {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('siValues', siValues);
|
||||
console.log('premiumValues', premiumValues);
|
||||
console.log('bandValues', bandValues);
|
||||
console.log('siDuplicates', siDuplicates);
|
||||
console.log('premiumDuplicates', premiumDuplicates);
|
||||
console.log('bandDuplicates', bandDuplicates);
|
||||
// console.log('siValues', siValues);
|
||||
// console.log('premiumValues', premiumValues);
|
||||
// console.log('bandValues', bandValues);
|
||||
// console.log('siDuplicates', siDuplicates);
|
||||
// console.log('premiumDuplicates', premiumDuplicates);
|
||||
// console.log('bandDuplicates', bandDuplicates);
|
||||
|
||||
if (siDuplicates || bandDuplicates || premiumDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
@ -1883,7 +1896,7 @@ function basicPayMultiple(input) {
|
||||
|
||||
function gpaSumInsureMultiplier(element) {
|
||||
|
||||
console.log(element);
|
||||
// console.log(element);
|
||||
|
||||
var element = $('#gpa_sum_multiplier')[0];
|
||||
var sumInsured = $('input[name="gpa_sum_si[]"]');
|
||||
@ -1990,7 +2003,7 @@ function si_orbp_change_function() {
|
||||
$('#gmc_add_more').hide();
|
||||
}
|
||||
|
||||
console.log('gmcBandInput', count)
|
||||
// console.log('gmcBandInput', count)
|
||||
|
||||
|
||||
var gpaBandRemoveElements = $("#grid_1").nextAll("div").find(".gpa_band_remove").length;
|
||||
@ -2049,7 +2062,7 @@ function si_orbp_change_function() {
|
||||
$('#gmc_add_more2').hide();
|
||||
}
|
||||
|
||||
console.log('gmcBandInput', count)
|
||||
// console.log('gmcBandInput', count)
|
||||
|
||||
$('#si_or_bp_full_div').css({
|
||||
'display': '',
|
||||
|
||||
11
writable/e_card_template/.gitkeep
Normal file
11
writable/e_card_template/.gitkeep
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user