CHANGE_POLICY_GRID : AADHAVAN
This commit is contained in:
parent
65bb5a0c63
commit
9411d5d297
@ -213,10 +213,10 @@ $routes->post("/employeeUpload", "EmployeeRestController::employeeUpload");
|
||||
|
||||
|
||||
$routes->group("employeeRest", ["filter" => "authJWT"], function($routes){
|
||||
$routes->get("/relationshipList", "EmployeeRestController::relationshipList");
|
||||
$routes->get("getEmployeeAndDependence", "EmployeeRestController::getEmployeeAndDependence");
|
||||
$routes->post("editEmployeeAndDependence", "EmployeeRestController::editEmployeeAndDependence");
|
||||
$routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAndDependence");
|
||||
$routes->get("/relationshipList", "EmployeeRestController::relationshipList");
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -598,7 +598,13 @@ class ClientController extends AdminController
|
||||
|
||||
$this->policyPremium1Model->where('client_id', $client_id)->where('client_policy_id', $client_policy_id)->set('is_active', 0)->update();
|
||||
|
||||
$premiumData = $this->request->getPost('premium');
|
||||
if($si_or_bp == '1'){
|
||||
$premiumData = $this->request->getPost('sum_premium');
|
||||
|
||||
}else{
|
||||
$premiumData = $this->request->getPost('premium');
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($premiumData); $i++) {
|
||||
$data = [
|
||||
'client_id' => $client_id,
|
||||
@ -607,17 +613,35 @@ class ClientController extends AdminController
|
||||
'created_by' => get_session_userid(),
|
||||
];
|
||||
|
||||
if(is_array($this->request->getPost('si'))){
|
||||
$si = isset($this->request->getPost('si')[$i]) ? $this->request->getPost('si')[$i] : null;
|
||||
if ($si_or_bp == '2') {
|
||||
if(is_array($this->request->getPost('basic_si'))){
|
||||
$si = isset($this->request->getPost('basic_si')[$i]) ? $this->request->getPost('basic_si')[$i] : null;
|
||||
}else{
|
||||
$si = $this->request->getPost('basic_si');
|
||||
}
|
||||
} else {
|
||||
if(is_array($this->request->getPost('si'))){
|
||||
$si = isset($this->request->getPost('si')[$i]) ? $this->request->getPost('si')[$i] : null;
|
||||
}else{
|
||||
$si = $this->request->getPost('si');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($si_or_bp == '1'){
|
||||
if(is_array($this->request->getPost('sum_premium'))){
|
||||
$premium = isset($this->request->getPost('sum_premium')[$i]) ? $this->request->getPost('sum_premium')[$i] : null;
|
||||
}else{
|
||||
$premium = $this->request->getPost('sum_premium');
|
||||
}
|
||||
}else{
|
||||
$si = $this->request->getPost('si');
|
||||
if(is_array($this->request->getPost('premium'))){
|
||||
$premium = isset($this->request->getPost('premium')[$i]) ? $this->request->getPost('premium')[$i] : null;
|
||||
}else{
|
||||
$premium = $this->request->getPost('premium');
|
||||
}
|
||||
}
|
||||
|
||||
if(is_array($this->request->getPost('premium'))){
|
||||
$premium = isset($this->request->getPost('premium')[$i]) ? $this->request->getPost('premium')[$i] : null;
|
||||
}else{
|
||||
$premium = $this->request->getPost('premium');
|
||||
}
|
||||
// $basic_gpa_premium = isset($basic_gpa_premium[$i]) ? $basic_gpa_premium[$i] : null;
|
||||
if ($si !== null) {
|
||||
$data['si'] = $si;
|
||||
@ -626,17 +650,21 @@ class ClientController extends AdminController
|
||||
$data['premium'] = $premium;
|
||||
}
|
||||
|
||||
if ($multiplier !== null) {
|
||||
$data['multiplier'] = $multiplier;
|
||||
if($si_or_bp == 2){
|
||||
if ($premium_multiplier !== null) {
|
||||
$data['multiplier'] = $premium_multiplier;
|
||||
}
|
||||
}else{
|
||||
if ($multiplier !== null) {
|
||||
$data['multiplier'] = $multiplier;
|
||||
}
|
||||
}
|
||||
|
||||
if ($si_or_bp !== null) {
|
||||
$data['si_or_bp'] = $si_or_bp;
|
||||
}
|
||||
|
||||
if ($premium_multiplier !== null) {
|
||||
$data['multiplier'] = $premium_multiplier;
|
||||
}
|
||||
|
||||
|
||||
if ($basic_multiplier !== null) {
|
||||
$data['basic_multiplier'] = $basic_multiplier;
|
||||
|
||||
@ -180,8 +180,9 @@ class EmployeeRestController extends AdminController
|
||||
|
||||
public function getEmployeePolicy()
|
||||
{
|
||||
$id= 1;
|
||||
// $id= 4;
|
||||
try {
|
||||
$id = $this->request->getGet('id');
|
||||
$keysToRemove = ["sum_insured","family_floater","corporatebuffer","family_floaters"];
|
||||
|
||||
$empPolicy = $this->employeeModel->getEmployeePolicy($id);
|
||||
|
||||
@ -654,31 +654,31 @@
|
||||
};
|
||||
|
||||
function convertNumberToWords(number) {
|
||||
if (number === 0) {
|
||||
return numberWords[number];
|
||||
}
|
||||
if (number === 0) {
|
||||
return numberWords[number];
|
||||
}
|
||||
|
||||
let word = '';
|
||||
let word = '';
|
||||
|
||||
if (number >= 10000000) {
|
||||
word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore ";
|
||||
number %= 10000000;
|
||||
}
|
||||
if (number >= 10000000) {
|
||||
word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore ";
|
||||
number %= 10000000;
|
||||
}
|
||||
|
||||
if (number >= 100000) {
|
||||
word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh ";
|
||||
number %= 100000;
|
||||
}
|
||||
if (number >= 100000) {
|
||||
word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh ";
|
||||
number %= 100000;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand ";
|
||||
number %= 1000;
|
||||
}
|
||||
if (number >= 1000) {
|
||||
word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand ";
|
||||
number %= 1000;
|
||||
}
|
||||
|
||||
if (number >= 100) {
|
||||
word += convertNumberToWords(Math.floor(number / 100)) + " Hundred ";
|
||||
number %= 100;
|
||||
}
|
||||
if (number >= 100) {
|
||||
word += convertNumberToWords(Math.floor(number / 100)) + " Hundred ";
|
||||
number %= 100;
|
||||
}
|
||||
|
||||
if (number > 0) {
|
||||
if (word !== '') {
|
||||
@ -708,22 +708,67 @@
|
||||
|
||||
|
||||
function formatNumber(input, maxLength) {
|
||||
maxLength=16;
|
||||
let value = input.value.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
|
||||
value = Number(value).toLocaleString('en-IN');
|
||||
input.value = value;
|
||||
|
||||
maxLength=16;
|
||||
let value = input.value.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
|
||||
value = Number(value).toLocaleString('en-IN');
|
||||
input.value = value;
|
||||
|
||||
basicPayMultiple(input)
|
||||
if (input.id == 'gpa_si') {
|
||||
gpaSumInsureMultiplier();
|
||||
}
|
||||
basicPayMultiple(input)
|
||||
if (input.id == 'gpa_si') {
|
||||
gpaSumInsureMultiplier();
|
||||
}
|
||||
|
||||
return ;
|
||||
if(input.id == 'basic_pay'){
|
||||
var inputNumber = input.value;
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_basic_pay_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_basic_pay_number_word").text("");
|
||||
}
|
||||
}else if(input.id == 'basic_gpa_si'){
|
||||
var inputNumber = input.value;
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#basic_gpa_si_number_word").text(result);
|
||||
} else {
|
||||
$("#basic_gpa_si_number_word").text("");
|
||||
}
|
||||
}else if(input.id == 'basic_gpa_premium'){
|
||||
var inputNumber = input.value;
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#basic_gpa_premium_number_word").text(result);
|
||||
} else {
|
||||
$("#basic_gpa_premium_number_word").text("");
|
||||
}
|
||||
}else if(input.id == 'gpa_si'){
|
||||
var inputNumber = input.value;
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_sum_si_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_sum_si_number_word").text("");
|
||||
}
|
||||
}else if(input.id == 'gpa_premium'){
|
||||
var inputNumber = input.value;
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_sum_premium_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_sum_premium_number_word").text("");
|
||||
}
|
||||
}
|
||||
|
||||
return ;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -465,9 +465,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="days_of_discharge" name="days_of_discharge" class="form-control " placeholder="Enter the number of days">
|
||||
<div class="input-group-append input-group-append-client-policy-master">
|
||||
<span class="input-group-text" id="basic-addon2">Days</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -477,9 +475,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<input type="text" id="days_from_dod" name="days_from_dod" class="form-control " placeholder="Enter the number of days">
|
||||
<div class="input-group-append input-group-append-client-policy-master">
|
||||
<span class="input-group-text" id="basic-addon2">Days</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -58,11 +58,8 @@
|
||||
function addGridHTML(event = false, data = false, ui_type = false, si_or_bp=false){
|
||||
|
||||
$('#grid_content_input').empty();
|
||||
// console.log ($('#Client_id').val());
|
||||
|
||||
|
||||
|
||||
|
||||
var grid_container = document.getElementById('grid_content_input');
|
||||
var dataIdValue = ''
|
||||
if(event === false){
|
||||
@ -82,18 +79,70 @@
|
||||
}
|
||||
|
||||
grid_html = `
|
||||
<div class="form-row" id="grid_1" style="width:84%">
|
||||
<div class="form-row" id="grid_1">
|
||||
<input value="1" type="hidden" name="policy_type">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Select <span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="si_or_bp" name="si_or_bp" required>
|
||||
<select class="form-control" id="si_or_bp" name="si_or_bp" onchange="si_orbp_change_function()" required>
|
||||
<option value="2">Basic Pay</option>
|
||||
<option value="1">Sum Insured</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="si_or_bp_1"></div>
|
||||
<div class="form-row" id="si_or_bp_1_1"></div>
|
||||
<div class="form-row" style="margin-left: 2px;" id="si_or_bp_2"></div>
|
||||
<div id="si_or_bp_full_div" style="display:none">
|
||||
<div id="si_or_bp_sum_insure" class="form-row">
|
||||
<div class="form-row col-md-4" style="margin-left: 323px; margin-top: -114px;">
|
||||
<label for="mobile">Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="multiplier" id="multiplier" onkeyup="gpaSumInsureMultiplier(this)" required>
|
||||
</div>
|
||||
<div class="form-row" style="width:84%" id="removeChild_${Count}">
|
||||
<div class="form-group col-md-4" id="">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="si[]" id="gpa_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_sum_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.premium : '') : ''}" type="text" class="form-control" placeholder="Enter Premium" name="sum_premium[]" id="gpa_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_sum_premium_number_word' class="text-danger-2" ></div>
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1')">+</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="si_or_bp_sum_insure_child"></div>
|
||||
</div>
|
||||
<div id="si_or_bp_basic_pay" class="form-row">
|
||||
<div class="form-row" style="margin-left: 301px;/* margin-bottom: -106px; */margin-top: -97px;">
|
||||
<div class="form-col col-md-4">
|
||||
<label for="mobile">Basic Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="basic_multiplier" id="basic_multiplier" onkeyup='basicPayMultiple(this)' required>
|
||||
</div>
|
||||
<div class="form-col col-md-4">
|
||||
<label for="mobile">Premium Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.multiplier : '') : ''}" type="text" class="form-control" placeholder="Multiplier" name="premium_multiplier" id="premium_multiplier" onkeyup='basicPayMultiple(this)'required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4" id="" style="width:84%">
|
||||
<label for="mobile">Basic Pay<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.basic_pay : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="basic_pay" id="basic_pay" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_basic_pay_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4" id="">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="basic_si[]" id="basic_gpa_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='basic_gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.premium : '') : ''}" type="text" class="form-control basic_gpa_premium" placeholder="Enter Premium" name="premium[]" id="basic_gpa_premium" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='basic_gpa_premium_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
} else if(dataIdValue == '2'){
|
||||
@ -414,107 +463,31 @@
|
||||
$('#btnGridSubmit').hide();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
||||
$('#gpa_sum_insured').hide();
|
||||
$('#btnGridSubmit').show();
|
||||
|
||||
|
||||
$('#si_or_bp').change(function(){
|
||||
var selectedValue = $(this).val();
|
||||
|
||||
|
||||
|
||||
si_or_bp_two(selectedValue);
|
||||
|
||||
});
|
||||
|
||||
if(data !== false && data.si){
|
||||
console.log('show');
|
||||
$('#gpa_sum_insured').show();
|
||||
$('#si_or_bp').val("1");
|
||||
}else{
|
||||
$('#si_or_bp').val("2");
|
||||
}
|
||||
|
||||
$("#gpa_si").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_si_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_si_number_word").text("");
|
||||
}
|
||||
$('#si_or_bp').val(si_or_bp);
|
||||
setTimeout(() => {
|
||||
$('#si_or_bp').trigger('change');
|
||||
}, 300);
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#basic_gpa_premium").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_premium_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_premium_number_word").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#sum_insured").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#sum_insured_number_word").text(result);
|
||||
} else {
|
||||
$("#sum_insured_number_word").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#premium").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#premium_number_word").text(result);
|
||||
} else {
|
||||
$("#premium_number_word").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (si_or_bp == '1') {
|
||||
si_or_bp_two(si_or_bp);
|
||||
}else if(si_or_bp == '2'){
|
||||
si_or_bp_two(si_or_bp);
|
||||
}
|
||||
|
||||
if (si_or_bp == '2') {
|
||||
|
||||
console.log("data line-> 490", data);
|
||||
$('#si_or_bp').val(si_or_bp);
|
||||
$('#basic_multiplier').val(data.basic_multiplier);
|
||||
$('#basic_pay').val(data.basic_pay);
|
||||
$('#premium_multiplier').val(data.multiplier);
|
||||
$('#basic_gpa_si').val(data.si);
|
||||
$('#basic_gpa_premium').val(data.premium);
|
||||
}else if (si_or_bp == '1') {
|
||||
console.log("start");
|
||||
console.log(data);
|
||||
$('#si_or_bp').val(si_or_bp);
|
||||
$('#multiplier').val(data.multiplier);
|
||||
$('#gpa_si').val(data.si);
|
||||
$('#basic_gpa_premium').val(data.premium);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
$("#GridForm").submit(function(event) {
|
||||
|
||||
var check = checkDuplicate();
|
||||
|
||||
console.log("check.....");
|
||||
console.log(check);
|
||||
|
||||
|
||||
|
||||
event.preventDefault();
|
||||
@ -551,7 +524,7 @@
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
console.log(res);
|
||||
console.log("Response",res);
|
||||
|
||||
if (res.status === false) {
|
||||
toastr.error('Policy Dose Not Create', 'Error');
|
||||
@ -602,6 +575,7 @@
|
||||
data: { client_policy_id: client_policy_id},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log('res',res);
|
||||
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||
$('#grid_emp_count').val(res.count);
|
||||
|
||||
@ -623,14 +597,20 @@
|
||||
});
|
||||
$('#grid').html(policeGridOptionHTML);
|
||||
|
||||
|
||||
var si_or_bp_value = '';
|
||||
if (res.premiumData && res.premiumData.length > 0) {
|
||||
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id, res.premiumData[0].si_or_bp);
|
||||
|
||||
if(res.premiumData[0].si_or_bp){
|
||||
si_or_bp_value = res.premiumData[0].si_or_bp;
|
||||
}
|
||||
|
||||
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id, si_or_bp_value);
|
||||
|
||||
|
||||
res.premiumData.shift();
|
||||
$.each(res.premiumData, function(index, item){
|
||||
if (item.si_or_bp == '1') {
|
||||
appendGridtHtml('1_1_1_1', item);
|
||||
appendGridtHtml('1', item);
|
||||
}else{
|
||||
appendGridtHtml(item.policy_grid_id, item);
|
||||
}
|
||||
@ -643,19 +623,23 @@
|
||||
$('#bs-example-modal-lg').modal('show');
|
||||
|
||||
|
||||
$("#gpa_si").trigger("keyup");
|
||||
$("#basic_gpa_premium").trigger("keyup");
|
||||
// $("#gpa_si").trigger("keyup");
|
||||
// $("#basic_gpa_premium").trigger("keyup");
|
||||
|
||||
// $("#sum_insured").trigger("keyup");
|
||||
// $("#premium").trigger("keyup");
|
||||
|
||||
$("#sum_insured").trigger("keyup");
|
||||
$("#premium").trigger("keyup");
|
||||
|
||||
$("input[name='si[]']").trigger("keyup");
|
||||
$("input[name='premium[]']").trigger("keyup")
|
||||
// $('#basic_pay').trigger('keyup');
|
||||
// $("input[name='si[]']").trigger("keyup");
|
||||
// $("input[name='premium[]']").trigger("keyup")
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
$('#basic_gpa_si').trigger('keyup');
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -674,6 +658,8 @@
|
||||
var grid_id=$(this)[0].value;
|
||||
var client_policy_id =$('#client_policy_id')[0].value;
|
||||
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
@ -683,8 +669,6 @@
|
||||
data: { client_policy_id: client_policy_id},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
appendGridtHtml('1_2');
|
||||
appendGridtHtml('1_2_1');
|
||||
console.log('responce :', res);
|
||||
|
||||
setTimeout(function() {
|
||||
@ -692,7 +676,6 @@
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
if (res.premiumData.length > 0 && res.premiumData[0].policy_grid_id === grid_id) {
|
||||
console.log("heelo");
|
||||
|
||||
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||
$('#grid_emp_count').val(res.count);
|
||||
@ -714,43 +697,35 @@
|
||||
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);
|
||||
|
||||
var si_or_bp_value = '';
|
||||
if (res.premiumData && res.premiumData.length > 0) {
|
||||
|
||||
if(res.premiumData[0].si_or_bp){
|
||||
si_or_bp_value = res.premiumData[0].si_or_bp;
|
||||
|
||||
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id, res.premiumData[0].si_or_bp);
|
||||
$('#si_or_bp').val(si_or_bp_value);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id, si_or_bp_value);
|
||||
|
||||
res.premiumData.shift();
|
||||
$.each(res.premiumData, function(index, item){
|
||||
// console.log('premiumData index :',index)
|
||||
// appendGridtHtml(item.policy_grid_id, 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.");
|
||||
}
|
||||
}
|
||||
}else if(res.data[0].policy_type == "GPA"){
|
||||
$('#si_or_bp').val('2');
|
||||
|
||||
$('#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");
|
||||
}else{
|
||||
if($('#si_or_bp').val() == 2){
|
||||
addGridHTML(false, false, grid_id,)
|
||||
}
|
||||
// console.log("novkfdmmk");
|
||||
addGridHTML(false, false, grid_id)
|
||||
setTimeout(() => {
|
||||
$('#si_or_bp').trigger('change')
|
||||
}, 300);
|
||||
}
|
||||
// console.log("hello");
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@ -764,7 +739,6 @@
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
var Count = 1
|
||||
function appendGridtHtml(ui_type = false, data = false,) {
|
||||
|
||||
@ -773,66 +747,29 @@
|
||||
Count++;
|
||||
var container = document.getElementById('grid_content_input');
|
||||
|
||||
|
||||
if(ui_type == '1_1' || ui_type == '1_1_1' || ui_type == '1_1_1_1')
|
||||
if(ui_type == '1')
|
||||
{
|
||||
if (ui_type == '1_1_1' || ui_type == '1_1_1_1') {
|
||||
html=`<div class="form-row" style="width:84%" id="removeChild_${Count}"><div class="form-group col-md-4" id="">
|
||||
<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>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="basic_gpa_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1_1_1_1')">+</button>
|
||||
</div></div>`;
|
||||
// return html;
|
||||
}else{
|
||||
html =` <div class="form-row col-md-4">
|
||||
<label for="mobile">Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.multiplier : ''}" type="text" class="form-control" placeholder="Multiplier" name="multiplier" id="multiplier" onkeyup="gpaSumInsureMultiplier(this)" required>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// return html;
|
||||
}
|
||||
}
|
||||
else if(ui_type == '1_2' || ui_type == '1_2_1')
|
||||
{
|
||||
if (ui_type == '1_2_1') {
|
||||
html=`<div class="form-group col-md-4" id="" style="width:84%">
|
||||
<label for="mobile">Basic Pay<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="basic_pay" id="basic_pay" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4" id="">
|
||||
<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="basic_gpa_si" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="basic_gpa_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
||||
|
||||
html = `<div class="form-row gpa_sum_insure_remove" style="width:84%" id="removeChild_${Count}">
|
||||
<div class="form-group col-md-4" id="">
|
||||
<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>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="sum_premium[]" id="basic_gpa_premium" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml('1')">+</button>
|
||||
</div>
|
||||
</div>`;
|
||||
}else{
|
||||
html =` <div class="form-col col-md-4">
|
||||
<label for="mobile">Basic Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.multiplier : ''}" type="text" class="form-control" placeholder="Multiplier" name="basic_multiplier" id="basic_multiplier" onkeyup='basicPayMultiple(this)' required>
|
||||
</div>
|
||||
<div class="form-col col-md-4">
|
||||
<label for="mobile">Premium Multiplier<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.multiplier : ''}" type="text" class="form-control" placeholder="Multiplier" name="premium_multiplier" id="premium_multiplier" onkeyup='basicPayMultiple(this)'required>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
else if(ui_type == '1_2' )
|
||||
{
|
||||
|
||||
}
|
||||
else if(ui_type == '3'){
|
||||
|
||||
@ -1072,77 +1009,14 @@
|
||||
}
|
||||
|
||||
|
||||
if (ui_type == '1_1' || ui_type == '1_1_1' || ui_type == '1_2' || ui_type == '1_2_1' || ui_type == '1_1_1_1') {
|
||||
if(ui_type == '1_1'){
|
||||
$('#si_or_bp_1').empty().append(html);
|
||||
$('#si_or_bp_1_1').empty();
|
||||
$('#gmc_add_more').hide()
|
||||
$('#gmc_remove').show()
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
}else if(ui_type == '1_1_1'){
|
||||
$('#si_or_bp_2').empty().append(html);
|
||||
$('#gmc_add_more').hide()
|
||||
$('#gmc_remove').show()
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
}else if(ui_type == '1_2'){
|
||||
|
||||
$('#si_or_bp_1').empty();
|
||||
$('#si_or_bp_1_1').empty().append(html);
|
||||
$('#gmc_add_more').hide()
|
||||
$('#gmc_remove').show()
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
}else if(ui_type == '1_2_1'){
|
||||
$('#si_or_bp_2').empty().append(html);
|
||||
$('#gmc_add_more').hide()
|
||||
$('#gmc_remove').show()
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
}else if(ui_type == '1_1_1_1'){
|
||||
$('#si_or_bp_2').append(html);
|
||||
$('#gmc_add_more').hide()
|
||||
$('#gmc_remove').show()
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
|
||||
|
||||
console.log("data", data);
|
||||
|
||||
if(data){
|
||||
$('input[name="premium[]"]').length;
|
||||
$('input[name="premium[]"]').each(function(index) {
|
||||
if (index === $('input[name="premium[]"]').length - 1) {
|
||||
console.log("data.premium",data.premium);
|
||||
$(this).val(data.premium);
|
||||
// console.log("This ", $(this)[0].val(data.premium));
|
||||
// var basicGpaPremiumValue = $(this).val();
|
||||
|
||||
// if (basicGpaPremiumValue !== "" && basicGpaPremiumValue !== null) {
|
||||
// console.log("Value of basic_gpa_premium[]: " + basicGpaPremiumValue);
|
||||
// } else {
|
||||
// console.log("basic_gpa_premium[] value is empty or null");
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
container.insertAdjacentHTML('beforeend', html);
|
||||
$('#gmc_add_more').hide();
|
||||
$('#gmc_remove').show();
|
||||
Count--
|
||||
$('#gmc_add_more_'+Count).hide()
|
||||
Count++
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1185,7 +1059,6 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
function checkDuplicate()
|
||||
{
|
||||
// console.log($('#grid')[0].value);
|
||||
@ -1208,11 +1081,9 @@
|
||||
premiumValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < siValues.length; i++) {
|
||||
for (var j = i + 1; j < siValues.length; j++) {
|
||||
if (siValues[i] === siValues[j] && premiumValues[i] === premiumValues[j]) {
|
||||
console.log('Duplicate values found in si[] at indices', i, 'and', j);
|
||||
siDuplicates = true;
|
||||
}
|
||||
}
|
||||
@ -1220,10 +1091,8 @@
|
||||
|
||||
if (siDuplicates || premiumDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '4'){
|
||||
@ -1244,12 +1113,10 @@
|
||||
ageToValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < ageFromValues.length; i++) {
|
||||
for (var j = i + 1; j < ageFromValues.length; j++) {
|
||||
// Check for duplicates between age_from[] and age_to[]
|
||||
if (ageFromValues[i] === ageFromValues[j] && ageToValues[i] === ageToValues[j]) {
|
||||
console.log('Duplicate values found in age_from[] and age_to[] at indices', i, 'and', j);
|
||||
ageDuplicates = true;
|
||||
}
|
||||
}
|
||||
@ -1257,10 +1124,8 @@
|
||||
|
||||
if (ageDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1297,10 +1162,8 @@
|
||||
|
||||
if (siDuplicates || ageDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '6'){
|
||||
@ -1320,12 +1183,10 @@
|
||||
ageToValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < ageFromValues.length; i++) {
|
||||
for (var j = i + 1; j < ageFromValues.length; j++) {
|
||||
// Check for duplicates between age_from[] and age_to[]
|
||||
if (ageFromValues[i] === ageFromValues[j] && ageToValues[i] === ageToValues[j]) {
|
||||
console.log('Duplicate values found in age_from[] and age_to[] at indices', i, 'and', j);
|
||||
ageDuplicates = true;
|
||||
}
|
||||
}
|
||||
@ -1333,10 +1194,8 @@
|
||||
|
||||
if (ageDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '7'){
|
||||
@ -1372,10 +1231,8 @@
|
||||
|
||||
if (siDuplicates || ageDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '10'){
|
||||
@ -1412,10 +1269,8 @@
|
||||
|
||||
if (siDuplicates || ageDuplicates) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '8'){
|
||||
@ -1435,12 +1290,10 @@
|
||||
gradeValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < siValues.length; i++) {
|
||||
for (var j = i + 1; j < siValues.length; j++) {
|
||||
// Check for duplicates between si[] and grade[]
|
||||
if (siValues[i] === siValues[j] && gradeValues[i] === gradeValues[j]) {
|
||||
console.log('Duplicate values found in si[] and grade[] at indices', i, 'and', j);
|
||||
duplicatesFound = true;
|
||||
}
|
||||
}
|
||||
@ -1448,10 +1301,8 @@
|
||||
|
||||
if (duplicatesFound) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if($('#grid')[0].value === '9'){
|
||||
@ -1471,12 +1322,10 @@
|
||||
gradeValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < siValues.length; i++) {
|
||||
for (var j = i + 1; j < siValues.length; j++) {
|
||||
// Check for duplicates between si[] and grade[]
|
||||
if (siValues[i] === siValues[j] && gradeValues[i] === gradeValues[j]) {
|
||||
console.log('Duplicate values found in si[] and grade[] at indices', i, 'and', j);
|
||||
duplicatesFound = true;
|
||||
}
|
||||
}
|
||||
@ -1484,10 +1333,8 @@
|
||||
|
||||
if (duplicatesFound) {
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
console.log('Duplicates found');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}else if ($('#grid')[0].value === '11') {
|
||||
@ -1513,46 +1360,25 @@
|
||||
maxSiValues.push($(this).val());
|
||||
});
|
||||
|
||||
console.log("Checking for duplicates...");
|
||||
for (var i = 0; i < siValues.length; i++) {
|
||||
for (var j = i + 1; j < siValues.length; j++) {
|
||||
console.log(maxSiValues);
|
||||
console.log("maxSiValues[i] ", maxSiValues[i] );
|
||||
console.log("maxSiValues[j]", maxSiValues[j]);
|
||||
// console.log(maxSiValues);
|
||||
// console.log("maxSiValues[i] ", maxSiValues[i] );
|
||||
// console.log("maxSiValues[j]", maxSiValues[j]);
|
||||
if (siValues[i] === siValues[j] && gradeValues[i] === gradeValues[j] && maxSiValues[i] === maxSiValues[j]) {
|
||||
console.log('Duplicate values found in si[], grade[], and max_si[] at indices', i, 'and', j);
|
||||
duplicatesFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (duplicatesFound) {
|
||||
console.log('Duplicates found');
|
||||
toastr.warning('Duplicates found!', 'warning');
|
||||
return true;
|
||||
} else {
|
||||
console.log('No duplicates found');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
function si_or_bp_two(selectedValue =false){
|
||||
|
||||
if(selectedValue == 1){
|
||||
appendGridtHtml('1_1');
|
||||
appendGridtHtml('1_1_1');
|
||||
}else {
|
||||
appendGridtHtml('1_2');
|
||||
appendGridtHtml('1_2_1')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function basicPayMultiple(input) {
|
||||
if(input.id == 'basic_pay')
|
||||
@ -1590,23 +1416,138 @@
|
||||
$('#basic_gpa_premium').val(multi).trigger('keyup');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function gpaSumInsureMultiplier() {
|
||||
|
||||
var element = $('#multiplier')[0];
|
||||
var sumInsured = $('input[name="si[]"]');
|
||||
var premium = $('input[name="premium[]"]');
|
||||
|
||||
if ($('#si_or_bp').val() == 2) {
|
||||
var premium = $('input[name="premium[]"]');
|
||||
} else {
|
||||
var premium = $('input[name="sum_premium[]"]');
|
||||
}
|
||||
|
||||
sumInsured.each(function(index) {
|
||||
var siValue = $(this).val().replace(/,/g, '');
|
||||
var premiumValue = siValue * element.value;
|
||||
premium[index].value = Math.floor(premiumValue);
|
||||
var premiumValuedata=premium[index];
|
||||
if (premiumValuedata) {
|
||||
premiumValuedata.value = Math.floor(premiumValue);
|
||||
}
|
||||
// premium[index].value = Math.floor(premiumValue);
|
||||
$(premium[index]).trigger('keyup');
|
||||
// premium.eq(index).val(Math.floor(premiumValue));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function si_orbp_change_function() {
|
||||
var selectedValue = $('#si_or_bp').val();
|
||||
|
||||
|
||||
|
||||
if (selectedValue == 2) {
|
||||
$('#si_or_bp_full_div').css({'display':'',});
|
||||
$('#si_or_bp_sum_insure').css({'display':'none'});
|
||||
$('#si_or_bp_basic_pay').css({'display':''});
|
||||
|
||||
$('#multiplier').removeAttr('required');
|
||||
$('#gpa_si').removeAttr('required');
|
||||
$('#gpa_premium').removeAttr('required');
|
||||
|
||||
$('#basic_multiplier').attr('required', true);
|
||||
$('#premium_multiplier').attr('required', true);
|
||||
$('#basic_pay').attr('required', true);
|
||||
$('#basic_gpa_si').attr('required', true);
|
||||
$('#basic_gpa_premium').attr('required', true);
|
||||
|
||||
|
||||
var gridContentInput = $('#grid_content_input');
|
||||
|
||||
var elementsToHide = gridContentInput.find('.gpa_sum_insure_remove');
|
||||
|
||||
elementsToHide.hide();
|
||||
|
||||
|
||||
}else if(selectedValue == 1){
|
||||
$('#si_or_bp_full_div').css({'display':'',});
|
||||
$('#si_or_bp_sum_insure').css({'display':''});
|
||||
$('#si_or_bp_basic_pay').css({'display':'none'});
|
||||
|
||||
|
||||
$('#basic_multiplier').removeAttr('required');
|
||||
$('#premium_multiplier').removeAttr('required');
|
||||
$('#basic_pay').removeAttr('required');
|
||||
$('#basic_gpa_si').removeAttr('required');
|
||||
$('#basic_gpa_premium').removeAttr('required');
|
||||
|
||||
|
||||
$('#multiplier').attr('required', true);
|
||||
$('#gpa_si').attr('required', true);
|
||||
$('#gpa_premium').attr('required', true);
|
||||
|
||||
var gridContentInput = $('#grid_content_input');
|
||||
|
||||
var elementsToUnhide = gridContentInput.find('.gpa_sum_insure_remove');
|
||||
|
||||
elementsToUnhide.show();
|
||||
|
||||
}else{
|
||||
$('#si_or_bp_full_div').css({'display':'none',});
|
||||
$('#si_or_bp_sum_insure').css({'display':''});
|
||||
$('#si_or_bp_basic_pay').css({'display':''});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#gpa_si").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#gpa_si_number_word").text(result);
|
||||
} else {
|
||||
$("#gpa_si_number_word").text("");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// $("#basic_gpa_premium").on("keyup", function() {
|
||||
// var inputNumber = $(this).val();
|
||||
// if (inputNumber) {
|
||||
// var result = convertCommaNumberToWords(inputNumber);
|
||||
// $("#gpa_premium_number_word").text(result);
|
||||
// } else {
|
||||
// $("#gpa_premium_number_word").text("");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
$("#sum_insured").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#sum_insured_number_word").text(result);
|
||||
} else {
|
||||
$("#sum_insured_number_word").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#premium").on("keyup", function() {
|
||||
var inputNumber = $(this).val();
|
||||
if (inputNumber) {
|
||||
var result = convertCommaNumberToWords(inputNumber);
|
||||
$("#premium_number_word").text(result);
|
||||
} else {
|
||||
$("#premium_number_word").text("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user