FEAT_RFQ_NONEB
This commit is contained in:
parent
027bc8b4cf
commit
761f5cc9bb
@ -9,6 +9,7 @@
|
||||
</div>
|
||||
<input type="hidden" name="policyName" id="policyName">
|
||||
<input type="hidden" name="leadID" id="leadID">
|
||||
<input type="hidden" name="policySI" id="policySI">
|
||||
<div class="modal-body">
|
||||
<!-- Tabs Navigation -->
|
||||
<ul class="nav nav-pills navtab-bg nav-justified" id="policyTabs">
|
||||
@ -235,6 +236,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var totalSI;
|
||||
var finalData = {};
|
||||
console.log("policyName : ", $('#policyName').val());
|
||||
var policyName = $('#policyName').val();
|
||||
@ -356,6 +358,8 @@
|
||||
$("#policyRiskSplitUpForm").submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
|
||||
var isValid = $('#policyRiskSplitUpForm').parsley().validate();
|
||||
console.log('isValid', isValid);
|
||||
|
||||
@ -391,6 +395,28 @@
|
||||
}
|
||||
console.log("form from : ", formDataSplitUp);
|
||||
|
||||
if (productSelectionData.multipleProduct == 'on') {
|
||||
let selectionType = productSelectionData.multilocation_type;
|
||||
|
||||
if (selectionType == 'multiFloater') {
|
||||
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 findMaterial = [...document.querySelectorAll('[id^="finishedStock_"]')].map(el => Number(el.value) || 0);
|
||||
|
||||
totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
|
||||
rawMaterial.reduce((acc, val) => acc + val, 0) +
|
||||
findMaterial.reduce((acc, val) => acc + val, 0);
|
||||
|
||||
let allowedSI = Number($("#policySI").val()) || 0;
|
||||
|
||||
if (totalSI > allowedSI) {
|
||||
toastr.error("Sum Insured Exceeds Allowed Limit", "ERROR");
|
||||
return false;
|
||||
}
|
||||
console.log("Total SI: ", totalSI);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Form is trying to submit : ", formDataSplitUp);
|
||||
|
||||
const groupData = [];
|
||||
@ -637,15 +663,15 @@
|
||||
<div class = "row">
|
||||
<div class="form-group col-md-4 multi_location_company">
|
||||
<label for="stockInProcess_${increment2}">Stock In Process</label>
|
||||
<input type="text" id="stockInProcess_${increment2}" name="stock_in_process[]" class="form-control multi_location_company" />
|
||||
<input type="number" id="stockInProcess_${increment2}" name="stock_in_process[]" class="form-control multi_location_company" />
|
||||
</div>
|
||||
<div class="form-group col-md-4 multi_location_company">
|
||||
<label for="rawMaterial_${increment2}">Raw Material</label>
|
||||
<input type="text" 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 class="form-group col-md-4 multi_location_company">
|
||||
<label for="finishedStock_${increment2}">Finished Stock</label>
|
||||
<input type="text" 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>
|
||||
<hr>
|
||||
@ -1030,8 +1056,20 @@
|
||||
}
|
||||
|
||||
function registerPolicyData() {
|
||||
|
||||
var policyType;
|
||||
|
||||
if (totalSI<50000000){
|
||||
policyType = "Bharat Sookshma Udyam Suraksha (BSUS)"
|
||||
} else if (totalSI > 50000000 && totalSI < 500000000){
|
||||
policyType = "Bharat Laghu Udyam Suraksha (BLUS)"
|
||||
}else if (totalSI >500000000 ){
|
||||
policyType = "Standard Fire and Special Perils (SFSP)";
|
||||
}
|
||||
|
||||
// Build the initial JSON object with productSelection and policyDetails
|
||||
var outputData = {
|
||||
policyType:policyType,
|
||||
productSelection: productSelectionData,
|
||||
policyDetails: policyDetailsData,
|
||||
locations: []
|
||||
|
||||
@ -1833,8 +1833,12 @@
|
||||
console.log("inside if condition");
|
||||
|
||||
var leadID = $("#lead_id").val();
|
||||
let policy = policies.find(p => p.name === policyName);
|
||||
// alert(policy.quote_asked[0]);
|
||||
// var policySI = policies[]
|
||||
|
||||
$("#policyName").val(policyName);
|
||||
$("#policySI").val(policy.quote_asked[0]);
|
||||
$("#leadID").val(leadID);
|
||||
$("#multilocation_type_div").hide();
|
||||
$('.loader').fadeIn();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user