CHANGE_ENROLLMENT_STATUS_AND_REMINDER_MAIL_CHANGE_THE_CODE_CONFLICT_MERAGE_ANOTHER_CONFLICT_MERGE : AADHAVAN
This commit is contained in:
commit
909742333b
@ -1026,28 +1026,28 @@ class ClientController extends AdminController
|
|||||||
$policy_grid_id = $this->request->getPost('policy_grid_id');
|
$policy_grid_id = $this->request->getPost('policy_grid_id');
|
||||||
$rack_rate_name = $this->request->getPost('rack_rate_name');
|
$rack_rate_name = $this->request->getPost('rack_rate_name');
|
||||||
|
|
||||||
$self = $this->request->getPost('self') ? 1 : 0;
|
$relation_data = [
|
||||||
$spouse = $this->request->getPost('spouse');
|
'self' => $this->request->getPost('self'),
|
||||||
$childrens = $this->request->getPost('childrens');
|
'spouse' => $this->request->getPost('spouse'),
|
||||||
$parents = $this->request->getPost('parents');
|
'childrens' => $this->request->getPost('childrens'),
|
||||||
$parents_in_law = $this->request->getPost('parents-in-law');
|
'parents' => $this->request->getPost('parents'),
|
||||||
|
'parents-in-law'=> $this->request->getPost('parents-in-law'),
|
||||||
|
];
|
||||||
|
|
||||||
if($policy_grid_id == 1 || $policy_grid_id == 2){
|
if ($policy_grid_id == 1 || $policy_grid_id == 2 || $policy_grid_id == 6 || $policy_grid_id == 7) {
|
||||||
$self = 1;
|
$relation_data = [
|
||||||
$spouse = 'NA';
|
'self' => 1,
|
||||||
$childrens = 'NA';
|
'spouse' => 'NA',
|
||||||
$parents = 'NA';
|
'childrens' => 'NA',
|
||||||
$parents_in_law = 'NA';
|
'parents' => 'NA',
|
||||||
|
'parents-in-law'=> 'NA',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$relation_data['self'] = $self;
|
// Convert to JSON
|
||||||
$relation_data['spouse'] = $spouse;
|
|
||||||
$relation_data['childrens'] = $childrens;
|
|
||||||
$relation_data['parents'] = $parents;
|
|
||||||
$relation_data['parents-in-law'] = $parents_in_law;
|
|
||||||
|
|
||||||
$jsonDataForRelation = json_encode($relation_data);
|
$jsonDataForRelation = json_encode($relation_data);
|
||||||
|
|
||||||
|
|
||||||
$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'));
|
||||||
$premium_multiplier = str_replace(',', '', $this->request->getPost('premium_multiplier'));
|
$premium_multiplier = str_replace(',', '', $this->request->getPost('premium_multiplier'));
|
||||||
|
|||||||
@ -521,6 +521,9 @@
|
|||||||
|
|
||||||
$('#policy_table tr').remove();
|
$('#policy_table tr').remove();
|
||||||
var policyTable = '';
|
var policyTable = '';
|
||||||
|
var role = res.data.role
|
||||||
|
delete res.data.role;
|
||||||
|
|
||||||
$.each(res.data, function(index, item) {
|
$.each(res.data, function(index, item) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc'
|
var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc'
|
||||||
@ -576,9 +579,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${policy_name_data}</td>
|
<td>${policy_name_data}</td>
|
||||||
<td>${item.branch_name}</td>
|
<td>${item.branch_name ? item.branch_name : ' - '}</td>
|
||||||
<td>${tpaValue}</td>
|
<td>${tpaValue}</td>
|
||||||
<td>${rearrangeDateFormat(item.open_date)} / ${rearrangeDateFormat(item.close_date)}</td>
|
|
||||||
|
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||||
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
@ -587,8 +591,15 @@
|
|||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>`;
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item" onclick = "removepolicy(this)"><i class="fa fa-trash mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
|
||||||
|
// Conditionally render the delete option based on the role
|
||||||
|
if (role !== 3 && role !== 4) {
|
||||||
|
policyTable += `
|
||||||
|
<a href="#" data-id="${item.id}" id="${search_term}" data-typeid="${item.policy_type_id}" class="dropdown-item" onclick="removepolicy(this)"><i class="fa fa-trash mr-2 text-muted font-18 vertical-middle"></i>Delete</a>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
policyTable += `
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -1031,16 +1042,27 @@
|
|||||||
|
|
||||||
//for date convert to indian formate like this 'yyyy-mm-dd' to this 'dd-mm-yyyy'
|
//for date convert to indian formate like this 'yyyy-mm-dd' to this 'dd-mm-yyyy'
|
||||||
function rearrangeDateFormat(inputDate) {
|
function rearrangeDateFormat(inputDate) {
|
||||||
if (inputDate !== null) {
|
|
||||||
var dateComponents = inputDate.split("-");
|
console.log('inputDate', inputDate)
|
||||||
|
// Check if inputDate is a string and not empty
|
||||||
|
if (typeof inputDate === 'string' && inputDate.trim() !== '') {
|
||||||
|
var dateComponents = inputDate.split("-");
|
||||||
|
|
||||||
|
// Check if dateComponents has the expected number of parts
|
||||||
|
if (dateComponents.length === 3) {
|
||||||
var rearrangedDate = dateComponents[2] + "-" + dateComponents[1] + "-" + dateComponents[0];
|
var rearrangedDate = dateComponents[2] + "-" + dateComponents[1] + "-" + dateComponents[0];
|
||||||
return rearrangedDate;
|
return rearrangedDate;
|
||||||
} else {
|
} else {
|
||||||
|
// Handle unexpected date format
|
||||||
return '00-00-0000';
|
return '00-00-0000';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Handle the case where inputDate is not a valid string
|
||||||
|
return '00-00-0000';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkDateStatus(inputDate, bg = false) {
|
function checkDateStatus(inputDate, bg = false) {
|
||||||
|
|
||||||
var givenDate = new Date(inputDate);
|
var givenDate = new Date(inputDate);
|
||||||
|
|||||||
@ -1246,8 +1246,13 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
|
|
||||||
console.log('grid_container step 4', grid_container)
|
console.log('grid_container step 4', grid_container)
|
||||||
// console.log('grid_html', grid_html)
|
// console.log('grid_html', grid_html)
|
||||||
$(grid_container).empty();
|
if(data == false){
|
||||||
|
$(grid_container).empty();
|
||||||
|
}
|
||||||
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
||||||
|
console.log('grid_container step 5');
|
||||||
|
console.log('grid_container step 6', grid_container);
|
||||||
|
|
||||||
|
|
||||||
if (dataIdValue == '1') {
|
if (dataIdValue == '1') {
|
||||||
$('#gpa_sum_si').trigger('keyup');
|
$('#gpa_sum_si').trigger('keyup');
|
||||||
@ -1283,24 +1288,24 @@ var Count = 1
|
|||||||
function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||||
{
|
{
|
||||||
console.log('appendGridtHtml function data', data);
|
console.log('appendGridtHtml function data', data);
|
||||||
console.log('appendGridtHtml ui_type', ui_type);
|
console.log('appendGridtHtml function ui_type', ui_type);
|
||||||
|
console.log('appendGridtHtml function secondary', secondary);
|
||||||
console.log('secondary', secondary)
|
console.log('appendGridtHtml function typeof secondary', typeof secondary)
|
||||||
console.log('typeof secondary', typeof secondary)
|
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
Count++;
|
Count++;
|
||||||
|
|
||||||
var container = document.getElementById('grid_content_input');
|
var container = document.getElementById('grid_content_input');
|
||||||
// console.log('container', container);
|
console.log('appendGridtHtml function container step 1', container);
|
||||||
|
|
||||||
if (secondary != false && secondary != 'false' && secondary != null && secondary != 'null') {
|
if (secondary != false && secondary != 'false' && secondary != null && secondary != 'null') {
|
||||||
container_id = 'grid_content_input_for_additional_' + secondary;
|
container_id = 'grid_content_input_for_additional_' + secondary;
|
||||||
console.log('container', container_id);
|
|
||||||
container = document.getElementById(container_id);
|
container = document.getElementById(container_id);
|
||||||
console.log('container', container);
|
console.log('appendGridtHtml function container step 2', container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('appendGridtHtml function container step 3', container);
|
||||||
|
|
||||||
if (ui_type == '1') {
|
if (ui_type == '1') {
|
||||||
|
|
||||||
// console.log('step 1')
|
// console.log('step 1')
|
||||||
@ -1444,7 +1449,7 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1743,8 +1748,9 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
|||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('container', container);
|
console.log('appendGridtHtml function container step 4', container);
|
||||||
container.insertAdjacentHTML('beforeend', html);
|
container.insertAdjacentHTML('beforeend', html);
|
||||||
|
console.log('appendGridtHtml function container step 5', container);
|
||||||
|
|
||||||
// $('#gmc_add_more').hide();
|
// $('#gmc_add_more').hide();
|
||||||
// $('#gmc_add_more2').hide();
|
// $('#gmc_add_more2').hide();
|
||||||
@ -1840,11 +1846,17 @@ function checkDuplicate(unique_id = null)
|
|||||||
|
|
||||||
// Extract values from input arrays
|
// Extract values from input arrays
|
||||||
siInputs.each(function() {
|
siInputs.each(function() {
|
||||||
siValues.push($(this).val());
|
var value = $(this).val();
|
||||||
|
var cleanedValue = value.replace(/,/g, '');
|
||||||
|
var numericValue = parseFloat(cleanedValue);
|
||||||
|
siValues.push(numericValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
premiumInputs.each(function() {
|
premiumInputs.each(function() {
|
||||||
premiumValues.push($(this).val());
|
var value = $(this).val();
|
||||||
|
var cleanedValue = value.replace(/,/g, '');
|
||||||
|
var numericValue = parseFloat(cleanedValue);
|
||||||
|
premiumValues.push(numericValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var i = 0; i < siValues.length; i++) {
|
for (var i = 0; i < siValues.length; i++) {
|
||||||
@ -2623,7 +2635,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
<label>Choose applicable family members</label>`;
|
<label>Choose applicable family members</label>`;
|
||||||
|
|
||||||
if (obj['self'] > 0) {
|
if (obj['self'] > 0) {
|
||||||
let selfValue = additional_relationship['self'] || 'NA';
|
let selfValue = additional_relationship['self'] || '1';
|
||||||
console.log('selfValue', selfValue);
|
console.log('selfValue', selfValue);
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
@ -2649,7 +2661,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj['spouse'] > 0) {
|
if (obj['spouse'] > 0) {
|
||||||
let spouseValue = additional_relationship['spouse'] || 'NA';
|
let spouseValue = additional_relationship['spouse'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
@ -2675,7 +2687,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
|
|
||||||
if (obj['childrens'] > 0) {
|
if (obj['childrens'] > 0) {
|
||||||
|
|
||||||
let childrensValue = additional_relationship['childrens'] || 'NA';
|
let childrensValue = additional_relationship['childrens'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
@ -2712,7 +2724,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj['parents'] > 0) {
|
if (obj['parents'] > 0) {
|
||||||
let parentsValue = additional_relationship['parents'] || 'NA';
|
let parentsValue = additional_relationship['parents'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
@ -2741,7 +2753,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj['parents-in-law'] > 0) {
|
if (obj['parents-in-law'] > 0) {
|
||||||
let parentsInLawValue = additional_relationship['parents-in-law'] || 'NA';
|
let parentsInLawValue = additional_relationship['parents-in-law'] || 'any';
|
||||||
html += `
|
html += `
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Parents-in-law:</label>
|
<label class="col-lg-1">Parents-in-law:</label>
|
||||||
@ -2960,8 +2972,8 @@ function checkPolicyTermsSI(unique_id = null)
|
|||||||
function appendNewTab(tabNameData = null, data = null)
|
function appendNewTab(tabNameData = null, data = null)
|
||||||
{
|
{
|
||||||
console.log('appendNewTab function called');
|
console.log('appendNewTab function called');
|
||||||
console.log('tabNameData', tabNameData);
|
console.log('appendNewTab function tabNameData', tabNameData);
|
||||||
console.log('data', data);
|
console.log('appendNewTab function data', data);
|
||||||
|
|
||||||
let tabName = tabNameData;
|
let tabName = tabNameData;
|
||||||
|
|
||||||
@ -3072,23 +3084,26 @@ function appendNewTab(tabNameData = null, data = null)
|
|||||||
var policy_grid_id = null;
|
var policy_grid_id = null;
|
||||||
var additional_relationship = [];
|
var additional_relationship = [];
|
||||||
var premium_type = null;
|
var premium_type = null;
|
||||||
|
var si_or_bp_value = ''
|
||||||
if(data){
|
if(data){
|
||||||
|
|
||||||
addGridHTML(false, data[0], data[0].policy_grid_id, false, tabId);
|
console.log('appendNewTab function first index data', data[0])
|
||||||
policy_grid_id = data[0].policy_grid_id
|
console.log('appendNewTab function first index data[0].policy_grid_id', data[0].policy_grid_id)
|
||||||
additional_relationship = data[0].additional_relationship;
|
$.each(data, function(index, item) {
|
||||||
premium_type = data[0].premium_type;
|
|
||||||
|
|
||||||
// data.shift();
|
console.log('appendNewTab function index', index)
|
||||||
// if(data.length > 1){
|
policy_grid_id = item.policy_grid_id
|
||||||
$.each(data, function(index, item) {
|
additional_relationship = item.additional_relationship;
|
||||||
// console.log(item)
|
premium_type = item.premium_type;
|
||||||
policy_grid_id = item.policy_grid_id
|
|
||||||
additional_relationship = item.additional_relationship;
|
// if(index == 0){
|
||||||
premium_type = item.premium_type;
|
// addGridHTML(false, item, item.policy_grid_id, si_or_bp_value, tabId);
|
||||||
appendGridtHtml(item.policy_grid_id, tabId, item);
|
// }else{
|
||||||
});
|
// appendGridtHtml(item.policy_grid_id, tabId, item);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
appendGridtHtml(item.policy_grid_id, tabId, item);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
appendGridData(rack_rate_array, policy_grid_id, tabId);
|
appendGridData(rack_rate_array, policy_grid_id, tabId);
|
||||||
@ -3184,7 +3199,7 @@ function removeTab(input, tabID, tabName)
|
|||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "Are you sure?",
|
title: "Are you sure?",
|
||||||
text: "You want to remove this Rack Rate.",
|
text: "Do you want to remove this Rack Rate.",
|
||||||
icon: "info",
|
icon: "info",
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: "#3085d6",
|
confirmButtonColor: "#3085d6",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user