FIX_RACK_RATE_ISSUE : RV
This commit is contained in:
parent
0883ce592b
commit
e8382ce2e0
83
.env.sample
83
.env.sample
@ -14,13 +14,14 @@
|
||||
# ENVIRONMENT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
CI_ENVIRONMENT = development
|
||||
# CI_ENVIRONMENT = development
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# APP
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
app.baseURL = 'http://localhost/nhance/'
|
||||
app.baseURL = 'http://localhost/client_changes/nhance/'
|
||||
app.appTimezone = 'Asia/Kolkata'
|
||||
# If you have trouble with `.`, you could also use `_`.
|
||||
# app_baseURL = ''
|
||||
# app.forceGlobalSecureRequests = false
|
||||
@ -31,19 +32,74 @@ app.baseURL = 'http://localhost/nhance/'
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
|
||||
# Dev DB Connection
|
||||
|
||||
database.default.hostname = 119.18.54.85
|
||||
database.default.database = venbaehn_nhance
|
||||
database.default.username = venbaehn_nhance_user1
|
||||
database.default.password = 'iM~X7(cR+}A-'
|
||||
database.default.DBDriver = MySQLi
|
||||
database.default.DBPrefix =
|
||||
database.default.port = 3306
|
||||
|
||||
database.tests.hostname = 119.18.54.85
|
||||
database.tests.database = venbaehn_nhance
|
||||
database.tests.username = venbaehn_nhance_user1
|
||||
database.tests.password = 'iM~X7(cR+}A-'
|
||||
database.tests.DBDriver = MySQLi
|
||||
database.tests.DBPrefix =
|
||||
database.tests.port = 3306
|
||||
|
||||
# Test DB Connection
|
||||
|
||||
# database.default.hostname = 119.18.54.85
|
||||
# database.default.database = venbaehn_nhance_test
|
||||
# database.default.username = venbaehn_nhance_user1
|
||||
# database.default.password = 'iM~X7(cR+}A-'
|
||||
# database.default.DBDriver = MySQLi
|
||||
# database.default.DBPrefix =
|
||||
# database.default.port = 3306
|
||||
|
||||
database.default.hostname = 119.18.54.85
|
||||
database.default.database = venbaehn_nhance
|
||||
database.default.username = venbaehn_nhance_user1
|
||||
database.default.password = 'iM~X7(cR+}A-'
|
||||
# database.tests.hostname = 119.18.54.85
|
||||
# database.tests.database = venbaehn_nhance_test
|
||||
# database.tests.username = venbaehn_nhance_user1
|
||||
# database.tests.password = 'iM~X7(cR+}A-'
|
||||
# database.tests.DBDriver = MySQLi
|
||||
# database.tests.DBPrefix =
|
||||
# database.tests.port = 3306
|
||||
|
||||
# UAT DB Connection
|
||||
|
||||
# database.default.hostname = 119.18.54.85
|
||||
# database.default.database = venbaehn_nhance_uat
|
||||
# database.default.username = venbaehn_nhance_user1
|
||||
# database.default.password = 'iM~X7(cR+}A-'
|
||||
# database.default.DBDriver = MySQLi
|
||||
# database.default.DBPrefix =
|
||||
# database.default.port = 3306
|
||||
|
||||
# database.tests.hostname = 119.18.54.85
|
||||
# database.tests.database = venbaehn_nhance_uat
|
||||
# database.tests.username = venbaehn_nhance_user1
|
||||
# database.tests.password = 'iM~X7(cR+}A-'
|
||||
# database.tests.DBDriver = MySQLi
|
||||
# database.tests.DBPrefix =
|
||||
# database.tests.port = 3306
|
||||
|
||||
# Local PhpMyAdmin DB Connection
|
||||
|
||||
# database.default.hostname = localhost
|
||||
# database.default.database = nhance
|
||||
# database.default.username = root
|
||||
# database.default.password = ''
|
||||
# database.default.DBDriver = MySQLi
|
||||
# database.default.DBPrefix =
|
||||
# database.default.port = 3306
|
||||
|
||||
# database.tests.hostname = localhost
|
||||
# database.tests.database = nhance
|
||||
# database.tests.username = root
|
||||
# database.tests.password = ''
|
||||
# database.tests.DBDriver = MySQLi
|
||||
# database.tests.DBPrefix =
|
||||
# database.tests.port = 3306
|
||||
@ -125,12 +181,12 @@ database.default.password = 'iM~X7(cR+}A-'
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
|
||||
# session.cookieName = 'ci_session'
|
||||
# session.expiration = 7200
|
||||
session.cookieName = 'ci_session_dev'
|
||||
session.expiration = 86400
|
||||
# session.savePath = null
|
||||
# session.matchIP = false
|
||||
# session.timeToUpdate = 300
|
||||
# session.regenerateDestroy = false
|
||||
session.timeToUpdate = 300
|
||||
session.regenerateDestroy = true
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# LOGGER
|
||||
@ -151,5 +207,10 @@ database.default.password = 'iM~X7(cR+}A-'
|
||||
GOOGLE_OAUTH_APP_NAME = 'OAuth'
|
||||
GOOGLE_OAUTH_CLIENT_ID = '696241936560-m2mr272ge7vr2n4q36c22l3d2gdgi90l.apps.googleusercontent.com'
|
||||
GOOGLE_OAUTH_CLIENT_SECRET = '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'
|
||||
GOOGLE_OAUTH_REDIRECT_URI = 'http://localhost/nhance/oauth2callback'
|
||||
GOOGLE_OAUTH_REDIRECT_URI = 'http://localhost/client_changes/nhance/oauth2callback'
|
||||
GOOGLE_OAUTH_SCOPES = "https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile"
|
||||
|
||||
|
||||
App_Url = https://venbait.in/nhance/app/dev/
|
||||
POST_ENROLLMENT_APP_LINK = https://venbait.in/nhance/employee/dev/
|
||||
NHANCE_LOGO = https://venbait.in/nhance/dev/public/assets/images/Nhance_Favi.png
|
||||
@ -2161,7 +2161,8 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function getClientBranch($client_id){
|
||||
public function getClientBranch($client_id)
|
||||
{
|
||||
|
||||
$branchs = $this->clientBranchModel
|
||||
->select('*')
|
||||
|
||||
@ -1086,6 +1086,7 @@ class MasterController extends AdminController
|
||||
'insurer_id' => $data['insurer_id'],
|
||||
'description' => 'opening Amount',
|
||||
'transaction_type' => 'Credit',
|
||||
'event_name' => null,
|
||||
'updated_by' => 1,
|
||||
];
|
||||
|
||||
|
||||
@ -256,8 +256,9 @@
|
||||
console.log('client_policy_data',data)
|
||||
var role = data.role
|
||||
delete data.role;
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
// //console.log(item.open_for_enrollment);
|
||||
console.log('step 1');
|
||||
var patternGMC = /gmc/i; // Case insensitive pattern for 'gmc'
|
||||
var patternGPA = /gpa/i; // Case insensitive pattern for 'gpa'
|
||||
var subject = item.policy_type_name;
|
||||
@ -304,9 +305,7 @@
|
||||
|
||||
var policy_name_data = `${item.policy_type_name ?? ''}` + ' - ' + `${item.policy_no ?? ''}`;
|
||||
|
||||
var role = data.role;
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
policyTable += `
|
||||
<tr>
|
||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||
@ -336,7 +335,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -1254,13 +1254,15 @@
|
||||
|
||||
<!-- Jodit RTE -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var editor = new Jodit('#additionalsicknessbenefit', {
|
||||
$(document).ready(function()
|
||||
{
|
||||
var editor = new Jodit('#additionalsicknessbenefit',
|
||||
{
|
||||
buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
});
|
||||
|
||||
|
||||
var editor = new Jodit('#Wellness', {
|
||||
var editor = new Jodit('#Wellness',
|
||||
{
|
||||
buttons: 'bold,italic,underline,|,align,alignCenter,alignRight,alignJustify',
|
||||
});
|
||||
});
|
||||
@ -1270,16 +1272,15 @@
|
||||
|
||||
<!-- Policy terms Add Special Condition -->
|
||||
<script>
|
||||
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event) {
|
||||
|
||||
document.getElementById('myButtonSpecialCondition').addEventListener('click', function(event)
|
||||
{
|
||||
//console.log('specialCondition callback clicked')
|
||||
event.preventDefault();
|
||||
specialCondition();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function specialCondition(count = 0) {
|
||||
function specialCondition(count = 0)
|
||||
{
|
||||
|
||||
//console.log('specialCondition function called')
|
||||
|
||||
@ -1307,12 +1308,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).on('click', '.specialConditionClose', function() {
|
||||
$(document).on('click', '.specialConditionClose', function()
|
||||
{
|
||||
$(this)[0].parentNode.parentNode.remove();
|
||||
});
|
||||
|
||||
|
||||
// Close the Policy terms
|
||||
$(document).on('click', '#policyGMCTermsClose', function() {
|
||||
$('#policyGMCTerms').css('display', 'none');
|
||||
@ -1336,17 +1336,17 @@
|
||||
// }
|
||||
|
||||
|
||||
$('#self').change(function () {
|
||||
$('#self').change(function ()
|
||||
{
|
||||
if ($(this).prop('checked')) {
|
||||
$('.self-age').css('display','');
|
||||
}else{
|
||||
$('.self-age').css('display','none');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#spouse').change(function () {
|
||||
$('#spouse').change(function ()
|
||||
{
|
||||
if ($(this).prop('checked')) {
|
||||
$('.spouse-age').css('display','');
|
||||
if($('#spouse_min_age').val() < 17 || $('#spouse_min_age').val() == '' ){
|
||||
@ -1358,10 +1358,10 @@
|
||||
}else{
|
||||
$('.spouse-age').css('display','none');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
$('#children').change(function () {
|
||||
$('#children').change(function ()
|
||||
{
|
||||
if ($(this).val() != 0) {
|
||||
$('.child-age').css('display','');
|
||||
|
||||
@ -1374,10 +1374,10 @@
|
||||
}else{
|
||||
$('.child-age').css('display','none');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
$('#family_floaters').change(function () {
|
||||
$('#family_floaters').change(function ()
|
||||
{
|
||||
|
||||
checkAdditionPremiumJSON()
|
||||
|
||||
@ -1410,10 +1410,10 @@
|
||||
}else if(family_floaters == '4EPORPIL'){
|
||||
$('#member_count').val(4);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
function lowerIsEighteen(params) {
|
||||
function lowerIsEighteen(params)
|
||||
{
|
||||
var value = $(params).val();
|
||||
|
||||
if (value < 18) {
|
||||
@ -1423,8 +1423,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function appendGMCSIAddMore(data = null){
|
||||
function appendGMCSIAddMore(data = null)
|
||||
{
|
||||
|
||||
console.log('function called')
|
||||
|
||||
@ -1450,13 +1450,14 @@
|
||||
$('#gmc_si_add_more').append(html);
|
||||
}
|
||||
|
||||
function removeGMCAdditionalSI(button) {
|
||||
function removeGMCAdditionalSI(button)
|
||||
{
|
||||
console.log('remove clicked');
|
||||
$(button).closest('.row').remove();
|
||||
}
|
||||
|
||||
|
||||
function checkAdditionPremiumJSON(){
|
||||
function checkAdditionPremiumJSON()
|
||||
{
|
||||
|
||||
var client_id = $('#Client_id').val();
|
||||
var client_policy_id = $('#gmc_client_policy_id').val();
|
||||
@ -1469,8 +1470,8 @@
|
||||
console.log(response.data);
|
||||
|
||||
if (response.data > 0) {
|
||||
console.log('Please change the additional premium relation');
|
||||
Swal.fire("Please change the additional premium relation");
|
||||
console.log('Any changes made in the policy term for family floater, please update the rack rate configuration.');
|
||||
Swal.fire("Any changes made in the policy term for family floater, please update the rack rate configuration.");
|
||||
}
|
||||
console.log('outer');
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<h4 class="modal-title" id="myLargeModalLabel">Rack Rate <span id="PolicyNameForTitle"></span></h4>
|
||||
</div>
|
||||
<div class="col-md-5" style="position: relative;left: 20px;" id="add_new_rack_rate_tab_div">
|
||||
<button class="btn btn-info waves-effect waves-light mr-1 float-right" id="add_new_rack_rate_tab" onclick="appendNewTab()">Add Tab</button>
|
||||
<button class="btn btn-info waves-effect waves-light mr-1 float-right" id="add_new_rack_rate_tab" onclick="appendNewTab()">Add Rack Rate</button>
|
||||
</div>
|
||||
<div class="col-md-1" style="position: relative;top: 10px;">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
@ -155,7 +155,6 @@ $(document).on('click', '.close', function() {
|
||||
console.log("Tab panes removed");
|
||||
});
|
||||
|
||||
|
||||
var rarc_rate_json_array = [];
|
||||
|
||||
$(document).on('submit', 'form[id^="GridForm_"]', function(event) {
|
||||
@ -193,9 +192,9 @@ $(document).on('submit', 'form[id^="GridForm_"]', function(event) {
|
||||
|
||||
// Create FormData object
|
||||
var formData = new FormData(form[0]);
|
||||
// for (var pair of formData.entries()) {
|
||||
// console.log(pair[0] + ': ' + pair[1]);
|
||||
// }
|
||||
for (var pair of formData.entries()) {
|
||||
console.log(pair[0] + ': ' + pair[1]);
|
||||
}
|
||||
|
||||
let desiredKeys = ["self", "spouse", "childrens", "parents", "parents-in-law"];
|
||||
|
||||
@ -289,6 +288,7 @@ var client_policy_for_additional_rack_rate = '';
|
||||
var terms_si_amount_array = [];
|
||||
var unit_length = 0;
|
||||
|
||||
|
||||
$('body').on('click', '.btnPolicyModel', function()
|
||||
{
|
||||
$('#tab_content .tab-pane').not('#primary_rack_rate_tab').remove();
|
||||
@ -314,6 +314,9 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
$('#rack_rate_one').show()
|
||||
}
|
||||
|
||||
$('#rack_rate_one').click();
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("util/policy-premium") ?>',
|
||||
type: "GET",
|
||||
@ -326,7 +329,9 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
// console.log('rack rate responce.premium data parsed', JSON.parse(res.premiumData));
|
||||
|
||||
var data_for_the_rack_rate = JSON.parse(res.premiumData) ?? [];
|
||||
var groupedData = groupByRackRateName(data_for_the_rack_rate);
|
||||
var groupedData = groupByRackRateName(data_for_the_rack_rate) ?? [];
|
||||
|
||||
console.log('groupedData', groupedData)
|
||||
|
||||
if(policy_type_string == 'GMC'){
|
||||
if (res.self == "") {
|
||||
@ -363,24 +368,39 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
var premium_type_for_primary_rr = [];
|
||||
var first = 0;
|
||||
|
||||
premiumData = []
|
||||
if(policy_type_string == 'GMC'){
|
||||
$.each(groupedData, function(index, item){
|
||||
if(index !== 'Primary'){
|
||||
appendNewTab(index, item)
|
||||
}else{
|
||||
premiumData = item;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$.each(groupedData, function(index, item){
|
||||
if(index == 'Primary'){
|
||||
premiumData = item;
|
||||
}
|
||||
});
|
||||
premiumData = [];
|
||||
|
||||
try {
|
||||
if (policy_type_string == 'GMC') {
|
||||
$.each(groupedData, function(index, item) {
|
||||
if (index !== 'Primary') {
|
||||
appendNewTab(index, item);
|
||||
} else {
|
||||
premiumData = item;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.each(groupedData, function(index, item) {
|
||||
if (index == 'Primary') {
|
||||
premiumData = item;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('An error occurred:', error);
|
||||
console.error('Error Name:', error.name);
|
||||
console.error('Error Message:', error.message);
|
||||
console.error('Error Stack:', error.stack);
|
||||
|
||||
// Optional: handle the error in a user-friendly way
|
||||
console.error('An error occurred while processing the data. Please try again.');
|
||||
}
|
||||
|
||||
|
||||
console.log('premiumData for primary rack rate', premiumData);
|
||||
|
||||
|
||||
if (premiumData.length > 0) {
|
||||
if (premiumData.length > 0 && premiumData != 'undefined') {
|
||||
$.each(premiumData, function(index, item) {
|
||||
|
||||
policy_grid_id_value = item.policy_grid_id;
|
||||
@ -413,6 +433,7 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
|
||||
checkboxdata = checkboxDataObject;
|
||||
}
|
||||
console.log('before create checkbox')
|
||||
createCheckboxes(checkboxdata, additional_relationship, null, policy_type_id);
|
||||
appendGridData(res.data, policy_grid_id_value);
|
||||
if(premiumData[0]){
|
||||
@ -433,7 +454,7 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
premiumData.shift();
|
||||
$.each(premiumData, function(index, item) {
|
||||
if (item.si_or_bp == '1') {
|
||||
console.log('gpa basic pay items', item)
|
||||
console.log('gpa basic pay items', item);
|
||||
appendGridtHtml('1', null, item);
|
||||
} else {
|
||||
appendGridtHtml(item.policy_grid_id, null, item);
|
||||
@ -452,7 +473,7 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
$('#4_si').trigger('keyup');
|
||||
|
||||
$('input[name="gpa_si"]').each(function() {
|
||||
console.log('gpa_si[]', $(this));
|
||||
// console.log('gpa_si[]', $(this));
|
||||
$(this).trigger('keyup');
|
||||
});
|
||||
|
||||
@ -485,7 +506,6 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(`input[name="${first}_si[]"]`).each(function() {
|
||||
// console.log(first+'_si[]', $(this));
|
||||
$(this).trigger('keyup');
|
||||
@ -518,6 +538,8 @@ $('body').on('click', '.btnPolicyModel', function()
|
||||
|
||||
});
|
||||
|
||||
console.log(rarc_rate_json_array);
|
||||
|
||||
$(document).on('change', 'select[id^="grid_"]', function(event)
|
||||
{
|
||||
|
||||
@ -543,6 +565,7 @@ $(document).on('change', 'select[id^="grid_"]', function(event)
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('change response', res)
|
||||
|
||||
if (res.data[0].policy_type == "GPA") {
|
||||
$('#si_or_bp').val('2');
|
||||
@ -564,6 +587,8 @@ $(document).on('change', 'select[id^="grid_"]', function(event)
|
||||
});
|
||||
})
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
|
||||
$('#grid').change(function()
|
||||
{
|
||||
console.log('unit_length', unit_length)
|
||||
@ -590,6 +615,7 @@ $('#grid').change(function()
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
|
||||
console.log('change response', res)
|
||||
|
||||
if (res.data[0].policy_type == "GPA") {
|
||||
$('#si_or_bp').val('2');
|
||||
@ -616,29 +642,19 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
console.log('addGridHTML si_or_bp', si_or_bp);
|
||||
console.log('addGridHTML event', event);
|
||||
console.log('addGridHTML ui_type', ui_type);
|
||||
var secondaryValue = unique_id;
|
||||
|
||||
secondaryValue = unique_id;
|
||||
// console.log('typeof secondaryValue');
|
||||
// console.log(typeof secondaryValue);
|
||||
|
||||
// if(event.id){
|
||||
// var unique_id = event.id.split('_');
|
||||
// if (unique_id.length > 1) {
|
||||
// secondaryValue = unique_id[1];
|
||||
// secondaryValue = String(secondaryValue);
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log('unique_id', unique_id)
|
||||
// console.log('secondaryValue', secondaryValue)
|
||||
|
||||
var grid_container = document.getElementById('grid_content_input');
|
||||
// console.log(grid_container);
|
||||
console.log('step 1', grid_container);
|
||||
|
||||
if (secondaryValue != false) {
|
||||
grid_container_id = 'grid_content_input_' + secondaryValue;
|
||||
grid_container_id = 'grid_content_input_for_additional_' + secondaryValue;
|
||||
grid_container = document.getElementById(grid_container_id);
|
||||
console.log('step 2', grid_container);
|
||||
|
||||
}
|
||||
console.log('step 3', grid_container);
|
||||
|
||||
var id_var = 'grid_';
|
||||
|
||||
@ -649,8 +665,6 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
var dataIdValue = event.value;
|
||||
}
|
||||
|
||||
$(grid_container).empty();
|
||||
|
||||
if (dataIdValue == '1') {
|
||||
for (var i = 1; i <= 13; i++) {
|
||||
$('#' + id_var + i).remove();
|
||||
@ -814,8 +828,8 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
} else if (dataIdValue == '3') {
|
||||
|
||||
console.log('secondaryValue type 3 step 1', secondaryValue)
|
||||
console.log('secondaryValue type 3', secondaryValue)
|
||||
// console.log('secondaryValue type 3 step 1', secondaryValue)
|
||||
// console.log('secondaryValue type 3', secondaryValue)
|
||||
|
||||
for (var i = 1; i <= 13; i++) {
|
||||
$('#' + id_var + i).remove();
|
||||
@ -927,13 +941,13 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
grid_html = `
|
||||
<div class="form-row" id="${id_var}6" style="/*width:84%*/">
|
||||
<div class="form-group col-md-4 unitDiv">
|
||||
<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="6_si" id="6_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-4 unitDiv">
|
||||
<label for="mobile">Units<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.unit : ''}" type="text" class="form-control" placeholder="Enter Unit" name="6_unit[]" id="6_unit" required>
|
||||
</div>
|
||||
@ -1230,8 +1244,9 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
}
|
||||
|
||||
// console.log('grid_container', grid_container)
|
||||
console.log('grid_container step 4', grid_container)
|
||||
// console.log('grid_html', grid_html)
|
||||
$(grid_container).empty();
|
||||
grid_container.insertAdjacentHTML('beforeend', grid_html);
|
||||
|
||||
if (dataIdValue == '1') {
|
||||
@ -1244,7 +1259,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
// });
|
||||
}
|
||||
|
||||
if(unit_length == 1 || unit_length == 0){
|
||||
if(unit_length == 1 || unit_length == 0){
|
||||
|
||||
$('.unitDiv').hide();
|
||||
$('.unitDiv').find('input').removeAttr('required');
|
||||
@ -1280,7 +1295,7 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
// console.log('container', container);
|
||||
|
||||
if (secondary != false && secondary != 'false' && secondary != null && secondary != 'null') {
|
||||
container_id = 'grid_content_input_' + secondary;
|
||||
container_id = 'grid_content_input_for_additional_' + secondary;
|
||||
console.log('container', container_id);
|
||||
container = document.getElementById(container_id);
|
||||
console.log('container', container);
|
||||
@ -1568,16 +1583,16 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
<div class="form-row" id="removeChild_${Count}" style="/*width:84%*/">
|
||||
<div class="form-group col-md-4 unitDiv">
|
||||
<label for="mobile">Units<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.unit : ''}" type="text" class="form-control" placeholder="Enter unit" name="unit" id="9_unit_${Count}" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.unit : ''}" type="text" class="form-control" placeholder="Enter unit" name="gpa_unit" id="9_unit_${Count}" required>
|
||||
</div>
|
||||
<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="9_si[]" id="9_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="9_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' 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="9_premium[]" id="9_premium_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="gpa_premium" id="9_premium_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='premium_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
</div>`;
|
||||
@ -1712,7 +1727,7 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
<option value="father" ${data !== false && data !== undefined && data !== '' && data.relationship === 'father' ? 'selected' : ''}>Father</option>
|
||||
<option value="mother" ${data !== false && data !== undefined && data !== '' && data.relationship === 'mother' ? 'selected' : ''}>Mother</option>
|
||||
<option value="father-in-law" ${data !== false && data !== undefined && data !== '' && data.relationship === 'father-in-law' ? 'selected' : ''}>Father in Law</option>
|
||||
<option value="mother-in-law" ${dappendGridtHtmlata !== false && data !== undefined && data !== '' && data.relationship === 'mother-in-law' ? 'selected' : ''}>Mother in Law</option>
|
||||
<option value="mother-in-law" ${data !== false && data !== undefined && data !== '' && data.relationship === 'mother-in-law' ? 'selected' : ''}>Mother in Law</option>
|
||||
<option value="child" ${data !== false && data !== undefined && data !== '' && data.relationship === 'child' ? 'selected' : ''}>Child</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -1761,10 +1776,11 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
|
||||
}
|
||||
|
||||
|
||||
function removebutton(index, type)
|
||||
{
|
||||
|
||||
console.log('remove button function called')
|
||||
|
||||
if (index == 0) {
|
||||
var inputs = document.querySelectorAll('#grid_' + type + ' input');
|
||||
inputs.forEach(function(input) {
|
||||
@ -1803,7 +1819,7 @@ function checkDuplicate(unique_id = null)
|
||||
|
||||
if (unique_id) {
|
||||
id = $('#grid_'+unique_id)[0];
|
||||
container = $('#grid_content_input_'+unique_id);
|
||||
container = $('#grid_content_input_for_additional_'+unique_id);
|
||||
|
||||
console.log('checkDuplicate id 2', id);
|
||||
console.log('checkDuplicate container 2', container);
|
||||
@ -2580,8 +2596,8 @@ function getCurrentTime()
|
||||
|
||||
function createCheckboxes(obj, additional_relationship = [], unique_id = null, policy_type = null)
|
||||
{
|
||||
console.log('object', obj);
|
||||
console.log('additional_relationship', additional_relationship);
|
||||
console.log('createCheckboxes function object', obj);
|
||||
console.log('createCheckboxes function additional_relationship', additional_relationship);
|
||||
|
||||
if (typeof additional_relationship === 'string') {
|
||||
additional_relationship = JSON.parse(additional_relationship);
|
||||
@ -2658,6 +2674,7 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
}
|
||||
|
||||
if (obj['childrens'] > 0) {
|
||||
|
||||
let childrensValue = additional_relationship['childrens'] || 'NA';
|
||||
|
||||
html += `
|
||||
@ -2763,86 +2780,11 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function formatString(str)
|
||||
{
|
||||
return str.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
||||
}
|
||||
|
||||
$('#del_btn').click(function()
|
||||
{
|
||||
//console.log('delete btn clicked');
|
||||
|
||||
Swal.fire({
|
||||
title: "Are you sure?",
|
||||
text: "You need to Delete this!",
|
||||
icon: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Yes",
|
||||
}).then((result) => {
|
||||
//console.log('after then entered');
|
||||
|
||||
if (result.isConfirmed) {
|
||||
//console.log('isConfirmed entered');
|
||||
|
||||
var client_policy_id = $('#client_policy_id_2').val();
|
||||
//console.log('client_policy_id', client_policy_id)
|
||||
|
||||
var rack_rate_type = $('#rack_rate_type_2').val();
|
||||
//console.log('rack_rate_type', rack_rate_type)
|
||||
|
||||
var client_id = $('#Client_id_2').val();
|
||||
//console.log('client_id', client_id)
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/delete-additional-rack-rate/'); ?>' + client_id + '/' + client_policy_id + '/' + rack_rate_type,
|
||||
type: 'GET',
|
||||
success: function(res) {
|
||||
|
||||
//console.log('ajax success entered');
|
||||
//console.log(res);
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
if (res.status === true) {
|
||||
|
||||
$('#additional_grid_content_input').empty();
|
||||
$('#additional_grid').val('');
|
||||
$('#individual_2').prop('checked', true)
|
||||
$('#single_2').prop('checked', false)
|
||||
$('input[type="checkbox"]').prop('checked', false);
|
||||
|
||||
|
||||
toastr.success(res.message, 'Success');
|
||||
|
||||
} else if (res.status === false) {
|
||||
toastr.warning(res.message, 'Warning');
|
||||
return;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
//console.log('ajax error entered');
|
||||
console.error(xhr.responseText);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
|
||||
// Removed the duplicated loader hiding code here
|
||||
}
|
||||
|
||||
//console.log('after then entered end or cancel');
|
||||
});
|
||||
|
||||
//console.log('delete btn clicked end');
|
||||
});
|
||||
|
||||
function checkCheckboxes()
|
||||
{
|
||||
|
||||
@ -2916,7 +2858,7 @@ function checkPolicyTermsSI(unique_id = null)
|
||||
|
||||
if (unique_id) {
|
||||
id = $('#grid_'+unique_id)[0];
|
||||
container = $('#grid_content_input_'+unique_id);
|
||||
container = $('#grid_content_input_for_additional_'+unique_id);
|
||||
}
|
||||
|
||||
console.log(id);
|
||||
@ -3018,6 +2960,9 @@ function checkPolicyTermsSI(unique_id = null)
|
||||
function appendNewTab(tabNameData = null, data = null)
|
||||
{
|
||||
console.log('appendNewTab function called');
|
||||
console.log('tabNameData', tabNameData);
|
||||
console.log('data', data);
|
||||
|
||||
let tabName = tabNameData;
|
||||
|
||||
if(tabNameData == null){
|
||||
@ -3049,6 +2994,7 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
newTabLink.classList.add('nav-link', 'nav-link', 'px-3', 'py-2');
|
||||
newTabLink.setAttribute('data-toggle', 'tab');
|
||||
newTabLink.setAttribute('href', `#${tabId}`);
|
||||
newSpan.setAttribute('id', `link_${tabId}`);
|
||||
// newTabLink.textContent = tabName;
|
||||
newTabLink.appendChild(newSpan);
|
||||
|
||||
@ -3101,7 +3047,7 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
<a href="#" id="copyfromexcel_${tabId}" onclick="copyFromExcel(this, '${tabId}')">Copy from excel</a>
|
||||
<hr>
|
||||
|
||||
<div class="form-row" id="grid_content_input_${tabId}" style="display: true;">
|
||||
<div class="form-row" id="grid_content_input_for_additional_${tabId}" style="display: true;">
|
||||
</div>
|
||||
|
||||
|
||||
@ -3129,14 +3075,20 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
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;
|
||||
|
||||
// data.shift();
|
||||
$.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);
|
||||
});
|
||||
// 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);
|
||||
});
|
||||
// }
|
||||
}
|
||||
|
||||
appendGridData(rack_rate_array, policy_grid_id, tabId);
|
||||
@ -3145,14 +3097,18 @@ function appendNewTab(tabNameData = null, data = null)
|
||||
hideShowSubmitButton(employee_count, tabId);
|
||||
editPolicyPremiumCalculationSetValue(premium_type, tabId);
|
||||
|
||||
if(data == null){
|
||||
$('#link_'+tabId).click();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function appendGridData(data, policy_grid_id_value = null, unique_id = null)
|
||||
{
|
||||
console.log('policy_grid_id_value', policy_grid_id_value)
|
||||
console.log(data)
|
||||
{
|
||||
console.log('appendGridData function called');
|
||||
console.log('appendGridData policy_grid_id_value', policy_grid_id_value)
|
||||
console.log('appendGridData data', data)
|
||||
|
||||
var rack_rate_id = $('#grid');
|
||||
|
||||
@ -3256,7 +3212,7 @@ function copyFromExcel(input, unique_id = null)
|
||||
var grid_content_from_excel = $('#grid_content_from_excel');
|
||||
|
||||
if(unique_id){
|
||||
grid_content_input = $('#grid_content_input_'+unique_id);
|
||||
grid_content_input = $('#grid_content_input_for_additional_'+unique_id);
|
||||
grid_content_from_excel = $('#grid_content_from_excel_'+unique_id);
|
||||
}
|
||||
|
||||
@ -3317,56 +3273,46 @@ function editPolicyPremiumCalculationSetValue(premium_type, unique_id = null)
|
||||
if(unique_id){
|
||||
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 1');
|
||||
|
||||
|
||||
if (premium_type === '2') {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 2');
|
||||
|
||||
$('#individual_'+unique_id).prop('checked', true);
|
||||
$('#single_'+unique_id).prop('checked', false);
|
||||
|
||||
} else if (premium_type === '1') {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 3');
|
||||
|
||||
$('#single_'+unique_id).prop('checked', true);
|
||||
$('#individual_'+unique_id).prop('checked', false);
|
||||
|
||||
} else {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 4');
|
||||
|
||||
$('#single_'+unique_id).prop('checked', false);
|
||||
$('#individual_'+unique_id).prop('checked', true);
|
||||
|
||||
}
|
||||
}else{
|
||||
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 5');
|
||||
|
||||
if (premium_type === '2') {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 6');
|
||||
|
||||
$('#individual').prop('checked', true);
|
||||
$('#single').prop('checked', false);
|
||||
|
||||
} else if (premium_type === '1') {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 7');
|
||||
|
||||
$('#single').prop('checked', true);
|
||||
$('#individual').prop('checked', false);
|
||||
|
||||
} else {
|
||||
// console.log('editPolicyPremiumCalculationSetValue step 8');
|
||||
|
||||
$('#single').prop('checked', false);
|
||||
$('#individual').prop('checked', true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function hideUnitFieldInABranchHaveSingleUnit()
|
||||
{
|
||||
$('input[name="11_max_si[]"]').each(function() {
|
||||
$(this)
|
||||
});
|
||||
}
|
||||
|
||||
function checkFamiliFloatersKeysDuplicate(rarc_rate_json_array, formObject)
|
||||
{
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user