MERGE_FIXES
This commit is contained in:
commit
0a0ed067db
@ -609,7 +609,7 @@ class ClientController extends AdminController
|
|||||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||||
$data['policy_status'] = 1;
|
$data['policy_status'] = 1;
|
||||||
$data['inception_type'] = $this->request->getPost('inception_type') ? 1 : 2;
|
$data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -701,7 +701,7 @@ class ClientController extends AdminController
|
|||||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||||
$data['base_policy'] = $this->request->getPost('base_policy');
|
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||||
$data['policy_status'] = 1;
|
$data['policy_status'] = 1;
|
||||||
$data['inception_type'] = $this->request->getPost('inception_type') ? 1 : 2;
|
$data['inception_type'] = $this->request->getPost('inception_type') ? 2 : 1;
|
||||||
|
|
||||||
|
|
||||||
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
$policy_terms = $this->clientPolicyModel->where('id', $this->request->getPost('base_policy'))->first();
|
||||||
@ -1532,14 +1532,17 @@ class ClientController extends AdminController
|
|||||||
{
|
{
|
||||||
|
|
||||||
$client_policy_id = $this->request->getGet('client_policy_id');
|
$client_policy_id = $this->request->getGet('client_policy_id');
|
||||||
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
|
||||||
$message = 'Policy updated Successfully';
|
$message = 'Policy updated Successfully';
|
||||||
|
|
||||||
|
|
||||||
|
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
|
||||||
|
|
||||||
if ($record['open_for_enrollment'] == 0) {
|
if ($record['open_for_enrollment'] == 0) {
|
||||||
$open_for_enrollment_update_value = 1;
|
$open_for_enrollment_update_value = 1;
|
||||||
$message = 'Update Open Enrollment Successfully';
|
$message = 'Enrollment Opened Successfully';
|
||||||
} else if ($record['open_for_enrollment'] == 1) {
|
} else if ($record['open_for_enrollment'] == 1) {
|
||||||
$open_for_enrollment_update_value = 0;
|
$open_for_enrollment_update_value = 0;
|
||||||
$message = 'Update Open Enrollment Successfully';
|
$message = 'Enrollment Closed Successfully';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
|
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
|
||||||
@ -1589,7 +1592,8 @@ class ClientController extends AdminController
|
|||||||
return $this->respond(['status' => false, 'code' => 200, 'message' => 'Please define policy premium'], 200);
|
return $this->respond(['status' => false, 'code' => 200, 'message' => 'Please define policy premium'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
$policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
|
// $policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
|
||||||
|
|
||||||
$json_data = '';
|
$json_data = '';
|
||||||
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id)->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
|
$open_for_enrollment = $this->clientPolicyModel->where('id', $client_policy_id)->set('open_for_enrollment', $open_for_enrollment_update_value)->update();
|
||||||
if ($open_for_enrollment) {
|
if ($open_for_enrollment) {
|
||||||
@ -1600,8 +1604,9 @@ class ClientController extends AdminController
|
|||||||
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
|
$json_data = json_encode(['open_for_enrollment' => $open_for_enrollment_value, 'client_policy_id' => $client_policy_id_value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->respond(['status' => true,'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data], 200);
|
|
||||||
|
|
||||||
|
|
||||||
|
return $this->respond(['status' => true, 'code' => 200, 'message' => $message, 'data' => $termsData, 'racRate' => $racRate, 'open_for_enrollment' => $json_data, 'client_policy_data' => $record], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|||||||
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
use PhpOffice\PhpSpreadsheet\Reader\Exception as SpreadsheetReaderException;
|
use PhpOffice\PhpSpreadsheet\Reader\Exception as SpreadsheetReaderException;
|
||||||
|
use PhpParser\Node\Expr\Cast\Double;
|
||||||
|
|
||||||
use function PHPUnit\Framework\returnSelf;
|
use function PHPUnit\Framework\returnSelf;
|
||||||
|
|
||||||
@ -109,7 +110,10 @@ class EmpDataServiceController extends BaseController
|
|||||||
// Fetch employee data for export from the database
|
// Fetch employee data for export from the database
|
||||||
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
|
$objects = $this->employeePolicyModel->getInceptionEmployeeDataForExportExcel($export_data);
|
||||||
|
|
||||||
// dd($objects);
|
$insurer_id = $this->clientPolicyModel->where('id', $export_data['client_policy_id'])->first();
|
||||||
|
|
||||||
|
$cash_balance = $this->clientDepositModel->where('client_id',$export_data['client_id'] )->where('insurer_id', $insurer_id['insurer_id'])->orderBy('id', 'DESC')->first();
|
||||||
|
|
||||||
|
|
||||||
$totals = 0;
|
$totals = 0;
|
||||||
foreach ($objects as $key => $value) {
|
foreach ($objects as $key => $value) {
|
||||||
@ -117,6 +121,11 @@ class EmpDataServiceController extends BaseController
|
|||||||
$totals += $value->total;
|
$totals += $value->total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((int) $cash_balance['balance'] < (int) $totals){
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Log the count of exported data
|
// Log the count of exported data
|
||||||
$count = count($objects);
|
$count = count($objects);
|
||||||
|
|||||||
@ -345,7 +345,15 @@ class EmployeeController extends AdminController
|
|||||||
if ($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition') {
|
if ($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition') {
|
||||||
|
|
||||||
$return = $empDataServiceController->generateExcelForAdditionandInception($batch_data);
|
$return = $empDataServiceController->generateExcelForAdditionandInception($batch_data);
|
||||||
|
|
||||||
|
if($return == 0){
|
||||||
|
|
||||||
|
session()->setFlashdata('error', "The insurer has an insufficient deposit amount.");
|
||||||
|
return redirect()->to(base_url('employee/upload'));
|
||||||
|
}
|
||||||
|
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
|
|
||||||
if ($insurer_or_tpa == 'tpa') {
|
if ($insurer_or_tpa == 'tpa') {
|
||||||
session()->setFlashdata('error', "No data was found for this action. The TPA ID has already been updated.");
|
session()->setFlashdata('error', "No data was found for this action. The TPA ID has already been updated.");
|
||||||
return redirect()->to(base_url('employee/upload'));
|
return redirect()->to(base_url('employee/upload'));
|
||||||
@ -353,6 +361,7 @@ class EmployeeController extends AdminController
|
|||||||
session()->setFlashdata('error', "No data was found for this action. The UHID has already been updated.");
|
session()->setFlashdata('error', "No data was found for this action. The UHID has already been updated.");
|
||||||
return redirect()->to(base_url('employee/upload'));
|
return redirect()->to(base_url('employee/upload'));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->myLogger->logme('error', 'Successfully exported Excel file in {data}.', ['data' => $event_type]);
|
$this->myLogger->logme('error', 'Successfully exported Excel file in {data}.', ['data' => $event_type]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
<th>Policy</th>
|
<th>Policy</th>
|
||||||
<th>TPA</th>
|
<th>TPA</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
|
<th>Enrollment Status</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -246,8 +247,28 @@
|
|||||||
} else {
|
} else {
|
||||||
search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
||||||
}
|
}
|
||||||
|
// console.log('search_term :', search_term)
|
||||||
|
|
||||||
|
var enrollmentStatus = '';
|
||||||
|
if(item.inception_type == 1){
|
||||||
|
|
||||||
|
enrollmentStatus = 'N/A'
|
||||||
|
|
||||||
|
}else if(item.inception_type == 2){
|
||||||
|
|
||||||
|
if(item.open_for_enrollment == 1){
|
||||||
|
|
||||||
|
enrollmentStatus = '<a href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll" data-toggle="tooltip" data-placement="left" title="Click To Close Enrollment">Open</a>'
|
||||||
|
|
||||||
|
|
||||||
|
}else if(item.open_for_enrollment == 0){
|
||||||
|
|
||||||
|
enrollmentStatus = '<a href="#" data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
console.log('search_term :', search_term)
|
|
||||||
|
|
||||||
policyTable += `
|
policyTable += `
|
||||||
<tr>
|
<tr>
|
||||||
@ -255,6 +276,7 @@
|
|||||||
<td>${item.policy_name} (${item.policy_type_name})</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
||||||
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||||
|
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
@ -263,15 +285,6 @@
|
|||||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
||||||
`;
|
|
||||||
if (item.open_for_enrollment == 0) {
|
|
||||||
policyTable +=
|
|
||||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
|
||||||
} else {
|
|
||||||
policyTable +=
|
|
||||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
|
||||||
}
|
|
||||||
policyTable += `
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -389,7 +402,27 @@
|
|||||||
subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('search_term :', search_term)
|
// console.log('search_term :', search_term)
|
||||||
|
|
||||||
|
var enrollmentStatus = '';
|
||||||
|
if(item.inception_type == 1){
|
||||||
|
|
||||||
|
enrollmentStatus = 'N/A'
|
||||||
|
|
||||||
|
}else if(item.inception_type == 2){
|
||||||
|
|
||||||
|
if(item.open_for_enrollment == 1){
|
||||||
|
|
||||||
|
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Open</a>'
|
||||||
|
|
||||||
|
|
||||||
|
}else if(item.open_for_enrollment == 0){
|
||||||
|
|
||||||
|
enrollmentStatus = '<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="'+ item.id +'" id="' + item.policy_id + '" class="btnOpenEnroll">Closed</a>'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
policyTable += `
|
policyTable += `
|
||||||
<tr>
|
<tr>
|
||||||
@ -397,6 +430,7 @@
|
|||||||
<td>${item.policy_name} (${item.policy_type_name})</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
||||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||||
|
<td style="text-align: center;">${(enrollmentStatus)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
@ -405,15 +439,6 @@
|
|||||||
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
<a href="#" data-id="${item.id}" id="${search_term}" class="dropdown-item btnPolicyMaster" data-toggle="modal"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
|
||||||
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rack Rate</a>
|
||||||
`;
|
|
||||||
if (item.open_for_enrollment == 0) {
|
|
||||||
policyTable +=
|
|
||||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
|
||||||
} else {
|
|
||||||
policyTable +=
|
|
||||||
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
|
||||||
}
|
|
||||||
policyTable += `
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -549,13 +574,21 @@
|
|||||||
// appendPolicyFormFields(2);
|
// appendPolicyFormFields(2);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if($('#policy_type').val() == 1){
|
||||||
|
|
||||||
|
console.log('step 1')
|
||||||
|
|
||||||
if (dataId == 3) {
|
if (dataId == 3) {
|
||||||
|
|
||||||
|
console.log('step 2')
|
||||||
|
|
||||||
var displayStatus = $('#base_policy_id').css('display');
|
var displayStatus = $('#base_policy_id').css('display');
|
||||||
$('#base_policy_id').show();
|
$('#base_policy_id').show();
|
||||||
$('#base_policy').prop('required', true);
|
$('#base_policy').prop('required', true);
|
||||||
|
|
||||||
if (displayStatus === 'none') {
|
if (displayStatus === 'none') {
|
||||||
|
console.log('step 2.1')
|
||||||
|
|
||||||
$('#base_policy').val('').change();
|
$('#base_policy').val('').change();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,14 +596,19 @@
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
console.log('step 3')
|
||||||
|
|
||||||
var displayStatus = $('#base_policy_id').css('display');
|
var displayStatus = $('#base_policy_id').css('display');
|
||||||
$('#base_policy_id').hide();
|
$('#base_policy_id').hide();
|
||||||
$('#base_policy').prop('required', false);
|
$('#base_policy').prop('required', false);
|
||||||
|
|
||||||
if (displayStatus === 'none') {
|
if (displayStatus === 'none') {
|
||||||
|
console.log('step 3.1')
|
||||||
|
|
||||||
$('#base_policy').val('').change();
|
$('#base_policy').val('').change();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -621,7 +659,7 @@
|
|||||||
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
||||||
$('#policy_status_field').show();
|
$('#policy_status_field').show();
|
||||||
|
|
||||||
if (res.data.inception_type == 1) {
|
if (res.data.inception_type == 2) {
|
||||||
$('#inception_type').prop('checked', true);
|
$('#inception_type').prop('checked', true);
|
||||||
} else {
|
} else {
|
||||||
$('#inception_type').prop('checked', false);
|
$('#inception_type').prop('checked', false);
|
||||||
@ -648,7 +686,28 @@
|
|||||||
$('#base_policy').prop('required', false);
|
$('#base_policy').prop('required', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(res.data.is_addon == 1 && res.data.base_policy > 0){
|
||||||
|
|
||||||
|
// $("#insurer").next(".select2-container").css({
|
||||||
|
// 'pointer-events': 'none',
|
||||||
|
// });
|
||||||
|
// $('#select2-insurer-container').css({
|
||||||
|
// 'background-color': '#ebebe0',
|
||||||
|
// });
|
||||||
|
|
||||||
|
// $("#tpa").next(".select2-container").css({
|
||||||
|
// 'pointer-events': 'none',
|
||||||
|
// });
|
||||||
|
// $('#select2-tpa-container').css({
|
||||||
|
// 'background-color': '#ebebe0',
|
||||||
|
// });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||||
|
|
||||||
$("#insurer").next(".select2-container").css({
|
$("#insurer").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'none',
|
||||||
});
|
});
|
||||||
@ -693,14 +752,17 @@
|
|||||||
$.each(res.client_policy_list, function(index, item) {
|
$.each(res.client_policy_list, function(index, item) {
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id +
|
OptionsHTML += '<option data-id="' + item.policy_type_id +
|
||||||
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
|
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
|
||||||
'selected="selected"' : '') + '>' + item.name + '</option>';
|
'selected="selected"' : '') + '>' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||||
});
|
});
|
||||||
$('#base_policy').html(OptionsHTML);
|
$('#base_policy').html(OptionsHTML);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('#policy').val(res.data.policy_id).change();
|
$('#policy').val(res.data.policy_id).change();
|
||||||
|
$('#base_policy').val(res.data.base_policy);
|
||||||
|
$('#base_policy').change();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
@ -719,18 +781,22 @@
|
|||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: "Are you sure?",
|
title: "Are you sure?",
|
||||||
text: "You need to approve this!",
|
text: "You need to approve this!",
|
||||||
icon: "warning",
|
icon: "info",
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: "#3085d6",
|
confirmButtonColor: "#3085d6",
|
||||||
cancelButtonColor: "#d33",
|
confirmButtonText: "Yes",
|
||||||
confirmButtonText: "Yes"
|
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
|
||||||
|
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
var client_policy_id = $(this).attr('data-id');
|
var client_policy_id = $(this).attr('data-id');
|
||||||
var policy_id = $(this).attr('id');
|
var policy_id = $(this).attr('id');
|
||||||
var client_id = $('#client_id_policy').val()
|
var client_id = $('#client_id_policy').val()
|
||||||
|
|
||||||
// console.log('client_policy_id', client_policy_id);
|
console.log('client_policy_id', client_policy_id)
|
||||||
|
console.log('policy_id', policy_id)
|
||||||
|
console.log('client_id', client_id)
|
||||||
|
|
||||||
if (client_policy_id) {
|
if (client_policy_id) {
|
||||||
$('.loader').fadeIn();
|
$('.loader').fadeIn();
|
||||||
@ -744,30 +810,28 @@
|
|||||||
client_policy_id: client_policy_id,
|
client_policy_id: client_policy_id,
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log(res);
|
|
||||||
|
console.log(res.client_policy_data);
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res.open_for_enrollment) {
|
if (res.open_for_enrollment) {
|
||||||
var json_decode = JSON.parse(res.open_for_enrollment);
|
var json_decode = JSON.parse(res.open_for_enrollment);
|
||||||
var open_for_enrollment = json_decode.open_for_enrollment;
|
var open_for_enrollment = json_decode.open_for_enrollment;
|
||||||
var client_policy_id = json_decode.client_policy_id;
|
var client_policy_id = json_decode.client_policy_id;
|
||||||
|
|
||||||
if (open_for_enrollment == 1) {
|
if (open_for_enrollment == 1) {
|
||||||
// console.log($('[data-id="' + client_policy_id + '"]');
|
|
||||||
$('.btnOpenEnroll').each(function(index, element) {
|
$('.btnOpenEnroll').each(function(index, element) {
|
||||||
if ($(element).data('id') == client_policy_id) {
|
if ($(element).data('id') == client_policy_id) {
|
||||||
$(element).css({
|
$(element).html('<a data-toggle="tooltip" data-placement="top" title="Click To Close Enrollment" href="#" data-id="' + res.client_policy_data.id + '" id="' + res.client_policy_data.policy_id + '" class="btnOpenEnroll">Open</a>');
|
||||||
'background-color': 'lightgrey',
|
|
||||||
});
|
|
||||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$('.btnOpenEnroll').each(function(index, element) {
|
$('.btnOpenEnroll').each(function(index, element) {
|
||||||
if ($(element).data('id') == client_policy_id) {
|
if ($(element).data('id') == client_policy_id) {
|
||||||
$(element).css({
|
$(element).html('<a data-toggle="tooltip" data-placement="top" title="Click To Open Enrollment" href="#" data-id="' + res.client_policy_data.id + '" id="' + res.client_policy_data.policy_id + '" class="btnOpenEnroll">Closed</a>');
|
||||||
'background-color': '',
|
|
||||||
});
|
|
||||||
$(element).html('<i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,11 +272,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="4_age_to[]" id="4_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -306,11 +306,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="5_age_to[]" id="5_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="5_age_to[]" id="5_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -340,11 +340,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="6_age_to[]" id="6_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="6_age_to[]" id="6_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -374,11 +374,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="7_age_to[]" id="7_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="7_age_to[]" id="7_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -459,11 +459,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="10_age_to[]" id="10_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="10_age_to[]" id="10_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -563,11 +563,11 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="13_age_to[]" id="13_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="13_age_to[]" id="13_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">Relationship<span class="text-danger">*</span></label>
|
<label for="mobile">Relationship<span class="text-danger">*</span></label>
|
||||||
@ -1041,13 +1041,13 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
|
|
||||||
<div class="form-group col-md-4" id="">
|
<div class="form-group col-md-4" id="">
|
||||||
<label for="mobile">Sum Insured<span class="text-danger">*</span></label>
|
<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_si2[]" id="gpa_sum_si2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(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)" onkeyup="formatNumber(this)" required>
|
||||||
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
<div id='gpa_si_number_word' class="text-danger-2" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<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="gpa_sum_premium2[]" id="gpa_sum_premium2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? (data.si_or_bp == '3' ? data.premium : '') : ''}" type="text" class="form-control" placeholder="Enter Premium" name="gpa_sum_premium2[]" id="gpa_sum_premium2" onkeypress = "return onlyNumbers(event)" onkeyup="formatNumber(this)" required>
|
||||||
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
<div id='gpa_premium_number_word' class="text-danger-2" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1089,11 +1089,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="4_age_from[]" id="4_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="4_age_to[]" id="4_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter To Age" name="4_age_to[]" id="4_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1118,11 +1118,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="5_age_from[]" id="5_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="5_age_to[]" id="5_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="5_age_to[]" id="5_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1141,11 +1141,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
<div class="form-row" id="removeChild_${Count}" style="width:84%">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="6_age_from[]" id="6_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="6_age_to[]" id="6_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="6_age_to[]" id="6_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1169,11 +1169,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="7_age_from[]" id="7_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="7_age_to[]" id="7_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="7_age_to[]" id="7_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1245,11 +1245,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="10_age_from[]" id="10_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="10_age_to[]" id="10_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="10_age_to[]" id="10_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
<label for="mobile">Premium<span class="text-danger">*</span></label>
|
||||||
@ -1332,11 +1332,11 @@ function appendGridtHtml(ui_type = false, data = false, ) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
<label for="mobile">From Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_from : ''}" type="text" class="form-control" placeholder="Enter From Age" name="13_age_from[]" id="13_age_from" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
<label for="mobile">To Age<span class="text-danger">*</span></label>
|
||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter TO Age" name="13_age_to[]" id="13_age_to" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.age_to : ''}" type="text" class="form-control" placeholder="Enter To Age" name="13_age_to[]" id="13_age_to" onkeypress = "return onlyNumbers(event)" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label for="mobile">Relationship<span class="text-danger">*</span></label>
|
<label for="mobile">Relationship<span class="text-danger">*</span></label>
|
||||||
@ -1744,8 +1744,8 @@ function checkDuplicate() {
|
|||||||
|
|
||||||
if(selectedValue == 1){
|
if(selectedValue == 1){
|
||||||
|
|
||||||
var siInputs = $('input[name="3_si[]"]');
|
var siInputs = $('input[name="gpa_sum_si[]"]');
|
||||||
var premiumInputs = $('input[name="3_premium[]"]');
|
var premiumInputs = $('input[name="gpa_sum_premium[]"]');
|
||||||
|
|
||||||
var siValues = [];
|
var siValues = [];
|
||||||
var premiumValues = [];
|
var premiumValues = [];
|
||||||
@ -1763,12 +1763,17 @@ function checkDuplicate() {
|
|||||||
|
|
||||||
for (var i = 0; i < siValues.length; i++) {
|
for (var i = 0; i < siValues.length; i++) {
|
||||||
for (var j = i + 1; j < siValues.length; j++) {
|
for (var j = i + 1; j < siValues.length; j++) {
|
||||||
if (siValues[i] === siValues[j] && premiumValues[i] === premiumValues[j]) {
|
if (siValues[i] === siValues[j]) {
|
||||||
siDuplicates = true;
|
siDuplicates = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('siValues', siValues);
|
||||||
|
console.log('premiumValues', premiumValues);
|
||||||
|
console.log('siDuplicates', siDuplicates);
|
||||||
|
console.log('premiumDuplicates', premiumDuplicates);
|
||||||
|
|
||||||
if (siDuplicates || premiumDuplicates) {
|
if (siDuplicates || premiumDuplicates) {
|
||||||
toastr.warning('Duplicates found!', 'warning');
|
toastr.warning('Duplicates found!', 'warning');
|
||||||
return true;
|
return true;
|
||||||
@ -1778,7 +1783,59 @@ function checkDuplicate() {
|
|||||||
|
|
||||||
}else if(selectedValue == 3){
|
}else if(selectedValue == 3){
|
||||||
|
|
||||||
|
var siInputs = $('input[name="gpa_sum_si2[]"]');
|
||||||
|
var premiumInputs = $('input[name="gpa_sum_premium2[]"]');
|
||||||
|
var bandInputs = $('input[name="gpa_band[]"]');
|
||||||
|
|
||||||
|
var siValues = [];
|
||||||
|
var premiumValues = [];
|
||||||
|
var bandValues = [];
|
||||||
|
var siDuplicates = false;
|
||||||
|
var premiumDuplicates = false;
|
||||||
|
var bandDuplicates = false;
|
||||||
|
|
||||||
|
// Extract values from input arrays
|
||||||
|
siInputs.each(function() {
|
||||||
|
siValues.push($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
premiumInputs.each(function() {
|
||||||
|
premiumValues.push($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
bandInputs.each(function() {
|
||||||
|
bandValues.push($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
for (var i = 0; i < siValues.length; i++) {
|
||||||
|
for (var j = i + 1; j < siValues.length; j++) {
|
||||||
|
if (siValues[i] === siValues[j]) {
|
||||||
|
siDuplicates = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < bandValues.length; i++) {
|
||||||
|
for (var j = i + 1; j < bandValues.length; j++) {
|
||||||
|
if (bandValues[i] === bandValues[j]) {
|
||||||
|
bandDuplicates = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('siValues', siValues);
|
||||||
|
console.log('premiumValues', premiumValues);
|
||||||
|
console.log('bandValues', bandValues);
|
||||||
|
console.log('siDuplicates', siDuplicates);
|
||||||
|
console.log('premiumDuplicates', premiumDuplicates);
|
||||||
|
console.log('bandDuplicates', bandDuplicates);
|
||||||
|
|
||||||
|
if (siDuplicates || bandDuplicates || premiumDuplicates) {
|
||||||
|
toastr.warning('Duplicates found!', 'warning');
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user