FIX_DEFAULT_TERMS_FOR_EDLI,GDLI

This commit is contained in:
Srinivas-Saravanan 2025-05-30 17:13:46 +05:30
parent 6629f61895
commit 22a97d335d

View File

@ -87,25 +87,24 @@ label {
<input type="hidden" name="client_policy_id" id="other_client_policy_id" />
<input type="hidden" name="policy_id" id="gpa_policy_id" />
<input type="hidden" id="emp_count" />
<div class="row" style="margin-bottom: 10px;">
<div id="sumInsuredDiv">
<div class="col-md-6">
<label for="sumInsured">Sum Insured</label>
<div id="sumInsuredDiv" class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="sumInsured">Sum Insured</label>
</div>
<div class="col-md-4">
<input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
</div>
<div class="col-md-4">
<input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
</div>
<div class="col-md-6">
</div>
<div class="col-md-6">
<div id='numberToWordOthers' class="text-danger-2" ></div>
<div class="col-md-6">
</div>
<div class="col-md-6">
<div id='numberToWordOthers' class="text-danger-2" ></div>
</div>
</div>
<div id="sum_insured_add_more" ></div>
</div>
</div>
<div style="margin-top: 10px;margin-bottom:15px;" id="sum_insured_add_more" ></div>
<div id="append_html_for_other_policy_terms"></div>
<hr>
@ -208,6 +207,7 @@ $("#otherPolicyTerms").submit(function(event) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
}, 1000);
location.reload();
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
@ -240,7 +240,6 @@ $('body').on('click', '.btnPolicyMaster', function() {
$('#other_client_policy_id').val(client_policy_id);
// appendPolicyTermsHTML(policy_type_id);
var gpa_policy_type_id = $(this).attr('id');
// console.log('gpa_policy_type_id', gpa_policy_type_id)
@ -285,7 +284,7 @@ $('body').on('click', '.btnPolicyMaster', function() {
}
if (res) {
if (res.data) {
//special conditions fields
let otherTermsJsonObjectSpecialCondition = JSON.parse(res.data);
@ -320,7 +319,7 @@ $('body').on('click', '.btnPolicyMaster', function() {
}
if (!key.startsWith("special_condition") && !key.startsWith("sum_insured") && !key.startsWith("enrollment_display_key") ) {
if (!key.startsWith("special_condition") && !key.startsWith('multiple_sum_insured') && !key.startsWith("sum_insured") && !key.startsWith("enrollment_display_key") ) {
termsHTML = `
<div class="row" style="margin-bottom: 10px;">
@ -400,6 +399,10 @@ $('body').on('click', '.btnPolicyMaster', function() {
});
} else {
appendPolicyTermsHTML(policy_type_id);
}
@ -523,208 +526,209 @@ function appendPolicyTermsHTML(policy_type) {
var termsHTML = ""
$('#append_html_for_other_policy_terms').empty();
// if (policy_type == 7) {
if (policy_type == 7) {
// termsHTML = `
// <div class="form-group">
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="sumInsured">Sum Insured</label>
// </div>
// <div class="col-md-4">
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
// </div>
// <div class="col-md-2" style="position: relative;left: 88px;">
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
// </div>
// <div class="col-md-6">
// </div>
// <div class="col-md-6">
// <div id='numberToWordOthers' class="text-danger-2" ></div>
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="sumInsured">Sum Insured</label>
// </div>
// <div class="col-md-4">
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
// </div>
// <div class="col-md-2" style="position: relative;left: 88px;">
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
// </div>
// <div class="col-md-6">
// </div>
// <div class="col-md-6">
// <div id='numberToWordOthers' class="text-danger-2" ></div>
// </div>
// </div>
// <div id="sum_insured_add_more" ></div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="totalSumInsured">Policy Type</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="policy_type" id="policy_type" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="totalSumInsured">Existing Insurer</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="renewal_lives">Renewal Lives</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="totalSumInsured">Total Sum Assured</label>
// </div>
// <div class="col-md-6">
// <input type="text" style="width: 100% !important;" class="form-control" name="total_sum_insured"
// id="total_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
// </div>
// <div class="col-md-6">
// </div>
// <div class="col-md-6">
// <div id='numberToWordTotalSumInsured' class="text-danger-2"></div>
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="lives_at_inception">Lives at Inception</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="totalSumInsured">Total Sum Insured at Inception</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
// class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="totalSumInsured">Premium at Inception (Excl GST)</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="premium_at_inception" id="premium_at_inception" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="coverage">Coverage</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="coverage " id="coverage" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="free_cover_limit">Free Cover Limit</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="free_cover_limit" id="free_cover_limit" class="form-control">
// </div>
// </div>
// </div>
// <div id="sum_insured_add_more" ></div>
termsHTML = `
// `
<div class="form-group">
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="totalSumInsured">Policy Type</label>
</div>
<div class="col-md-6">
<input type="text" name="policy_type" id="policy_type" class="form-control">
</div>
</div>
// } else if (policy_type == 6) {
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="totalSumInsured">Existing Insurer</label>
</div>
<div class="col-md-6">
<input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
</div>
</div>
// termsHTML = `
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="renewal_lives">Renewal Lives</label>
</div>
<div class="col-md-6">
<input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="totalSumInsured">Total Sum Assured</label>
</div>
<div class="col-md-6">
<input type="text" style="width: 100% !important;" class="form-control" name="total_sum_insured"
id="total_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
</div>
<div class="col-md-6">
</div>
<div class="col-md-6">
<div id='numberToWordTotalSumInsured' class="text-danger-2"></div>
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="lives_at_inception">Lives at Inception</label>
</div>
<div class="col-md-6">
<input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="totalSumInsured">Total Sum Insured at Inception</label>
</div>
<div class="col-md-6">
<input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="totalSumInsured">Premium at Inception (Excl GST)</label>
</div>
<div class="col-md-6">
<input type="text" name="premium_at_inception" id="premium_at_inception" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="coverage">Coverage</label>
</div>
<div class="col-md-6">
<input type="text" name="coverage " id="coverage" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="free_cover_limit">Free Cover Limit</label>
</div>
<div class="col-md-6">
<input type="text" name="free_cover_limit" id="free_cover_limit" class="form-control">
</div>
</div>
</div>
// <div class="form-group EDLI">
`
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="sumInsured">Sum Insured</label>
// </div>
// <div class="col-md-4" >
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
// </div>
// <div class="col-md-2" style="position: relative;left: 88px;">
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
// </div>
// <div class="col-md-6">
// </div>
// <div class="col-md-6">
// <div id='numberToWordOthers' class="text-danger-2" ></div>
// </div>
// </div>
} else if (policy_type == 6) {
// <div id="sum_insured_add_more" ></div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="totalSumInsured">Existing Insurer</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="renewal_lives">Renewal Lives</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="lives_at_inception">Lives at Inception</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="totalSumInsured">Total Sum Insured at Inception</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
// class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="coverage">Coverage</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="coverage " id="coverage" class="form-control">
// </div>
// </div>
// <div class="row" style="margin-bottom: 10px;display:true;">
// <div class="col-md-6">
// <label for="free_cover_limit">Free Cover Limit for Base Cover</label>
// </div>
// <div class="col-md-6">
// <input type="text" name="free_cover_limit_for_base_cover" id="free_cover_limit_for_base_cover" class="form-control">
// </div>
// </div>
// </div>
// `
// }
// <div class="row" style="margin-bottom: 10px;">
// <div class="col-md-6">
// <label for="sumInsured">Sum Insured</label>
// </div>
// <div class="col-md-4" >
// <input style="width: 128%;" type="text" name="sum_insureds" id="sum_insured_others" class="form-control" onkeypress = "return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word2(this)">
// </div>
// <div class="col-md-2" style="position: relative;left: 88px;">
// <button type="button" class="btn btn-primary si-add-more" onclick="appendOtherSIAddMore()">+</button>
// </div>
// <div class="col-md-6">
// </div>
// <div class="col-md-6">
// <div id='numberToWordOthers' class="text-danger-2" ></div>
// </div>
// </div>
// <div id="sum_insured_add_more" ></div>
termsHTML = `
<div class="form-group EDLI">
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="totalSumInsured">Existing Insurer</label>
</div>
<div class="col-md-6">
<input type="text" name="existing_insurer" id="existing_insurer" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-6">
<label for="renewal_lives">Renewal Lives</label>
</div>
<div class="col-md-6">
<input type="text" name="renewal_lives" id="renewal_lives" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="lives_at_inception">Lives at Inception</label>
</div>
<div class="col-md-6">
<input type="text" name="lives_at_inception" id="lives_at_inception" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="totalSumInsured">Total Sum Insured at Inception</label>
</div>
<div class="col-md-6">
<input type="text" name="total_sum_insured_at_inception" id="total_sum_insured_at_inception"
class="form-control" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="coverage">Coverage</label>
</div>
<div class="col-md-6">
<input type="text" name="coverage " id="coverage" class="form-control">
</div>
</div>
<div class="row" style="margin-bottom: 10px;display:true;">
<div class="col-md-6">
<label for="free_cover_limit">Free Cover Limit for Base Cover</label>
</div>
<div class="col-md-6">
<input type="text" name="free_cover_limit_for_base_cover" id="free_cover_limit_for_base_cover" class="form-control">
</div>
</div>
</div>
`
}
$('#append_html_for_other_policy_terms').append(termsHTML);
}
@ -734,10 +738,12 @@ function appendOtherSIAddMore(data = null) {
const addMoreContainer = document.getElementById('sum_insured_add_more');
// addMoreContainer.innerHTML = ''; // Clear previous content if needed
console.log(addMoreContainer)
const html = `
<div class="row" style="margin-bottom: 10px;">
<div class="row">
<div class="col-md-6">
<label for="sumInsured">Additional Sum Insured</label>
</div>