Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-03-28 18:47:24 +05:30
commit 9f6f7e815e

View File

@ -1783,16 +1783,19 @@
// // console.log("Subheader th: subHeaderThList",subHeaderThList);
// let validSubHeaders = subHeaderThList.filter(th => th.hasAttribute("data-proposal"));
// // console.log("Subheader th: validSubHeaders",validSubHeaders);
let subHeaderTh = validSubHeaders.find(th => th.textContent.trim() === codeValue) || null;
// // console.log("Subheader th: subHeaderTh",subHeaderTh);
// if (subHeaderTh.classList.contains("insurer_proposal")) {
// alert(subHeaderTh);
// }
// console.log("Subheader th: ",subHeaderTh);
let subHeaderTh = validSubHeaders.find(th => th.textContent.trim());
let subHeaderText = subHeaderTh ? subHeaderTh.textContent.trim() : '';
// // console.log("Subheader th: ",subHeaderText);
// Check if subheader is NOT "Quote asked"
let className = subHeaderText !== "Quote asked" && subHeaderText != "-" ? "insurer_proposal" : "";
// alert(subHeaderText);
let className = !subHeaderText.startsWith("Quote asked") && subHeaderText != "-" ?
"insurer_proposal" : ""; // alert(subHeaderText);
let defaultJsonString = typeof default_answers_array == "object" ? JSON.stringify(default_answers_array[0]) : String(default_answers_array);
// // // console.log("defaultJsonString", defaultJsonString);
@ -2135,8 +2138,9 @@
hiddenValue = updated_Text;
// alert(hiddenValue);
// Convert it back to a JSON string and set the value
hiddenInput.value = JSON.stringify(hiddenValue);
hiddenInput.value = hiddenValue;
// // console.log("Updated Hidden Input Value:", hiddenInput.value);
} else {
@ -2900,8 +2904,8 @@
proposalCountForTableINcrease * 150;
// console.log("Quotes COnfig : ",quotesConfig);
// console.log("policy COnfig :", policyConfig);
console.log("Quotes COnfig : ",quotesConfig);
console.log("policy COnfig :", policyConfig);
// // // console.log("trying to find checkbox data : : : ", increaseBy);
@ -3092,6 +3096,7 @@
// Parent header
const th1 = document.createElement('th');
th1.textContent = header.parentHeader;
// console.log("parent header : ",header.parentHeader);
if (header.parentHeader.startsWith('Proposal') || header.parentHeader.startsWith("Existing")) {
if (lead_type == 1){
headerName = header.parentHeader;
@ -3108,9 +3113,15 @@
// alert(headerName);
if (lead_type == 1){
// console.log("Header Name lead type 1 : ",header.parentHeader);
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName == key);
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key));
if (!matchedKey){
console.log("inside else");
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key));
}
// matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key));
proposalHTMLNumber = header.parentHeader.split(' ')[1];
// console.log('proposalHTMLNumber',proposalHTMLNumber)
}else{
// console.log("Header Name lead type not 1 : ",header.parentHeader);
@ -3119,7 +3130,13 @@
// console.log("Header Name lead type not 1 proposal: ",header.parentHeader);
var tempHeader = header.parentHeader;
matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader.startsWith(key));
matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader == key);
if (!matchedKey){
console.log("inside else");
matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader.startsWith(key));
}
// matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader.startsWith(key));
proposalHTMLNumber = 0;
}else{
@ -3130,9 +3147,15 @@
var tempHeader2 = lead_type == 2 ?"Existing Renewal 0":"Existing Roll Over 0";
matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader2.startsWith(key));
proposalHTMLNumber = 0;
// alert(tempHeader2);
}else if (header.parentHeader.startsWith("Proposal")){
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key));
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName == key);
if (!matchedKey){
console.log("inside else");
matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key));
}
proposalHTMLNumber = header.parentHeader.split(' ')[1];
}
@ -3143,6 +3166,7 @@
if (matchedKey) {
console.log(matchedKey);
// // console.log("something wrong : ", overallColumnDataProposal[matchedKey]);
var headerCheckBoxProperties = overallColumnDataProposal[matchedKey];
// // console.log("something wrong :headerCheckBoxProperties ", headerCheckBoxProperties);