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); // console.log("form from : ", formDataSplitUp);
if (productSelectionData.multipleProduct == 'on') { // if (productSelectionData.multipleProduct == 'on') {
let selectionType = productSelectionData.multilocation_type; // let selectionType = productSelectionData.multilocation_type;
if (selectionType == 'multiFloater') { // if (selectionType == 'multiFloater') {
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);
@ -456,16 +456,16 @@
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);
} // }
} // }
// console.log("Form is trying to submit : ", formDataSplitUp); // console.log("Form is trying to submit : ", formDataSplitUp);
@ -657,17 +657,32 @@
// alert("you got ir"); // alert("you got ir");
console.log("increment2",increment2); console.log("increment2",increment2);
console.log("policyRiskAddress.length",policyRiskAddress.length); console.log("policyRiskAddress.length",policyRiskAddress.length);
if (increment2 <= policyRiskAddress.length) {
policyRiskAddress.forEach(function() { policyRiskAddress.forEach(function() {
// console.log("increment count is ", increment2) if (increment2 <= policyRiskAddress.length) {
addHTMLInputForRiskSplitUP(); // console.log("increment count is ", increment2)
validatePolicyBasedOnProductSelection(); addHTMLInputForRiskSplitUP();
hideAndShowBurglary(); validatePolicyBasedOnProductSelection();
hideAndShowBurglary();
}
}) })
}else { // else {
alert("fdg"); // 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 { } else {
if (contianertoCheck.innerHTML == "") { if (contianertoCheck.innerHTML == "") {
addHTMLInputForRiskSplitUpWarninig(); addHTMLInputForRiskSplitUpWarninig();