FIX_DEPENDENT_ADD_ERROR
This commit is contained in:
parent
4a0d9657d9
commit
d76e999c93
@ -1035,6 +1035,14 @@ class EmployeeServiceController extends AdminController
|
|||||||
// kint::dump($family);
|
// kint::dump($family);
|
||||||
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again bring self to first index of the array
|
$family = data_group_by_family($family)[ $emp_id ];// reason to call this again bring self to first index of the array
|
||||||
}
|
}
|
||||||
|
$firstNonTemp = null;
|
||||||
|
|
||||||
|
foreach ($family as $fam) {
|
||||||
|
if (!isset($fam['temp'])) {
|
||||||
|
$firstNonTemp = $fam;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// kint::dump($family);//die();
|
// kint::dump($family);//die();
|
||||||
|
|
||||||
//check name dup within a family
|
//check name dup within a family
|
||||||
@ -1070,7 +1078,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
if(!count($self_details))
|
if(!count($self_details))
|
||||||
{
|
{
|
||||||
array_push($result['error_summary'],14); // Self not found
|
array_push($result['error_summary'],14); // Self not found
|
||||||
$result['error_data'][ $family[0][0] ]['sno']['error'][] = "Self not found in Database";
|
$result['error_data'][ $firstNonTemp[0] ]['sno']['error'][] = "Self not found in Database";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1078,7 +1086,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception'|| $file['action'] == 'missed_inception' || $file['action'] == 'enrollment')
|
if($file['action'] == 'dependent_addition' || $file['action'] == 'addition' || $file['action'] == 'inception'|| $file['action'] == 'missed_inception' || $file['action'] == 'enrollment')
|
||||||
{
|
{
|
||||||
$res = check_dependent_conflict($family,$policy_terms,$file['action'],$is_lgbtq);
|
$res = check_dependent_conflict($family,$policy_terms,$file['action'],$is_lgbtq);
|
||||||
// dd($res);
|
// Kint::dump($res);
|
||||||
if(!$res['status'])
|
if(!$res['status'])
|
||||||
{
|
{
|
||||||
foreach($res['error_data'] as $key => $value)
|
foreach($res['error_data'] as $key => $value)
|
||||||
@ -1091,7 +1099,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
|
|
||||||
//check dup with empid and name with db
|
//check dup with empid and name with db
|
||||||
$res = name_and_empid_check_in_db($family,$file);
|
$res = name_and_empid_check_in_db($family,$file);
|
||||||
// dd($res);
|
// Kint::dump($res['del']);
|
||||||
// echo '<br/>';
|
// echo '<br/>';
|
||||||
// print_r($res);
|
// print_r($res);
|
||||||
if(count($res['del']))
|
if(count($res['del']))
|
||||||
@ -1113,7 +1121,7 @@ class EmployeeServiceController extends AdminController
|
|||||||
}// end of foreach
|
}// end of foreach
|
||||||
}// end of if current action I,DA,A
|
}// end of if current action I,DA,A
|
||||||
|
|
||||||
// return $result;
|
// return $result;
|
||||||
// die();
|
// die();
|
||||||
if(isset($result['error_summary']) && count($result['error_summary']))
|
if(isset($result['error_summary']) && count($result['error_summary']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3077,6 +3077,7 @@ class LeadsController extends BaseController
|
|||||||
3 => 'rfq/gmc',
|
3 => 'rfq/gmc',
|
||||||
4 => 'rfq/gmc',
|
4 => 'rfq/gmc',
|
||||||
5 => 'rfq/gmc',
|
5 => 'rfq/gmc',
|
||||||
|
17=> 'rfq/burglary',
|
||||||
22 => 'rfq/car',
|
22 => 'rfq/car',
|
||||||
23 => 'rfq/cpm',
|
23 => 'rfq/cpm',
|
||||||
24 => 'rfq/cyber_crime',
|
24 => 'rfq/cyber_crime',
|
||||||
|
|||||||
@ -440,8 +440,20 @@ if (!function_exists('name_dup_check_within_family'))
|
|||||||
foreach ($family_data as $rkey => $row)
|
foreach ($family_data as $rkey => $row)
|
||||||
{
|
{
|
||||||
if(in_array($row[2],$temp))
|
if(in_array($row[2],$temp))
|
||||||
{
|
{
|
||||||
array_push($result,$row[0]);
|
// Kint::dump($row);
|
||||||
|
$emp_code = $row[1];
|
||||||
|
$tempFam = null;
|
||||||
|
foreach ($family_data as $family) {
|
||||||
|
if ($family[1] == $emp_code &&!isset($family['temp'])) {
|
||||||
|
$tempFam = $family;
|
||||||
|
break; // Stop at the first match
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Kint::dump($tempFam);
|
||||||
|
// die();
|
||||||
|
|
||||||
|
array_push($result,$tempFam[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -449,7 +461,7 @@ if (!function_exists('name_dup_check_within_family'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// dd($result);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,7 +531,15 @@ if (!function_exists('name_and_empid_check_in_db'))
|
|||||||
}
|
}
|
||||||
if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition' || $current_action == 'enrollment') && count($res))
|
if(($current_action == 'inception' || $current_action == 'dependent_addition' || $current_action == 'addition' || $current_action == 'enrollment') && count($res))
|
||||||
{
|
{
|
||||||
array_push($result['i'],$row[0]);
|
$emp_code = $row[1];
|
||||||
|
$tempFam = null;
|
||||||
|
foreach ($family_data as $family) {
|
||||||
|
if ($family[1] == $emp_code &&!isset($family['temp'])) {
|
||||||
|
$tempFam = $family;
|
||||||
|
break; // Stop at the first match
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_push($result['i'],$tempFam[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -242,33 +242,33 @@ hr.solid {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<!-- <div class="form-group col-md-3">
|
||||||
<label for="insurer">Insurer <span class="text-danger"></span></label>
|
<label for="insurer">Insurer <span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="insurer" name="insurer">
|
<select class="form-control" id="insurer" name="insurer">
|
||||||
<option value="">Select Insurer</option>
|
<option value="">Select Insurer</option>
|
||||||
<?php if (isset($insurer)) { ?>
|
<?php //if (isset($insurer)) { ?>
|
||||||
<?php foreach ($insurer as $value) { ?>
|
<?php //foreach ($insurer as $value) { ?>
|
||||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>">
|
<option value="<?php //echo $value['id'] . '-' . $value['insurer_id'] ?>">
|
||||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
<?php //echo $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
||||||
</option>
|
</option>
|
||||||
<?php } ?>
|
<?php //} ?>
|
||||||
<?php } ?>
|
<?php //} ?>
|
||||||
</select>
|
</select> -->
|
||||||
</div>
|
<!-- </div> -->
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<!-- <div class="form-group col-md-3">
|
||||||
<label for="tpa">TPA <span class="text-danger"></span></label>
|
<label for="tpa">TPA <span class="text-danger"></span></label>
|
||||||
<select class="form-control" id="tpa" name="tpa">
|
<select class="form-control" id="tpa" name="tpa">
|
||||||
<option value="">Select TPA</option>
|
<option value="">Select TPA</option>
|
||||||
<?php if (isset($tpa)) { ?>
|
<?php //if (isset($tpa)) { ?>
|
||||||
<?php foreach ($tpa as $value) { ?>
|
<?php //foreach ($tpa as $value) { ?>
|
||||||
<option value="<?= $value['id'] . '-' . $value['tpa_id'] ?>">
|
<option value="<?php // echo $value['id'] . '-' . $value['tpa_id'] ?>">
|
||||||
<?= $value['tpa_short_name'] . '-' . $value['branch_code'] ?>
|
<?php // echo $value['tpa_short_name'] . '-' . $value['branch_code'] ?>
|
||||||
</option>
|
</option>
|
||||||
<?php } ?>
|
<?php //} ?>
|
||||||
<?php } ?>
|
<?php //} ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="">Date of Commencement <span class="text-danger">*</span></label>
|
<label for="">Date of Commencement <span class="text-danger">*</span></label>
|
||||||
|
|||||||
@ -166,7 +166,21 @@
|
|||||||
<option value="4_month">4 Months</option>
|
<option value="4_month">4 Months</option>
|
||||||
<option value="5_month">5 Months</option>
|
<option value="5_month">5 Months</option>
|
||||||
<option value="6_month">6 Months</option>
|
<option value="6_month">6 Months</option>
|
||||||
|
<option value="7_month">7 Months</option>
|
||||||
|
<option value="8_month">8 Months</option>
|
||||||
|
<option value="9_month">9 Months</option>
|
||||||
|
<option value="10_month">10 Months</option>
|
||||||
|
<option value="11_month">11 Months</option>
|
||||||
<option value="12_month">12 Months</option>
|
<option value="12_month">12 Months</option>
|
||||||
|
<option value="2_year">2 Year</option>
|
||||||
|
<option value="3_year">3 Year</option>
|
||||||
|
<option value="4_year">4 Year</option>
|
||||||
|
<option value="5_year">5 Year</option>
|
||||||
|
<option value="6_year">6 Year</option>
|
||||||
|
<option value="7_year">7 Year</option>
|
||||||
|
<option value="8_year">8 Year</option>
|
||||||
|
<option value="9_year">9 Year</option>
|
||||||
|
<option value="10_year">10 Year</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div id="locationNoDIV" class="form-group col-md-4">
|
<div id="locationNoDIV" class="form-group col-md-4">
|
||||||
@ -358,7 +372,7 @@
|
|||||||
$("#policyRiskSplitUpForm").submit(function(event) {
|
$("#policyRiskSplitUpForm").submit(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var isValid = $('#policyRiskSplitUpForm').parsley().validate();
|
var isValid = $('#policyRiskSplitUpForm').parsley().validate();
|
||||||
// console.log('isValid', isValid);
|
// console.log('isValid', isValid);
|
||||||
@ -403,25 +417,25 @@
|
|||||||
let rawMaterial = [...document.querySelectorAll('[id^="rawMaterial_"]')].map(el => Number(el.value) || 0);
|
let rawMaterial = [...document.querySelectorAll('[id^="rawMaterial_"]')].map(el => Number(el.value) || 0);
|
||||||
let findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
|
let findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
|
||||||
|
|
||||||
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
|
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
|
||||||
rawMaterial.reduce((acc, val) => acc + val, 0) +
|
rawMaterial.reduce((acc, val) => acc + val, 0) +
|
||||||
findMaterial.reduce((acc, val) => acc + val, 0);
|
findMaterial.reduce((acc, val) => acc + val, 0);
|
||||||
|
|
||||||
let allowedSI = Number($("#policySI").val()) || 0;
|
let allowedSI = Number($("#policySI").val()) || 0;
|
||||||
|
|
||||||
if (totalSI > allowedSI) {
|
if (totalSI != allowedSI) {
|
||||||
toastr.error("Sum Insured Exceeds Allowed Limit", "ERROR");
|
toastr.error("Sum Insured Exceeds Allowed Limit", "ERROR");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// console.log("Total SI: ", totalSI);
|
// console.log("Total SI: ", totalSI);
|
||||||
}else{
|
} else {
|
||||||
let InProcess = [...document.querySelectorAll('[id^="stockInProcess_"]')].map(el => Number(el.value) || 0);
|
let InProcess = [...document.querySelectorAll('[id^="stockInProcess_"]')].map(el => Number(el.value) || 0);
|
||||||
let rawMaterial = [...document.querySelectorAll('[id^="rawMaterial_"]')].map(el => Number(el.value) || 0);
|
let rawMaterial = [...document.querySelectorAll('[id^="rawMaterial_"]')].map(el => Number(el.value) || 0);
|
||||||
let findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
|
let findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
|
||||||
|
|
||||||
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
|
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
|
||||||
rawMaterial.reduce((acc, val) => acc + val, 0) +
|
rawMaterial.reduce((acc, val) => acc + val, 0) +
|
||||||
findMaterial.reduce((acc, val) => acc + val, 0);
|
findMaterial.reduce((acc, val) => acc + val, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,6 +479,7 @@
|
|||||||
// console.log("Grouped Data as Objects: ", policyRiskSplitUpData);
|
// console.log("Grouped Data as Objects: ", policyRiskSplitUpData);
|
||||||
|
|
||||||
savePolicyDataLocal();
|
savePolicyDataLocal();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -678,7 +693,7 @@
|
|||||||
<input type="number" id="rawMaterial_${increment2}" name="raw_material[]" class="form-control multi_location_company" />
|
<input type="number" id="rawMaterial_${increment2}" name="raw_material[]" class="form-control multi_location_company" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4 multi_location_company">
|
<div class="form-group col-md-4 multi_location_company">
|
||||||
<label for="finishedStock_${increment2}">Finished Stock</label>
|
<label for="finishedStock_${increment2}">Stock</label>
|
||||||
<input type="number" id="finishedStock_${increment2}" name="finished_stock[]" class="form-control multi_location_company"/>
|
<input type="number" id="finishedStock_${increment2}" name="finished_stock[]" class="form-control multi_location_company"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -790,11 +805,11 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="basementSI_${increment}">Basement Sum Insured</label>
|
<label for="basementSI_${increment}">Basement Utilisation</label>
|
||||||
<input type="text" id="basementSI_${increment}" name="basement_si[]" class="form-control"/>
|
<input type="text" id="basementSI_${increment}" name="basement_si[]" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="occupancy_${increment}">Occupancy<span class="text-danger">*</span></label>
|
<label for="occupancy_${increment}">Occupancy Risk<span class="text-danger">*</span></label>
|
||||||
<select id="occupancy_${increment}" name="occupancy[]" class="form-control" onchange="showRequiredFieldsBasedOnLocation('occupancy_${increment}')" required>
|
<select id="occupancy_${increment}" name="occupancy[]" class="form-control" onchange="showRequiredFieldsBasedOnLocation('occupancy_${increment}')" required>
|
||||||
<option value="">Select</option>
|
<option value="">Select</option>
|
||||||
${occupancyMaster.map(occupancy =>
|
${occupancyMaster.map(occupancy =>
|
||||||
@ -1067,17 +1082,17 @@
|
|||||||
|
|
||||||
var policyType;
|
var policyType;
|
||||||
|
|
||||||
if (totalSI<50000000){
|
if (totalSI < 50000000) {
|
||||||
policyType = "Bharat Sookshma Udyam Suraksha (BSUS)"
|
policyType = "Bharat Sookshma Udyam Suraksha (BSUS)"
|
||||||
} else if (totalSI > 50000000 && totalSI < 500000000){
|
} else if (totalSI > 50000000 && totalSI < 500000000) {
|
||||||
policyType = "Bharat Laghu Udyam Suraksha (BLUS)"
|
policyType = "Bharat Laghu Udyam Suraksha (BLUS)"
|
||||||
}else if (totalSI >500000000 ){
|
} else if (totalSI > 500000000) {
|
||||||
policyType = "Standard Fire and Special Perils (SFSP)";
|
policyType = "Standard Fire and Special Perils (SFSP)";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the initial JSON object with productSelection and policyDetails
|
// Build the initial JSON object with productSelection and policyDetails
|
||||||
var outputData = {
|
var outputData = {
|
||||||
policyType:policyType,
|
policyType: policyType,
|
||||||
productSelection: productSelectionData,
|
productSelection: productSelectionData,
|
||||||
policyDetails: policyDetailsData,
|
policyDetails: policyDetailsData,
|
||||||
locations: []
|
locations: []
|
||||||
@ -1127,18 +1142,19 @@
|
|||||||
// Save the updated data back to localStorage
|
// Save the updated data back to localStorage
|
||||||
localStorage.setItem('policyData', JSON.stringify(existingData));
|
localStorage.setItem('policyData', JSON.stringify(existingData));
|
||||||
if (!$.isEmptyObject(existingData)) {
|
if (!$.isEmptyObject(existingData)) {
|
||||||
|
|
||||||
// console.log("DATA FROM DB : ", (existingData));
|
// console.log("DATA FROM DB : ", (existingData));
|
||||||
let data = (existingData);
|
let data = (existingData);
|
||||||
Object.keys(data).forEach(key => {
|
Object.keys(data).forEach(key => {
|
||||||
|
|
||||||
policySummary[key] = addPolicySummaryTable(data[key], key);
|
policySummary[key] = addPolicySummaryTable(data[key], key);
|
||||||
prependTable(policySummary[key],key);
|
prependTable(policySummary[key], key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('.loader').fadeIn();
|
$('.loader').fadeIn();
|
||||||
$('.loader-mask').fadeIn();
|
$('.loader-mask').fadeIn();
|
||||||
toastr.success("Policy Information Collected ","SUCCESS");
|
toastr.success("Policy Information Collected ", "SUCCESS");
|
||||||
|
closeModal();
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
// console.log("Updated policy data in localStorage:", existingData);
|
// console.log("Updated policy data in localStorage:", existingData);
|
||||||
@ -1220,7 +1236,7 @@
|
|||||||
loadPolicyDataBack(data);
|
loadPolicyDataBack(data);
|
||||||
assignDataToFields(data);
|
assignDataToFields(data);
|
||||||
// alert("inside else");
|
// alert("inside else");
|
||||||
}else{
|
} else {
|
||||||
// alert("nothing");
|
// alert("nothing");
|
||||||
}
|
}
|
||||||
// console.log("policy data : ", data);
|
// console.log("policy data : ", data);
|
||||||
@ -1332,10 +1348,10 @@
|
|||||||
|
|
||||||
function assignLeadData() {
|
function assignLeadData() {
|
||||||
const lead_data = <?= json_encode(json_decode($lead_data['custom_fields'])) ?>;
|
const lead_data = <?= json_encode(json_decode($lead_data['custom_fields'])) ?>;
|
||||||
var clientName = <?= isset($lead_data['client_name']) ? json_encode($lead_data['client_name']) : ""?>;
|
var clientName = <?= isset($lead_data['client_name']) ? json_encode($lead_data['client_name']) : "" ?>;
|
||||||
var client_type = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
var client_type = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
||||||
var mobile = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
var mobile = <?= isset($lead_data['contact_person_mobile']) ? $lead_data['contact_person_mobile'] : "" ?>;
|
||||||
var email = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
var contact_email = "<?= isset($lead_data['contact_person_email']) ? $lead_data['contact_person_email'] : "" ?>";
|
||||||
var panNo = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
var panNo = <?= isset($lead_data['client_type']) ? $lead_data['client_type'] : "" ?>;
|
||||||
// console.log("client_type : ".client_type);
|
// console.log("client_type : ".client_type);
|
||||||
if (lead_data) {
|
if (lead_data) {
|
||||||
@ -1361,6 +1377,8 @@
|
|||||||
$("#client_type").val(client_type).trigger("change");
|
$("#client_type").val(client_type).trigger("change");
|
||||||
$("#insured_name").val(clientName);
|
$("#insured_name").val(clientName);
|
||||||
$("#address1").val(lead_data.address);
|
$("#address1").val(lead_data.address);
|
||||||
|
$("#mobile").val(mobile);
|
||||||
|
$("#email").val(contact_email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1429,4 +1447,17 @@
|
|||||||
hideAndShowBurglary();
|
hideAndShowBurglary();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(document).on('input', 'input[id^="pin_code"]', function() {
|
||||||
|
// alert("inside");
|
||||||
|
|
||||||
|
let value = $(this).val().replace(/\D/g, '').slice(0, 6);
|
||||||
|
$(this).val(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function closeModal() {
|
||||||
|
|
||||||
|
document.querySelector('#policyRegisterModel [data-dismiss="modal"]').click();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
28
app/Views/rfq/burglary.php
Normal file
28
app/Views/rfq/burglary.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="form-row custom_fields">
|
||||||
|
|
||||||
|
<!-- Risk Location -->
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label>Risk Location</label><br>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="radio" name="risk_location" value="single" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'single' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label">Single</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="radio" name="risk_location" value="multi_with_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_with_floter' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label">Multi with Floter</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="radio" name="risk_location" value="multi_without_floter" <?= isset($lead_edit_data['risk_location']) && $lead_edit_data['risk_location'] == 'multi_without_floter' ? 'checked' : ''; ?>>
|
||||||
|
<label class="form-check-label">Multi without Floter</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Address -->
|
||||||
|
<div class="form-group col-md-6">
|
||||||
|
<label for="address">Address</label>
|
||||||
|
<textarea class="form-control" id="address" name="address" rows="1"><?= isset($lead_edit_data['address']) ? htmlspecialchars($lead_edit_data['address']) : ''; ?></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div class="form-row custom_fields">
|
<div class="form-row custom_fields">
|
||||||
<!-- Risk Location -->
|
<!-- Risk Location -->
|
||||||
<div class="form-group col-md-6">
|
<!-- <div class="form-group col-md-6">
|
||||||
<label>Risk Location</label>
|
<label>Risk Location</label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<label class="form-check-label" for="multi_no_floater">Multi without Floater</label>
|
<label class="form-check-label" for="multi_no_floater">Multi without Floater</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<!-- Policy Period -->
|
<!-- Policy Period -->
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
|
|||||||
@ -536,7 +536,7 @@
|
|||||||
// alert(rollover_or_renewal);
|
// alert(rollover_or_renewal);
|
||||||
|
|
||||||
var policyConfig = {
|
var policyConfig = {
|
||||||
1: ['Quote asked']
|
1: ['Sum Insured']
|
||||||
};
|
};
|
||||||
|
|
||||||
let myModal;
|
let myModal;
|
||||||
@ -634,7 +634,7 @@
|
|||||||
let proposalCount = 1;
|
let proposalCount = 1;
|
||||||
// // console.log("Proposal count changed", proposalCount);
|
// // console.log("Proposal count changed", proposalCount);
|
||||||
let quotesConfig = {
|
let quotesConfig = {
|
||||||
1: ['Quote asked']
|
1: ['Sum Insured']
|
||||||
}; // Stores quote columns for each proposal
|
}; // Stores quote columns for each proposal
|
||||||
|
|
||||||
|
|
||||||
@ -1002,8 +1002,8 @@
|
|||||||
proposalCount++;
|
proposalCount++;
|
||||||
// // console.log("proposal count after ", proposalCount);
|
// // console.log("proposal count after ", proposalCount);
|
||||||
|
|
||||||
quotesConfig[proposalCount] = ['Quote asked'];
|
quotesConfig[proposalCount] = ['Sum Insured'];
|
||||||
policyConfig[proposalCount] = ['Quote asked'];
|
policyConfig[proposalCount] = ['Sum Insured'];
|
||||||
const tables = document.querySelectorAll('table');
|
const tables = document.querySelectorAll('table');
|
||||||
let increaseBy = 150;
|
let increaseBy = 150;
|
||||||
increaseTableWidth(increaseBy);
|
increaseTableWidth(increaseBy);
|
||||||
@ -1037,7 +1037,7 @@
|
|||||||
|
|
||||||
// Add new quote sub-header
|
// Add new quote sub-header
|
||||||
const newQuoteHeader = document.createElement('th');
|
const newQuoteHeader = document.createElement('th');
|
||||||
newQuoteHeader.textContent = 'Quote asked';
|
newQuoteHeader.textContent = 'Sum Insured';
|
||||||
newQuoteHeader.style.backgroundColor = randomColor;
|
newQuoteHeader.style.backgroundColor = randomColor;
|
||||||
headerRow2.insertBefore(newQuoteHeader, headerRow2.querySelector('th:last-child'));
|
headerRow2.insertBefore(newQuoteHeader, headerRow2.querySelector('th:last-child'));
|
||||||
|
|
||||||
@ -1593,7 +1593,7 @@
|
|||||||
<th>-</th>
|
<th>-</th>
|
||||||
${Object.entries(quotesConfig).flatMap(([proposal, codes]) =>
|
${Object.entries(quotesConfig).flatMap(([proposal, codes]) =>
|
||||||
codes.map(code => `
|
codes.map(code => `
|
||||||
<th data-proposal="${proposal}" data-quote="${code}" class="${code !== 'Quote asked' ? 'insurer_proposal' : ''}">
|
<th data-proposal="${proposal}" data-quote="${code}" class="${code !== 'Sum Insured' ? 'insurer_proposal' : ''}">
|
||||||
${code}
|
${code}
|
||||||
<span class="three-dot-menu" onclick="showDropdown(event)">⋮</span>
|
<span class="three-dot-menu" onclick="showDropdown(event)">⋮</span>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
@ -1723,8 +1723,8 @@
|
|||||||
// }
|
// }
|
||||||
let subHeaderText = subHeaderTh ? subHeaderTh.textContent.trim() : '';
|
let subHeaderText = subHeaderTh ? subHeaderTh.textContent.trim() : '';
|
||||||
// // console.log("Subheader th: below code",subHeaderText);
|
// // console.log("Subheader th: below code",subHeaderText);
|
||||||
// Check if subheader is NOT "Quote asked"
|
// Check if subheader is NOT "Sum Insured"
|
||||||
let className = !subHeaderText.startsWith("Quote asked") && subHeaderText != "-" ?
|
let className = !subHeaderText.startsWith("Sum Insured") && subHeaderText != "-" ?
|
||||||
"insurer_proposal" : "";
|
"insurer_proposal" : "";
|
||||||
// console.log("className", className);
|
// console.log("className", className);
|
||||||
// alert(subHeaderText);
|
// alert(subHeaderText);
|
||||||
@ -1826,8 +1826,8 @@
|
|||||||
let subHeaderTh = validSubHeaders.find(th => th.textContent.trim());
|
let subHeaderTh = validSubHeaders.find(th => th.textContent.trim());
|
||||||
|
|
||||||
let subHeaderText = subHeaderTh ? subHeaderTh.textContent.trim() : '';
|
let subHeaderText = subHeaderTh ? subHeaderTh.textContent.trim() : '';
|
||||||
// Check if subheader is NOT "Quote asked"
|
// Check if subheader is NOT "Sum Insured"
|
||||||
let className = !subHeaderText.startsWith("Quote asked") && subHeaderText != "-" ?
|
let className = !subHeaderText.startsWith("Sum Insured") && subHeaderText != "-" ?
|
||||||
"insurer_proposal" : ""; // alert(subHeaderText);
|
"insurer_proposal" : ""; // alert(subHeaderText);
|
||||||
let defaultJsonString = typeof default_answers_array == "object" ? JSON.stringify(default_answers_array[0]) : String(default_answers_array);
|
let defaultJsonString = typeof default_answers_array == "object" ? JSON.stringify(default_answers_array[0]) : String(default_answers_array);
|
||||||
|
|
||||||
@ -2820,8 +2820,8 @@
|
|||||||
|
|
||||||
// if (!proposalNumber) return; // Skip if extraction fails
|
// if (!proposalNumber) return; // Skip if extraction fails
|
||||||
|
|
||||||
// Initialize with "Quote asked"
|
// Initialize with "Sum Insured"
|
||||||
result[proposalNumber] = ["Quote asked"];
|
result[proposalNumber] = ["Sum Insured"];
|
||||||
|
|
||||||
// Check if insurers exist and filter those with qcr = 1
|
// Check if insurers exist and filter those with qcr = 1
|
||||||
if (Array.isArray(proposalData.insurers)) {
|
if (Array.isArray(proposalData.insurers)) {
|
||||||
@ -2862,8 +2862,8 @@
|
|||||||
let proposal = overallColumnData[proposalKey];
|
let proposal = overallColumnData[proposalKey];
|
||||||
let insurersList = proposal.insurers.map(ins => ins.ins_name); // Extract insurer names
|
let insurersList = proposal.insurers.map(ins => ins.ins_name); // Extract insurer names
|
||||||
|
|
||||||
// Create output format: index { "Quote asked", ...insurers }
|
// Create output format: index { "Sum Insured", ...insurers }
|
||||||
quotesConfiguration[index] = ["Quote asked", ...insurersList];
|
quotesConfiguration[index] = ["Sum Insured", ...insurersList];
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -3032,13 +3032,13 @@
|
|||||||
|
|
||||||
if (lead_type == 1){
|
if (lead_type == 1){
|
||||||
td.onclick = () => getAnswer(table.id, tr.id);
|
td.onclick = () => getAnswer(table.id, tr.id);
|
||||||
if (cellData.subth != "Quote asked") {
|
if (cellData.subth != "Sum Insured") {
|
||||||
td.onclick = () => getAnswer(table.id, tr.id);
|
td.onclick = () => getAnswer(table.id, tr.id);
|
||||||
td.classList.add("insurer_proposal");
|
td.classList.add("insurer_proposal");
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
td.onclick = () => getAnswer(table.id, tr.id);
|
td.onclick = () => getAnswer(table.id, tr.id);
|
||||||
if (cellData.subth != "Quote asked") {
|
if (cellData.subth != "Sum Insured") {
|
||||||
td.onclick = () => getAnswer(table.id, tr.id);
|
td.onclick = () => getAnswer(table.id, tr.id);
|
||||||
td.classList.add("insurer_proposal");
|
td.classList.add("insurer_proposal");
|
||||||
}
|
}
|
||||||
@ -3246,7 +3246,7 @@
|
|||||||
const matchedInsurer = insurers.find(ins => ins.ins_name == subHeader);
|
const matchedInsurer = insurers.find(ins => ins.ins_name == subHeader);
|
||||||
|
|
||||||
|
|
||||||
if (subHeader != "Quote asked") {
|
if (subHeader != "Sum Insured") {
|
||||||
// // console.log("trying to find something : matchedInsurer", matchedInsurer);
|
// // console.log("trying to find something : matchedInsurer", matchedInsurer);
|
||||||
// // console.log("trying to find something :matchedInsurer stc ", matchedInsurer.stc);
|
// // console.log("trying to find something :matchedInsurer stc ", matchedInsurer.stc);
|
||||||
// // console.log("trying to find something : ", matchedInsurer.stc);
|
// // console.log("trying to find something : ", matchedInsurer.stc);
|
||||||
@ -3642,7 +3642,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function makeQuoteAskedColumnNonEditableorEditable() {
|
function makeQuoteAskedColumnNonEditableorEditable() {
|
||||||
// alert("Quote asked");
|
// alert("Sum Insured");
|
||||||
$("table").each(function() {
|
$("table").each(function() {
|
||||||
var table = $(this);
|
var table = $(this);
|
||||||
var subHeaderRow = table.find("tr:nth-child(2)"); // Assuming second row is the sub-header
|
var subHeaderRow = table.find("tr:nth-child(2)"); // Assuming second row is the sub-header
|
||||||
@ -3652,18 +3652,18 @@
|
|||||||
var colIndexTracker = []; // Maps visual column index to actual index
|
var colIndexTracker = []; // Maps visual column index to actual index
|
||||||
var visualIndex = 0; // Tracks the visual column position considering rowspan/colspan
|
var visualIndex = 0; // Tracks the visual column position considering rowspan/colspan
|
||||||
|
|
||||||
// Step 1: Find the "Quote asked" column index
|
// Step 1: Find the "Sum Insured" column index
|
||||||
subHeaderRow.children("th, td").each(function(actualIndex) {
|
subHeaderRow.children("th, td").each(function(actualIndex) {
|
||||||
colIndexTracker[visualIndex] = actualIndex;
|
colIndexTracker[visualIndex] = actualIndex;
|
||||||
|
|
||||||
if ($(this).text().trim() === "Quote asked") {
|
if ($(this).text().trim() === "Sum Insured") {
|
||||||
targetColumnIndexes.push(visualIndex);
|
targetColumnIndexes.push(visualIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
visualIndex += parseInt($(this).attr("colspan") || 1, 10);
|
visualIndex += parseInt($(this).attr("colspan") || 1, 10);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (targetColumnIndexes === 0) return; // If "Quote asked" column is not found, exit
|
if (targetColumnIndexes === 0) return; // If "Sum Insured" column is not found, exit
|
||||||
|
|
||||||
// Step 2: Make all cells in the found column non-editable, considering rowspan
|
// Step 2: Make all cells in the found column non-editable, considering rowspan
|
||||||
var rowSpans = {}; // Keeps track of rowspans per column
|
var rowSpans = {}; // Keeps track of rowspans per column
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user