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');
|
||||
$rack_rate_name = $this->request->getPost('rack_rate_name');
|
||||
|
||||
$self = $this->request->getPost('self') ? 1 : 0;
|
||||
$spouse = $this->request->getPost('spouse');
|
||||
$childrens = $this->request->getPost('childrens');
|
||||
$parents = $this->request->getPost('parents');
|
||||
$parents_in_law = $this->request->getPost('parents-in-law');
|
||||
$relation_data = [
|
||||
'self' => $this->request->getPost('self'),
|
||||
'spouse' => $this->request->getPost('spouse'),
|
||||
'childrens' => $this->request->getPost('childrens'),
|
||||
'parents' => $this->request->getPost('parents'),
|
||||
'parents-in-law'=> $this->request->getPost('parents-in-law'),
|
||||
];
|
||||
|
||||
if($policy_grid_id == 1 || $policy_grid_id == 2){
|
||||
$self = 1;
|
||||
$spouse = 'NA';
|
||||
$childrens = 'NA';
|
||||
$parents = 'NA';
|
||||
$parents_in_law = 'NA';
|
||||
if ($policy_grid_id == 1 || $policy_grid_id == 2 || $policy_grid_id == 6 || $policy_grid_id == 7) {
|
||||
$relation_data = [
|
||||
'self' => 1,
|
||||
'spouse' => 'NA',
|
||||
'childrens' => 'NA',
|
||||
'parents' => 'NA',
|
||||
'parents-in-law'=> 'NA',
|
||||
];
|
||||
}
|
||||
|
||||
$relation_data['self'] = $self;
|
||||
$relation_data['spouse'] = $spouse;
|
||||
$relation_data['childrens'] = $childrens;
|
||||
$relation_data['parents'] = $parents;
|
||||
$relation_data['parents-in-law'] = $parents_in_law;
|
||||
|
||||
// Convert to JSON
|
||||
$jsonDataForRelation = json_encode($relation_data);
|
||||
|
||||
|
||||
$si_or_bp = $this->request->getPost('si_or_bp');
|
||||
$basic_multiplier = str_replace(',', '', $this->request->getPost('basic_multiplier'));
|
||||
$premium_multiplier = str_replace(',', '', $this->request->getPost('premium_multiplier'));
|
||||
|
||||
@ -521,6 +521,9 @@
|
||||
|
||||
$('#policy_table tr').remove();
|
||||
var policyTable = '';
|
||||
var role = res.data.role
|
||||
delete res.data.role;
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
console.log(item);
|
||||
var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc'
|
||||
@ -576,9 +579,10 @@
|
||||
<tr>
|
||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||
<td>${policy_name_data}</td>
|
||||
<td>${item.branch_name}</td>
|
||||
<td>${item.branch_name ? item.branch_name : ' - '}</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>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||
<td>
|
||||
@ -587,8 +591,15 @@
|
||||
<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="${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" onclick = "removepolicy(this)"><i class="fa fa-trash mr-2 text-muted font-18 vertical-middle"></i>Delete</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>`;
|
||||
|
||||
// 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>
|
||||
</td>
|
||||
@ -1031,16 +1042,27 @@
|
||||
|
||||
//for date convert to indian formate like this 'yyyy-mm-dd' to this 'dd-mm-yyyy'
|
||||
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];
|
||||
return rearrangedDate;
|
||||
} else {
|
||||
// Handle unexpected date format
|
||||
return '00-00-0000';
|
||||
}
|
||||
|
||||
} else {
|
||||
// Handle the case where inputDate is not a valid string
|
||||
return '00-00-0000';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkDateStatus(inputDate, bg = false) {
|
||||
|
||||
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_html', grid_html)
|
||||
$(grid_container).empty();
|
||||
if(data == false){
|
||||
$(grid_container).empty();
|
||||
}
|
||||
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
||||
console.log('grid_container step 5');
|
||||
console.log('grid_container step 6', grid_container);
|
||||
|
||||
|
||||
if (dataIdValue == '1') {
|
||||
$('#gpa_sum_si').trigger('keyup');
|
||||
@ -1283,24 +1288,24 @@ var Count = 1
|
||||
function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
{
|
||||
console.log('appendGridtHtml function data', data);
|
||||
console.log('appendGridtHtml ui_type', ui_type);
|
||||
|
||||
console.log('secondary', secondary)
|
||||
console.log('typeof secondary', typeof secondary)
|
||||
console.log('appendGridtHtml function ui_type', ui_type);
|
||||
console.log('appendGridtHtml function secondary', secondary);
|
||||
console.log('appendGridtHtml function typeof secondary', typeof secondary)
|
||||
|
||||
var html = '';
|
||||
Count++;
|
||||
|
||||
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') {
|
||||
container_id = 'grid_content_input_for_additional_' + secondary;
|
||||
console.log('container', 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') {
|
||||
|
||||
// console.log('step 1')
|
||||
@ -1444,7 +1449,7 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<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 class="form-group col-md-3">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
@ -1743,8 +1748,9 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
</div>`;
|
||||
}
|
||||
|
||||
console.log('container', container);
|
||||
console.log('appendGridtHtml function container step 4', container);
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
console.log('appendGridtHtml function container step 5', container);
|
||||
|
||||
// $('#gmc_add_more').hide();
|
||||
// $('#gmc_add_more2').hide();
|
||||
@ -1840,11 +1846,17 @@ function checkDuplicate(unique_id = null)
|
||||
|
||||
// Extract values from input arrays
|
||||
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() {
|
||||
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++) {
|
||||
@ -2623,7 +2635,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
<label>Choose applicable family members</label>`;
|
||||
|
||||
if (obj['self'] > 0) {
|
||||
let selfValue = additional_relationship['self'] || 'NA';
|
||||
let selfValue = additional_relationship['self'] || '1';
|
||||
console.log('selfValue', selfValue);
|
||||
|
||||
html += `
|
||||
@ -2649,7 +2661,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
}
|
||||
|
||||
if (obj['spouse'] > 0) {
|
||||
let spouseValue = additional_relationship['spouse'] || 'NA';
|
||||
let spouseValue = additional_relationship['spouse'] || 'any';
|
||||
|
||||
html += `
|
||||
<div class="radio-group">
|
||||
@ -2675,7 +2687,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
|
||||
if (obj['childrens'] > 0) {
|
||||
|
||||
let childrensValue = additional_relationship['childrens'] || 'NA';
|
||||
let childrensValue = additional_relationship['childrens'] || 'any';
|
||||
|
||||
html += `
|
||||
<div class="radio-group">
|
||||
@ -2712,7 +2724,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
}
|
||||
|
||||
if (obj['parents'] > 0) {
|
||||
let parentsValue = additional_relationship['parents'] || 'NA';
|
||||
let parentsValue = additional_relationship['parents'] || 'any';
|
||||
|
||||
html += `
|
||||
<div class="radio-group">
|
||||
@ -2741,7 +2753,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
}
|
||||
|
||||
if (obj['parents-in-law'] > 0) {
|
||||
let parentsInLawValue = additional_relationship['parents-in-law'] || 'NA';
|
||||
let parentsInLawValue = additional_relationship['parents-in-law'] || 'any';
|
||||
html += `
|
||||
<div class="radio-group">
|
||||
<label class="col-lg-1">Parents-in-law:</label>
|
||||
@ -2960,8 +2972,8 @@ function checkPolicyTermsSI(unique_id = null)
|
||||
function appendNewTab(tabNameData = null, data = null)
|
||||
{
|
||||
console.log('appendNewTab function called');
|
||||
console.log('tabNameData', tabNameData);
|
||||
console.log('data', data);
|
||||
console.log('appendNewTab function tabNameData', tabNameData);
|
||||
console.log('appendNewTab function data', data);
|
||||
|
||||
let tabName = tabNameData;
|
||||
|
||||
@ -3072,23 +3084,26 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
var policy_grid_id = null;
|
||||
var additional_relationship = [];
|
||||
var premium_type = null;
|
||||
var si_or_bp_value = ''
|
||||
if(data){
|
||||
|
||||
addGridHTML(false, data[0], data[0].policy_grid_id, false, tabId);
|
||||
policy_grid_id = data[0].policy_grid_id
|
||||
additional_relationship = data[0].additional_relationship;
|
||||
premium_type = data[0].premium_type;
|
||||
console.log('appendNewTab function first index data', data[0])
|
||||
console.log('appendNewTab function first index data[0].policy_grid_id', data[0].policy_grid_id)
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
// data.shift();
|
||||
// if(data.length > 1){
|
||||
$.each(data, function(index, item) {
|
||||
// console.log(item)
|
||||
policy_grid_id = item.policy_grid_id
|
||||
additional_relationship = item.additional_relationship;
|
||||
premium_type = item.premium_type;
|
||||
appendGridtHtml(item.policy_grid_id, tabId, item);
|
||||
});
|
||||
// }
|
||||
console.log('appendNewTab function index', index)
|
||||
policy_grid_id = item.policy_grid_id
|
||||
additional_relationship = item.additional_relationship;
|
||||
premium_type = item.premium_type;
|
||||
|
||||
// if(index == 0){
|
||||
// addGridHTML(false, item, item.policy_grid_id, si_or_bp_value, tabId);
|
||||
// }else{
|
||||
// appendGridtHtml(item.policy_grid_id, tabId, item);
|
||||
// }
|
||||
|
||||
appendGridtHtml(item.policy_grid_id, tabId, item);
|
||||
});
|
||||
}
|
||||
|
||||
appendGridData(rack_rate_array, policy_grid_id, tabId);
|
||||
@ -3184,7 +3199,7 @@ function removeTab(input, tabID, tabName)
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You want to remove this Rack Rate.",
|
||||
text: "Do you want to remove this Rack Rate.",
|
||||
icon: "info",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user