FIX_RACK_RATE_CHECK_SUM_INSURED : RV
This commit is contained in:
parent
9024cc72bf
commit
8bd9f9d254
@ -247,6 +247,7 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("get_cd_ac/(:any)", "ClientController::get_cd_ac/$1");
|
||||
$routes->get("check_policy_type/(:any)", "ClientController::checkPolicyType/$1");
|
||||
$routes->get("getPolicyTerms/(:any)", "ClientController::getPolicyTerms/$1");
|
||||
$routes->get("getPolicyTermsFormJson/(:any)", "ClientController::getPolicyTermsFormJson/$1");
|
||||
});
|
||||
|
||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||
|
||||
@ -32,6 +32,8 @@ use App\Models\EmployeeModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use App\Models\NotificationModel;
|
||||
use App\Models\CDMasterModel;
|
||||
use App\Models\PolicyTypeModel;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -65,13 +67,14 @@ class ClientController extends AdminController
|
||||
protected $employeePolicyModel;
|
||||
protected $notificationModel;
|
||||
protected $CDMasterModel;
|
||||
protected $policyTypeModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
set_session_context('Client');
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
|
||||
|
||||
$this->clientModel = new ClientModel();
|
||||
$this->userModel = new UserModel();
|
||||
$this->clientBranchModel = new ClientBranchModel();
|
||||
@ -93,8 +96,10 @@ class ClientController extends AdminController
|
||||
$this->policyPremium2Model = new PolicyPremium2Model();
|
||||
$this->employeeModel = new EmployeeModel();
|
||||
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||
$this->notificationModel = new NotificationModel();
|
||||
$this->CDMasterModel = new CDMasterModel();
|
||||
$this->notificationModel = new NotificationModel();
|
||||
$this->CDMasterModel = new CDMasterModel();
|
||||
$this->policyTypeModel = new PolicyTypeModel();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2231,4 +2236,11 @@ class ClientController extends AdminController
|
||||
return $this->respond(['status' => true, 'data'=>$multi_si], 200);
|
||||
}
|
||||
|
||||
|
||||
public function getPolicyTermsFormJson($policy_type_id){
|
||||
|
||||
$JSON = $this->policyTypeModel->where('id', $policy_type_id)->first();
|
||||
return $this->respond(['status' => true, 'data' => $JSON], 200);
|
||||
}
|
||||
|
||||
}
|
||||
@ -319,7 +319,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
</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 == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" required>
|
||||
<div id='gpa_sum_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
|
||||
@ -348,7 +348,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" style="width:101%;padding: 10px;" 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="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '1' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='gpa_sum_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
@ -391,7 +391,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
|
||||
<div class="form-group col-md-3" id="" style="width:84%">
|
||||
<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 gpa_basic_si" placeholder="Enter Sum Insured" name="gpa_basic_si[]" id="gpa_basic_si_first" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required readonly>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control gpa_basic_si" placeholder="Enter Sum Insured" name="gpa_basic_si[]" id="gpa_basic_si_first" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required readonly>
|
||||
<div id='basic_gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
|
||||
@ -421,7 +421,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<input value="1" type="hidden" name="policy_type">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="gpa_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="gpa_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -442,7 +442,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}3" style="width:84%">
|
||||
<div class="form-group col-md-5">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="3_si[]" id="3_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" oninput="" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="3_si[]" id="3_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)" oninput="" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
@ -466,7 +466,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}4" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="4_si" id="4_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="4_si" id="4_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@ -501,7 +501,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}5" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="5_si[]" id="5_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="5_si[]" id="5_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -534,7 +534,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}6" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="6_si" id="6_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<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)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@ -569,7 +569,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}7" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="7_si[]" id="7_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="7_si[]" id="7_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -604,7 +604,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}8" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="8_si[]" id="8_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="8_si[]" id="8_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -633,7 +633,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<input value="1" type="hidden" name="policy_type">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="gpa_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_si" id="gpa_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -654,7 +654,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}10" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="10_si[]" id="10_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="10_si[]" id="10_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -687,7 +687,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}11" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="11_si[]" id="11_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="11_si[]" id="11_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -721,7 +721,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}12" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="12_si[]" id="12_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="12_si[]" id="12_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -759,7 +759,7 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
<div class="form-row" id="${id_var}13" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="13_si[]" id="13_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="13_si[]" id="13_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -827,11 +827,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
};
|
||||
|
||||
|
||||
$("#GridForm").submit(function(event) {
|
||||
$("#GridForm").submit(async function(event) {
|
||||
|
||||
var check = checkDuplicate(0);
|
||||
|
||||
|
||||
console.log(check)
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if ($('#grid_emp_count').val() == 'false') {
|
||||
@ -845,6 +845,7 @@ $("#GridForm").submit(function(event) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
@ -852,45 +853,63 @@ $("#GridForm").submit(function(event) {
|
||||
var policy_form_action = '<?= base_url("client/premimum/create") ?>';
|
||||
|
||||
|
||||
if (check) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
} else {
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
//console.log("Response", res);
|
||||
|
||||
if (res.status === false) {
|
||||
toastr.error('Policy Dose Not Create', 'Error');
|
||||
return;
|
||||
}
|
||||
checkPolicyTermsSI(function(result) {
|
||||
if (!result) {
|
||||
|
||||
if (check) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
var message = (policy_PrimaryKey === '') ? 'Policy Premium Added successfully' :'Policy Premium Added Successfully';
|
||||
toastr.success(message, 'Success');
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
url: policy_form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
if($('#grid').val() == 1 || $('#grid').val() == 2){
|
||||
$('.close').click();
|
||||
}
|
||||
//console.log("Response", res);
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
if (res.status === false) {
|
||||
toastr.error('Policy Dose Not Create', 'Error');
|
||||
return;
|
||||
}
|
||||
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
var message = (policy_PrimaryKey === '') ? 'Policy Premium Added successfully' :'Policy Premium Added Successfully';
|
||||
toastr.success(message, 'Success');
|
||||
|
||||
if($('#grid').val() == 1 || $('#grid').val() == 2){
|
||||
$('.close').click();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning(`Value does not exist in the Policy Terms.`);
|
||||
|
||||
}
|
||||
|
||||
}).catch(function(error) {
|
||||
console.error('Error checking policy terms:', error);
|
||||
// Handle error if necessary
|
||||
toastr.error(`Error checking policy terms: ${error}`);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@ -1552,7 +1571,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
html = `<div class="form-row gpa_sum_insure_remove" style="width:101%" 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="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si[]" id="gpa_sum_si" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
@ -1580,7 +1599,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
|
||||
<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 == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.si : '') : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="gpa_sum_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||
</div>
|
||||
|
||||
@ -1609,7 +1628,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control gpa_basic_si" placeholder="Enter Sum Insured" name="gpa_basic_si[]" id="gpa_basic_si_${Count}" onkeypress="return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required readonly>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '2' ? data.si : '') : ''}" type="text" class="form-control gpa_basic_si" placeholder="Enter Sum Insured" name="gpa_basic_si[]" id="gpa_basic_si_${Count}" onkeypress="return onlyNumbers(event)" onchange="formatNumber(this)(this)" required readonly>
|
||||
<div id='basic_gpa_si_number_word' class="text-danger-2"></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -1634,7 +1653,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-5">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="3_si[]" id="3_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="3_si[]" id="3_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this);" required>
|
||||
<div id='gpa_si_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
@ -1680,7 +1699,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="5_si[]" id="5_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="5_si[]" id="5_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -1731,7 +1750,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="7_si[]" id="7_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="7_si[]" id="7_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -1759,7 +1778,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="8_si[]" id="8_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="8_si[]" id="8_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -1783,7 +1802,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="9_si[]" id="9_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<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)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -1807,7 +1826,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="10_si[]" id="10_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="10_si[]" id="10_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -1835,7 +1854,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="11_si[]" id="11_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="11_si[]" id="11_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -1863,7 +1882,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="12_si[]" id="12_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="12_si[]" id="12_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
@ -1895,7 +1914,7 @@ function appendGridtHtml(ui_type = false, secondary = 0, data = false) {
|
||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="13_si[]" id="13_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this); checkTermsSISameAsRackRateSI(this)" required>
|
||||
<input value="${data !== false && data !== undefined && data !== '' ? data.si : ''}" type="text" class="form-control" placeholder="Enter Sum Insured" name="13_si[]" id="13_si_${Count}" onkeypress = "return onlyNumbers(event)" onchange="formatNumber(this)(this)" required>
|
||||
<div id='sum_insured_number_word_${Count}' class="text-danger-2" ></div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
@ -2917,5 +2936,126 @@ function checkTermsSISameAsRackRateSI(input) {
|
||||
}
|
||||
|
||||
|
||||
function checkPolicyTermsSI(callback) {
|
||||
|
||||
|
||||
console.log('r function called');
|
||||
|
||||
var id = $('#additional_grid')[0];
|
||||
var container = $('#additional_grid_content_input');
|
||||
|
||||
var val = 0;
|
||||
|
||||
if (val == 0) {
|
||||
id = $('#grid')[0];
|
||||
container = $('#grid_content_input');
|
||||
}
|
||||
|
||||
|
||||
console.log(id);
|
||||
console.log(container);
|
||||
|
||||
var siInputs = 0;
|
||||
|
||||
if (id.value === '2') {
|
||||
siInputs = container.find('input[name="gpa_si"]');
|
||||
} else if (id.value === '3') {
|
||||
siInputs = container.find('input[name="3_si[]"]');
|
||||
} else if (id.value === '4') {
|
||||
siInputs = container.find('input[name="4_si[]"]');
|
||||
} else if (id.value === '5') {
|
||||
siInputs = container.find('input[name="5_si[]"]');
|
||||
} else if (id.value === '6') {
|
||||
siInputs = container.find('input[name="6_si[]"]');
|
||||
} else if (id.value === '7') {
|
||||
siInputs = container.find('input[name="7_si[]"]');
|
||||
} else if (id.value === '8') {
|
||||
siInputs = container.find('input[name="8_si[]"]');
|
||||
} else if (id.value === '9') {
|
||||
siInputs = container.find('input[name="9_si[]"]');
|
||||
} else if (id.value === '10') {
|
||||
siInputs = container.find('input[name="10_si[]"]');
|
||||
} else if (id.value === '11') {
|
||||
siInputs = container.find('input[name="11_si[]"]');
|
||||
} else if (id.value === '1') {
|
||||
var selectedValue = $('#si_or_bp').val();
|
||||
|
||||
if (selectedValue == 1) {
|
||||
siInputs = container.find('input[name="gpa_sum_si[]"]');
|
||||
} else if (selectedValue == 3) {
|
||||
siInputs = container.find('input[name="gpa_sum_si2[]"]');
|
||||
}
|
||||
}
|
||||
|
||||
var client_policy_id = $('#client_policy_id').val();
|
||||
console.log('client_policy_id', client_policy_id)
|
||||
|
||||
var url = '<?php echo base_url('util/getPolicyTerms/') ?>' + client_policy_id;
|
||||
|
||||
var arrayLength = 0;
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
console.log(response.data);
|
||||
|
||||
var array1 = response.data;
|
||||
var array2 = [];
|
||||
|
||||
siInputs.each(function() {
|
||||
var input = $(this).val();
|
||||
array2.push(input.replace(/,/g, ''));
|
||||
});
|
||||
|
||||
console.log('array1', array1)
|
||||
console.log('array2', array2)
|
||||
|
||||
|
||||
function intersection(arr1, arr2) {
|
||||
return arr1.filter(value => arr2.includes(value));
|
||||
}
|
||||
|
||||
var commonElements = intersection(array1, array2);
|
||||
|
||||
function removeCommonElements(arr, common) {
|
||||
return arr.filter(value => !common.includes(value));
|
||||
}
|
||||
|
||||
array1 = removeCommonElements(array1, commonElements);
|
||||
array2 = removeCommonElements(array2, commonElements);
|
||||
|
||||
console.log('array1', array1)
|
||||
console.log('array2', array2)
|
||||
|
||||
|
||||
// var result = array1.concat(array2);
|
||||
var result = array1;
|
||||
|
||||
console.log('result', result)
|
||||
|
||||
arrayLength = result.length;
|
||||
|
||||
console.log('arrayLength', arrayLength)
|
||||
|
||||
if (arrayLength > 0) {
|
||||
callback(true);
|
||||
} else {
|
||||
callback(false);
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
toastr.error(`Failed to retrieve Policy Terms. Error: ${error}`);
|
||||
callback(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user