MERGE_CODE_MERGE : RV
This commit is contained in:
commit
25ab921812
@ -315,8 +315,10 @@ class EmployeeController extends AdminController
|
|||||||
// ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
|
// ->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
|
||||||
// ->where('files.created_by', get_session_userid())->orderBy('files.created_at', 'desc')->findAll();
|
// ->where('files.created_by', get_session_userid())->orderBy('files.created_at', 'desc')->findAll();
|
||||||
// dd($this->fileModel->getLastQuery());
|
// dd($this->fileModel->getLastQuery());
|
||||||
|
$role_id = get_role_id();
|
||||||
|
$user_id = get_session_userid();
|
||||||
|
|
||||||
$data['fileList'] = $this->fileModel
|
$query = $this->fileModel
|
||||||
->select([
|
->select([
|
||||||
'files.id','files.file_name','files.created_by','files.created_at','files.is_active','files.status','files.client_id','files.policy_id','files.client_branch_id','files.action','files.uploaded_by',
|
'files.id','files.file_name','files.created_by','files.created_at','files.is_active','files.status','files.client_id','files.policy_id','files.client_branch_id','files.action','files.uploaded_by',
|
||||||
'up.emp_code',
|
'up.emp_code',
|
||||||
@ -334,13 +336,19 @@ class EmployeeController extends AdminController
|
|||||||
->join('client_branch cb', 'files.client_branch_id = cb.id', 'left')
|
->join('client_branch cb', 'files.client_branch_id = cb.id', 'left')
|
||||||
->join('policy_type', 'policy_type.id = cp.policy_type_id')
|
->join('policy_type', 'policy_type.id = cp.policy_type_id')
|
||||||
->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
|
->join('clients c', 'files.client_id = c.id and files.client_id = cp.client_id', 'left')
|
||||||
|
->join("client_rm cr","cr.client_id = c.id and cr.is_active = 1",'left');
|
||||||
|
if (in_array($role_id, [2, 3])) {
|
||||||
|
|
||||||
|
// If the user is a Account Manager or Manager, filter by user_id
|
||||||
|
$query->where('cr.user_id', $user_id);
|
||||||
|
}
|
||||||
// ->where('files.created_by', get_session_userid())
|
// ->where('files.created_by', get_session_userid())
|
||||||
->orderBy('files.created_at', 'desc')
|
$data['fileList'] = $query->orderBy('files.created_at', 'desc')
|
||||||
->limit(100)
|
->limit(100)
|
||||||
->find();
|
->find();
|
||||||
// dd($data['fileList']);
|
// dd($data['fileList']);
|
||||||
|
|
||||||
$data['batch_list'] = $this->batchFileModel->select("
|
$query2 = $this->batchFileModel->select("
|
||||||
|
|
||||||
batch_files.id,
|
batch_files.id,
|
||||||
batch_files.client_id,
|
batch_files.client_id,
|
||||||
@ -378,9 +386,17 @@ class EmployeeController extends AdminController
|
|||||||
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
|
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
|
||||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||||
->join('clients', 'clients.id = client_policy.client_id')
|
->join('clients', 'clients.id = client_policy.client_id')
|
||||||
->orderBy('batch_files.id', 'desc')
|
->join("client_rm cr","cr.client_id = clients.id and cr.is_active = 1",'left');
|
||||||
->limit(1000)
|
if (in_array($role_id, [2, 3])) {
|
||||||
->find();
|
|
||||||
|
// If the user is a Account Manager or Manager, filter by user_id
|
||||||
|
$query2->where('cr.user_id', $user_id);
|
||||||
|
}
|
||||||
|
// ->where('files.created_by', get_session_userid())
|
||||||
|
$data['batch_list'] = $query2->orderBy('batch_files.id', 'desc')
|
||||||
|
->limit(1000)
|
||||||
|
->find();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// dd($data['fileList']);die();
|
// dd($data['fileList']);die();
|
||||||
@ -759,8 +775,18 @@ class EmployeeController extends AdminController
|
|||||||
|
|
||||||
public function enrollmentClientList()
|
public function enrollmentClientList()
|
||||||
{
|
{
|
||||||
|
$role_id = get_role_id();
|
||||||
|
$user_id = get_session_userid();
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$client_list = $this->clientModel->where('clients.is_active', 1)->findAll();
|
$client_list = $this->clientModel->join("client_rm","client_rm.client_id = clients.id",'left')->where('clients.is_active', 1);
|
||||||
|
if (in_array($role_id, [2, 3])) {
|
||||||
|
|
||||||
|
// If the user is a Account Manager or Manager, filter by user_id
|
||||||
|
$client_list->where('client_rm.user_id', $user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$client_list = $client_list->groupBy("clients.id")->findAll();
|
||||||
$branch_list = $this->clientBranchModel->where('client_branch.is_active', 1)->findAll();
|
$branch_list = $this->clientBranchModel->where('client_branch.is_active', 1)->findAll();
|
||||||
$policy_list = $this->clientPolicyModel
|
$policy_list = $this->clientPolicyModel
|
||||||
->select('client_policy.*, policy_type.policy_type')
|
->select('client_policy.*, policy_type.policy_type')
|
||||||
|
|||||||
@ -131,10 +131,16 @@ class ExcelMergeHelper {
|
|||||||
$newName = $sheetName;
|
$newName = $sheetName;
|
||||||
$counter = 1;
|
$counter = 1;
|
||||||
|
|
||||||
while (in_array($newName, $mergedSpreadsheet->getSheetNames())) {
|
// while (in_array($newName, $mergedSpreadsheet->getSheetNames())) {
|
||||||
// $newName = $sheetName . "_" . $counter++;
|
// // $newName = $sheetName . "_" . $counter++;
|
||||||
log_message('debug', "Sheet name already exists. Trying new name: {$newName}");
|
// log_message('debug', "Sheet name already exists. Trying new name: {$newName}");
|
||||||
// echo "Sheet name already exists. Trying new name: {$newName}\n";
|
// // echo "Sheet name already exists. Trying new name: {$newName}\n";
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (in_array($newName, $mergedSpreadsheet->getSheetNames())) {
|
||||||
|
$newName = $sheetName . '_' . $counter++;
|
||||||
|
$worksheet->setTitle($newName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone the worksheet and set the new name
|
// Clone the worksheet and set the new name
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -790,3 +790,42 @@ if (!function_exists('expected_amount_calc')) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!function_exists('expected_amount_calc')) {
|
||||||
|
|
||||||
|
function expected_amount_calc($data, $index)
|
||||||
|
{
|
||||||
|
$agreed_amount = (int)($data['agreed_amount'][$index] ?? 0);
|
||||||
|
$agreed_bp_per = (int)$data['agreed_bp'][$index] ?? 0;
|
||||||
|
$agreed_tp_per = (int)$data['agreed_tp'][$index] ?? 0;
|
||||||
|
$agreed_tep_per = (int)$data['agreed_ter'][$index] ?? 0;
|
||||||
|
|
||||||
|
$standard_bp_per = (int)$data['standard_bp'][$index] ?? 0;
|
||||||
|
$standard_tp_per = (int)$data['standard_tp'][$index] ?? 0;
|
||||||
|
$standard_tep_per = (int)$data['standard_ter'][$index] ?? 0;
|
||||||
|
|
||||||
|
$base_premium = (int)$data['base_premium'][$index] ?? 0;
|
||||||
|
$third_part_premium = (int)$data['tp_premium'][$index] ?? 0;
|
||||||
|
$terrisom_premium = (int)$data['ter_premium'][$index] ?? 0;
|
||||||
|
|
||||||
|
$sum_of_agreed_premium =$agreed_bp_per + $agreed_tp_per + $agreed_tep_per;
|
||||||
|
|
||||||
|
$expectedAmount = 0;
|
||||||
|
|
||||||
|
if ($agreed_amount > 0) {
|
||||||
|
$expectedAmount = $agreed_amount;
|
||||||
|
} elseif ($sum_of_agreed_premium > 0) {
|
||||||
|
$sum_of_bp_amt = ($base_premium * $agreed_bp_per) / 100;
|
||||||
|
$sum_of_tp_amt = ($third_part_premium * $agreed_tp_per) / 100;
|
||||||
|
$sum_of_tep_amt = ($terrisom_premium * $agreed_tep_per) / 100;
|
||||||
|
$expectedAmount = $sum_of_bp_amt + $sum_of_tp_amt + $sum_of_tep_amt;
|
||||||
|
} else {
|
||||||
|
$sum_of_bp_amt = ($base_premium * $standard_bp_per) / 100;
|
||||||
|
$sum_of_tp_amt = ($third_part_premium * $standard_tp_per) / 100;
|
||||||
|
$sum_of_tep_amt = ($terrisom_premium * $standard_tep_per) / 100;
|
||||||
|
$expectedAmount = $sum_of_bp_amt + $sum_of_tp_amt + $sum_of_tep_amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $expectedAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -53,17 +53,19 @@ class ClientModel extends Model
|
|||||||
|
|
||||||
$columns = ['clients.id ', 'client_name','short_name'];
|
$columns = ['clients.id ', 'client_name','short_name'];
|
||||||
$clients = $this->select($columns)
|
$clients = $this->select($columns)
|
||||||
->where('is_active',1)
|
->where('clients.is_active',1)
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
// if($role_id == 2 || $role_id == 3){
|
if($role_id == 2 || $role_id == 3){
|
||||||
|
|
||||||
// $clients = $this->select($columns)
|
$clients = $this->select($columns)
|
||||||
// ->join('client_rm', 'client_rm.client_id = clients.id')
|
->join('client_rm', 'client_rm.client_id = clients.id')
|
||||||
// ->where('client_rm.user_id', $user_id)
|
->where('client_rm.user_id', $user_id)
|
||||||
// ->where('clients.is_active',1)
|
->where('clients.is_active',1)
|
||||||
// ->findAll();
|
->findAll();
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
// $clients->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -107,11 +109,24 @@ class ClientModel extends Model
|
|||||||
|
|
||||||
public function getCreatedByUserName(){
|
public function getCreatedByUserName(){
|
||||||
|
|
||||||
return $this->db->table('clients')
|
$role_id = get_role_id();
|
||||||
|
$user_id = get_session_userid();
|
||||||
|
|
||||||
|
$query = $this->db->table('clients')
|
||||||
->select('clients.*')
|
->select('clients.*')
|
||||||
->where('is_active', 1)
|
->join('client_rm', 'client_rm.client_id = clients.id','left')
|
||||||
->get()
|
->where('clients.is_active', 1);
|
||||||
->getResult();
|
|
||||||
|
if (in_array($role_id, [2, 3])) {
|
||||||
|
|
||||||
|
// If the user is a Account Manager or Manager, filter by user_id
|
||||||
|
$query->where('client_rm.user_id', $user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = $query->groupBy("clients.id")->get()->getResult();
|
||||||
|
// dd($data);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -181,8 +181,7 @@ body {
|
|||||||
function client_policies() {
|
function client_policies() {
|
||||||
var check_client_id = $('#general_PrimaryKey').val();
|
var check_client_id = $('#general_PrimaryKey').val();
|
||||||
|
|
||||||
|
if(check_client_id == '' || check_client_id == null || check_client_id == 0){
|
||||||
if(check_client_id[0].value == '' || check_client_id[0].value == null || check_client_id[0].value == 0){
|
|
||||||
$('#BtnAdd').hide();
|
$('#BtnAdd').hide();
|
||||||
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
toastr.warning('Please Add the Client!', 'warning',{timeOut: 2000});
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -1995,6 +1995,17 @@
|
|||||||
$('#tpa_danger').show()
|
$('#tpa_danger').show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.data.policy_type_id > 7) {
|
||||||
|
|
||||||
|
$('#first').show();
|
||||||
|
$('#second').show();
|
||||||
|
$('#third').show();
|
||||||
|
$('#base_policy_id').hide();
|
||||||
|
$('#base_policy').prop('required', false);
|
||||||
|
|
||||||
|
$(".EB").hide();
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$('#client_branch').val(res.data.client_branch_id).select2();
|
$('#client_branch').val(res.data.client_branch_id).select2();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@ -385,10 +385,12 @@
|
|||||||
});
|
});
|
||||||
}else if (lead_type == 3) {
|
}else if (lead_type == 3) {
|
||||||
|
|
||||||
$('#client_id').prepend($('<option>', {
|
if ($('#client_id option[value="add_client"]').length === 0) {
|
||||||
value: 'add_client',
|
$('#client_id').prepend($('<option>', {
|
||||||
text: '+ Add Client'
|
value: 'add_client',
|
||||||
}));
|
text: '+ Add Client'
|
||||||
|
}));
|
||||||
|
}
|
||||||
$("#source_policy_id").removeAttr("required");
|
$("#source_policy_id").removeAttr("required");
|
||||||
$("#source_policy_id").closest("div") .find("label .text-danger").remove();
|
$("#source_policy_id").closest("div") .find("label .text-danger").remove();
|
||||||
|
|
||||||
|
|||||||
@ -150,8 +150,20 @@ if (isset($selected_lead_type)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function appendClients(data) {
|
function appendClients(data) {
|
||||||
|
// console.log("lead_type",lead_type.value);
|
||||||
|
|
||||||
$('#client_id').empty();
|
$('#client_id').empty();
|
||||||
|
|
||||||
|
if (lead_type.value == 3) {
|
||||||
|
if ($('#client_id option[value="add_client"]').length === 0) {
|
||||||
|
|
||||||
|
$('#client_id').prepend($('<option>', {
|
||||||
|
value: 'add_client',
|
||||||
|
text: '+ Add Client'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('#client_id').append($('<option>', {
|
$('#client_id').append($('<option>', {
|
||||||
value: '',
|
value: '',
|
||||||
text: 'Select Client'
|
text: 'Select Client'
|
||||||
|
|||||||
@ -575,10 +575,12 @@
|
|||||||
if (value == 3) {
|
if (value == 3) {
|
||||||
// alert("Function Called");
|
// alert("Function Called");
|
||||||
|
|
||||||
$('#client_id').prepend($('<option>', {
|
if ($('#client_id option[value="add_client"]').length === 0) {
|
||||||
value: 'add_client',
|
$('#client_id').prepend($('<option>', {
|
||||||
text: '+ Add Client'
|
value: 'add_client',
|
||||||
}));
|
text: '+ Add Client'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
$("#source_policy_id").prop("required",false);
|
$("#source_policy_id").prop("required",false);
|
||||||
$("#source_policy_id").closest("div") .find("label .text-danger").remove();
|
$("#source_policy_id").closest("div") .find("label .text-danger").remove();
|
||||||
|
|||||||
@ -230,6 +230,8 @@ $("#otherPolicyTerms").submit(function(event) {
|
|||||||
|
|
||||||
var policy_type_id = "";
|
var policy_type_id = "";
|
||||||
$('body').on('click', '.btnPolicyMaster', function() {
|
$('body').on('click', '.btnPolicyMaster', function() {
|
||||||
|
$("#append_html_for_other_policy_terms").empty();
|
||||||
|
|
||||||
|
|
||||||
var client_policy_id = $(this).data('id');
|
var client_policy_id = $(this).data('id');
|
||||||
policy_type_id = $(this).data('typeid');
|
policy_type_id = $(this).data('typeid');
|
||||||
|
|||||||
@ -140,8 +140,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input type="radio" name="family_floater" class="family_floater" value="1"> Yes
|
<input type="radio" id="familyFloaterYes" name="family_floater" class="family_floater" value="1"> Yes
|
||||||
<input type="radio" name="family_floater" class="family_floater" value="0" style="margin-left:10px">No
|
<input type="radio" id="familyFloaterNo" name="family_floater" class="family_floater" value="0" style="margin-left:10px">No
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
@ -892,85 +892,85 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="ayudhtreatmentcover"]').change(function() {
|
// $('input[name="ayudhtreatmentcover"]').change(function() {
|
||||||
|
|
||||||
////console.log($(this).val());
|
// ////console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="ailmentcapping"]').change(function() {
|
// $('input[name="ailmentcapping"]').change(function() {
|
||||||
|
|
||||||
////console.log($(this).val());
|
// ////console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="copayzonewisecopay"]').change(function() {
|
// $('input[name="copayzonewisecopay"]').change(function() {
|
||||||
|
|
||||||
////console.log($(this).val());
|
// ////console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="cataract"]').change(function() {
|
// $('input[name="cataract"]').change(function() {
|
||||||
|
|
||||||
//console.log($(this).val());
|
// //console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
$('input[name="waiverofpreexistingdiseases"]').change(function() {
|
// $('input[name="waiverofpreexistingdiseases"]').change(function() {
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
var element2 = $(this).parent().parent().next().next()[0];
|
// var element2 = $(this).parent().parent().next().next()[0];
|
||||||
$(element2).css("display", "");
|
// $(element2).css("display", "");
|
||||||
var element3 = $(this).parent().parent().next().next().next()[0];
|
// var element3 = $(this).parent().parent().next().next().next()[0];
|
||||||
$(element3).css("display", "");
|
// $(element3).css("display", "");
|
||||||
var element4 = $(this).parent().parent().next().next().next().next()[0];
|
// var element4 = $(this).parent().parent().next().next().next().next()[0];
|
||||||
$(element4).css("display", "");
|
// $(element4).css("display", "");
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
var element2 = $(this).parent().parent().next().next()[0];
|
// var element2 = $(this).parent().parent().next().next()[0];
|
||||||
$(element2).css("display", "none");
|
// $(element2).css("display", "none");
|
||||||
var element3 = $(this).parent().parent().next().next().next()[0];
|
// var element3 = $(this).parent().parent().next().next().next()[0];
|
||||||
$(element3).css("display", "none");
|
// $(element3).css("display", "none");
|
||||||
var element4 = $(this).parent().parent().next().next().next().next()[0];
|
// var element4 = $(this).parent().parent().next().next().next().next()[0];
|
||||||
$(element4).css("display", "none");
|
// $(element4).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
$("#policyJsonForm").submit(function(event) {
|
$("#policyJsonForm").submit(function(event) {
|
||||||
@ -1207,6 +1207,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key === "family_floater") {
|
||||||
|
|
||||||
|
if (jsonObject[key] === "Floater") {
|
||||||
|
setTimeout(() => {
|
||||||
|
|
||||||
|
$("#familyFloaterYes").prop("checked", true);
|
||||||
|
}, 100); // delay in milliseconds
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$("#familyFloaterNo").prop("checked", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (key.includes("family_floaters")) {
|
if (key.includes("family_floaters")) {
|
||||||
|
|
||||||
let checkboxes = document.querySelectorAll(
|
let checkboxes = document.querySelectorAll(
|
||||||
@ -1279,6 +1294,7 @@
|
|||||||
element.parentElement.parentElement
|
element.parentElement.parentElement
|
||||||
.parentElement.nextElementSibling.style
|
.parentElement.nextElementSibling.style
|
||||||
.display = '';
|
.display = '';
|
||||||
|
// alert('family floater');
|
||||||
} else if (element.name ===
|
} else if (element.name ===
|
||||||
"waiverofpreexistingdiseases") {
|
"waiverofpreexistingdiseases") {
|
||||||
element.parentElement.parentElement
|
element.parentElement.parentElement
|
||||||
@ -1869,9 +1885,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let display_id = base_id + "_display";
|
let display_id = base_id + "_display";
|
||||||
console.log("input value : ", jsonObject[key][innerKey]);
|
// console.log("input value : ", jsonObject[key][innerKey]);
|
||||||
let inputValue = jsonObject[key][innerKey];
|
let inputValue = jsonObject[key][innerKey];
|
||||||
if (inputValue && inputValue.trim() !== '' && inputValue !== ' ') {
|
if (inputValue) {
|
||||||
$('#' + display_id).prop('checked', true);
|
$('#' + display_id).prop('checked', true);
|
||||||
}
|
}
|
||||||
console.log('display_id : ', display_id);
|
console.log('display_id : ', display_id);
|
||||||
|
|||||||
@ -475,75 +475,75 @@ $('.close').click(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('input[name="burnExpenses"]').change(function() {
|
// $('input[name="burnExpenses"]').change(function() {
|
||||||
|
|
||||||
console.log($(this).val());
|
// console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="compassionateVisitExpenses"]').change(function() {
|
// $('input[name="compassionateVisitExpenses"]').change(function() {
|
||||||
|
|
||||||
console.log($(this).val());
|
// console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="carriageOfDeadBody"]').change(function() {
|
// $('input[name="carriageOfDeadBody"]').change(function() {
|
||||||
|
|
||||||
console.log($(this).val());
|
// console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="ambulanceCharges"]').change(function() {
|
// $('input[name="ambulanceCharges"]').change(function() {
|
||||||
|
|
||||||
console.log($(this).val());
|
// console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$('input[name="brokenBoneExpenses"]').change(function() {
|
// $('input[name="brokenBoneExpenses"]').change(function() {
|
||||||
|
|
||||||
console.log($(this).val());
|
// console.log($(this).val());
|
||||||
|
|
||||||
if ($(this).val() == '1') {
|
// if ($(this).val() == '1') {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
// $(element).css("display", "");
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
var element = $(this).parent().parent().next()[0];
|
// var element = $(this).parent().parent().next()[0];
|
||||||
$(element).css("display", "none");
|
// $(element).css("display", "none");
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
$("#policyGPATerms").submit(function(event) {
|
$("#policyGPATerms").submit(function(event) {
|
||||||
|
|
||||||
@ -1073,7 +1073,7 @@ function processJsonObject2(jsonObject) {
|
|||||||
function disableUnwantedTermsforGPA(jsonObject) {
|
function disableUnwantedTermsforGPA(jsonObject) {
|
||||||
// alert("Disabling unwanted terms");
|
// alert("Disabling unwanted terms");
|
||||||
|
|
||||||
fields.forEach(function(key) {
|
gpaFields.forEach(function(key) {
|
||||||
// If key NOT in jsonObject, then hide and disable its associated elements
|
// If key NOT in jsonObject, then hide and disable its associated elements
|
||||||
if (!jsonObject.hasOwnProperty(key)) {
|
if (!jsonObject.hasOwnProperty(key)) {
|
||||||
const elements = document.getElementsByName(key);
|
const elements = document.getElementsByName(key);
|
||||||
|
|||||||
@ -1652,7 +1652,7 @@
|
|||||||
collapsibleBar.innerHTML = `
|
collapsibleBar.innerHTML = `
|
||||||
${tableData ? tableData.table_name : "Particulars"}
|
${tableData ? tableData.table_name : "Particulars"}
|
||||||
<span class="collapse-icon">▼</span>
|
<span class="collapse-icon">▼</span>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Create table content wrapper with Bootstrap 4 collapse class
|
// Create table content wrapper with Bootstrap 4 collapse class
|
||||||
const tableContent = document.createElement('div');
|
const tableContent = document.createElement('div');
|
||||||
@ -1997,12 +1997,16 @@
|
|||||||
// Initialize the parent table
|
// Initialize the parent table
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
// // // console.log("bjnglfkrg ", rfq_data.length);
|
// // // console.log("bjnglfkrg ", rfq_data.length);
|
||||||
const url = window.location.pathname; // Get the path (e.g., "/nhance/rfq/list/75/1")
|
// const url = window.location.pathname; // Get the path (e.g., "/nhance/rfq/list/75/1")
|
||||||
const segments = url.split("/"); // Split by "/"
|
// const segments = url.split("/"); // Split by "/"
|
||||||
segments[segments.length - 1] = "1"; // Change the last segment
|
// segments[segments.length - 1] = "1"; // Change the last segment
|
||||||
const newUrl = segments.join("/"); // Rebuild the URL
|
// const newUrl = segments.join("/"); // Rebuild the URL
|
||||||
rfq_or_qcr = 1;
|
const path = window.location.pathname; // Get the current URL path
|
||||||
history.pushState(null, "", newUrl); // Change the URL without reloading
|
const segments = path.split('/'); // Split the path into segments
|
||||||
|
const lead_id = segments[segments.length - 2]; // Get the second last segment (15)
|
||||||
|
const type = segments[segments.length - 1];
|
||||||
|
rfq_or_qcr = type;
|
||||||
|
// history.pushState(null, "", newUrl); // Change the URL without reloading
|
||||||
|
|
||||||
if (rfq_data.length) {
|
if (rfq_data.length) {
|
||||||
// // console.log("inside if conditoon");
|
// // console.log("inside if conditoon");
|
||||||
@ -2623,6 +2627,8 @@
|
|||||||
if (rfq_or_qcr == 2) {
|
if (rfq_or_qcr == 2) {
|
||||||
$("#openQCR").hide();
|
$("#openQCR").hide();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$('#rfq_primaryKey').val(response.id);
|
||||||
}
|
}
|
||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
@ -3750,14 +3756,30 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeRowQCR(event) {
|
function removeRowQCR(event) {
|
||||||
const button = event.target;
|
Swal.fire({
|
||||||
const row = button.closest('tr');
|
title: 'Are you sure?',
|
||||||
const table = row.closest('table');
|
text: "Do you want to remove the row?",
|
||||||
if (row && row.parentElement.children.length > 1) {
|
icon: 'warning',
|
||||||
// // console.log("Row Removed");
|
showCancelButton: true,
|
||||||
row.remove();
|
confirmButtonColor: '#d33',
|
||||||
updateVisisbleSNO(table.id);
|
cancelButtonColor: '#3085d6',
|
||||||
}
|
confirmButtonText: 'Yes, remove it!',
|
||||||
|
cancelButtonText: 'Cancel'
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
const button = event.target;
|
||||||
|
const row = button.closest('tr');
|
||||||
|
const table = row.closest('table');
|
||||||
|
if (row && row.parentElement.children.length > 1) {
|
||||||
|
// // console.log("Row Removed");
|
||||||
|
row.remove();
|
||||||
|
updateVisisbleSNO(table.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
isFormDataModified = true; // if any value changeing in the table to set true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateVisisbleSNO(tableId) {
|
function updateVisisbleSNO(tableId) {
|
||||||
@ -5704,6 +5726,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user