FIX_VALIDATION_FOR_RISK_SPLITUP

This commit is contained in:
Srinivas-Saravanan 2025-05-09 10:49:14 +05:30
parent fb349a8f02
commit 9fd830f21d

View File

@ -425,10 +425,10 @@
}
// console.log("form from : ", formDataSplitUp);
if (productSelectionData.multipleProduct == 'on') {
let selectionType = productSelectionData.multilocation_type;
// if (productSelectionData.multipleProduct == 'on') {
// let selectionType = productSelectionData.multilocation_type;
if (selectionType == 'multiFloater') {
// 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);
@ -456,16 +456,16 @@
return false;
}
// console.log("Total SI: ", totalSI);
} else {
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);
// } else {
// 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);
}
}
// totalSI = InProcess.reduce((acc, val) => acc + val, 0) +
// rawMaterial.reduce((acc, val) => acc + val, 0) +
// findMaterial.reduce((acc, val) => acc + val, 0);
// }
// }
// console.log("Form is trying to submit : ", formDataSplitUp);
@ -657,17 +657,32 @@
// alert("you got ir");
console.log("increment2",increment2);
console.log("policyRiskAddress.length",policyRiskAddress.length);
if (increment2 <= policyRiskAddress.length) {
policyRiskAddress.forEach(function() {
// console.log("increment count is ", increment2)
addHTMLInputForRiskSplitUP();
validatePolicyBasedOnProductSelection();
hideAndShowBurglary();
if (increment2 <= policyRiskAddress.length) {
// console.log("increment count is ", increment2)
addHTMLInputForRiskSplitUP();
validatePolicyBasedOnProductSelection();
hideAndShowBurglary();
}
})
}else {
alert("fdg");
}
}
// else {
// const container = document.getElementById("addRiskSplitUp");
// container.innerHTML = "";
// increment2 = 1;
// if (increment2 <= policyRiskAddress.length) {
// policyRiskAddress.forEach(function() {
// // console.log("increment count is ", increment2)
// addHTMLInputForRiskSplitUP();
// validatePolicyBasedOnProductSelection();
// hideAndShowBurglary();
// // increment2++;
// })
// // alert("fdg");
// }
// }
}
} else {
if (contianertoCheck.innerHTML == "") {
addHTMLInputForRiskSplitUpWarninig();