CHANGE_IN_POLICY_RAC_RATE : AADHAVAN

This commit is contained in:
aadhavan valli 2024-03-14 17:48:38 +05:30
parent fd16bc2d01
commit 65bb5a0c63

View File

@ -102,7 +102,7 @@
}
grid_html = `
<div class="form-row" id="grid_2">
<div class="form-row" id="grid_2" style="width:84%">
<input value="1" type="hidden" name="policy_type">
<div class="form-group col-md-6">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
@ -124,7 +124,7 @@
}
grid_html = `
<div class="form-row" id="grid_3">
<div class="form-row" id="grid_3" style="width:84%">
<div class="form-group col-md-5">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="gpa_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -149,7 +149,7 @@
}
grid_html = `
<div class="form-row" id="grid_4">
<div class="form-row" id="grid_4" style="width:84%">
<div class="form-group col-md-4">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -184,7 +184,7 @@
}
grid_html = `
<div class="form-row" id="grid_5">
<div class="form-row" id="grid_5" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -217,7 +217,7 @@
}
grid_html = `
<div class="form-row" id="grid_6">
<div class="form-row" id="grid_6" style="width:84%">
<div class="form-group col-md-4">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -252,7 +252,7 @@
}
grid_html = `
<div class="form-row" id="grid_7">
<div class="form-row" id="grid_7" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -287,7 +287,7 @@
grid_html = `
<div class="form-row" id="grid_8">
<div class="form-row" id="grid_8" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -316,7 +316,7 @@
grid_html = `
<div class="form-row" id="grid_9">
<div class="form-row" id="grid_9" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -345,7 +345,7 @@
}
grid_html = `
<div class="form-row" id="grid_10">
<div class="form-row" id="grid_10" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -378,7 +378,7 @@
grid_html = `
<div class="form-row" id="grid_11">
<div class="form-row" id="grid_11" style="width:84%">
<div class="form-group col-md-2">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -422,83 +422,7 @@
$('#si_or_bp').change(function(){
var selectedValue = $(this).val();
var client_policy_id = $('#grid');
$('#client_policy_id').val(client_policy_id);
console.log("client_policy_id", client_policy_id);
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: '<?= base_url("util/policy-premium") ?>' ,
type: "GET",
data: { client_policy_id: client_policy_id},
dataType: 'json',
success: function (res) {
$('#nameOfThePolicy').html(' - ' + res.policy_name);
$('#grid_emp_count').val(res.count);
if (res.status === false) {
toastr.error(res.status);
return;
}
var policy_grid_id_value = '';
if (res.premiumData && res.premiumData.length > 0 && res.premiumData[0].policy_grid_id) {
policy_grid_id_value = res.premiumData[0].policy_grid_id;
}
$('#grid_content_input').empty();
var policeGridOptionHTML = '';
policeGridOptionHTML += ` <option value="">Select Premium Type</option>`;
$.each(res.data, function(index, item) {
policeGridOptionHTML += '<option data-id="'+ item.ui_type +'" value="' + item.id + '" ' + (policy_grid_id_value === item.id ? 'selected="selected"' : '') + '>' + item.policy_grid_type + '</option>';
});
$('#grid').html(policeGridOptionHTML);
if (res.premiumData && res.premiumData.length > 0) {
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id, res.premiumData[0].si_or_bp);
res.premiumData.shift();
$.each(res.premiumData, function(index, item){
if (item.si_or_bp == '1') {
appendGridtHtml('1_1_1_1', item);
}else{
appendGridtHtml(item.policy_grid_id, item);
}
});
} else {
console.log("res.premiumData is undefined, null, or empty.");
}
$('#bs-example-modal-lg').modal('show');
$("#gpa_si").trigger("keyup");
$("#basic_gpa_premium").trigger("keyup");
$("#sum_insured").trigger("keyup");
$("#premium").trigger("keyup");
$("input[name='si[]']").trigger("keyup");
$("input[name='premium[]']").trigger("keyup")
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
}, 1000);
}
});
si_or_bp_two(selectedValue);
@ -913,7 +837,7 @@
else if(ui_type == '3'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-5">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="gpa_si_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -935,7 +859,7 @@
html =`
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">From Age<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="age_from[]" id="age_from" required>
@ -959,7 +883,7 @@
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -987,7 +911,7 @@
}else if(ui_type == '6'){
html =`
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-4">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)"required>
@ -1017,7 +941,7 @@
}else if(ui_type == '7'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -1045,7 +969,7 @@
}else if(ui_type == '8'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -1069,7 +993,7 @@
}else if(ui_type == '9'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -1093,7 +1017,7 @@
}else if(ui_type == '10'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-3">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
@ -1121,7 +1045,7 @@
}else if(ui_type == '11'){
html = `
<div class="form-row" id="removeChild_${Count}">
<div class="form-row" id="removeChild_${Count}" style="width:84%">
<div class="form-group col-md-2">
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="sum_insured_${Count}" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>