From 8b17c74ba7f4d97f1c797eac31a8ba3a259e709c Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 28 Mar 2025 09:40:56 +0530 Subject: [PATCH 1/3] FIX_POLICY_INFO_GATHER --- app/Views/view_rfq_non_eb.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Views/view_rfq_non_eb.php b/app/Views/view_rfq_non_eb.php index d30969de..4dda6283 100644 --- a/app/Views/view_rfq_non_eb.php +++ b/app/Views/view_rfq_non_eb.php @@ -519,6 +519,7 @@ var storedData = {}; // // console.log("stored data : ", typeof(policyInformationData)) + localStorage.removeItem('policyData'); if (policyInformationData.length) { localStorage.setItem('policyData', (policyInformationData)); From 2c2768ef2f48f0dcb0f6389a23c32f6987c19d93 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 28 Mar 2025 10:18:02 +0530 Subject: [PATCH 2/3] FIX_PROPOSAL_HIDESHOW --- app/Views/view_rfq_non_eb.php | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/app/Views/view_rfq_non_eb.php b/app/Views/view_rfq_non_eb.php index 4dda6283..5a295b05 100644 --- a/app/Views/view_rfq_non_eb.php +++ b/app/Views/view_rfq_non_eb.php @@ -3095,19 +3095,19 @@ } var proposalHTMLNumber = ""; - console.log("Header Name : ",header.parentHeader); + // console.log("Header Name : ",header.parentHeader); // alert(headerName); if (lead_type == 1){ - console.log("Header Name lead type 1 : ",header.parentHeader); + // console.log("Header Name lead type 1 : ",header.parentHeader); matchedKey = Object.keys(overallColumnDataProposal).find(key => headerName.startsWith(key)); proposalHTMLNumber = header.parentHeader.split(' ')[1]; }else{ - console.log("Header Name lead type not 1 : ",header.parentHeader); + // console.log("Header Name lead type not 1 : ",header.parentHeader); if (rfq_count == 0 && header.parentHeader.startsWith("Proposal")){ - console.log("Header Name lead type not 1 proposal: ",header.parentHeader); + // console.log("Header Name lead type not 1 proposal: ",header.parentHeader); var tempHeader = header.parentHeader; matchedKey = Object.keys(overallColumnDataProposal).find(key => tempHeader.startsWith(key)); @@ -3115,7 +3115,7 @@ }else{ - console.log("Header Name lead type not 1 noy proposal: ",header.parentHeader); + // console.log("Header Name lead type not 1 noy proposal: ",header.parentHeader); if (header.parentHeader.startsWith("Existing")){ var tempHeader2 = lead_type == 2 ?"Existing Renewal 0":"Existing Roll Over 0"; @@ -3139,7 +3139,7 @@ // // console.log("something wrong :headerCheckBoxProperties ", headerCheckBoxProperties); } - + // console.log("Header checkbox Properties : ",headerCheckBoxProperties); th1.innerHTML = ` ${headerName} @@ -3168,9 +3168,9 @@ const th2 = document.createElement('th'); if (header.parentHeader.startsWith("Proposal") || header.parentHeader.startsWith("Existing")) { var insurers = overallColumnDataProposal[matchedKey].insurers; - // // console.log("trying to find something :header.parentHeader ", header.parentHeader); - // // console.log("trying to find something :insurers ", insurers); - // // console.log("trying to find : subHeader",subHeader) + // console.log("trying to find something :header.parentHeader ", header.parentHeader); + // console.log("trying to find something :insurers ", insurers); + // console.log("trying to find : subHeader",subHeader) const matchedInsurer = insurers.find(ins => ins.ins_name == subHeader); @@ -3388,7 +3388,7 @@ var proposal = getProposalsWithQCRZero(overallData); // // console.log("column to hide : ", proposal); proposal.forEach(function(prop) { - // // console.log("column prop : ", prop); + console.log("column prop : ", prop); hideColumn(prop); }) @@ -3402,14 +3402,15 @@ const mainHeaderRow = table.querySelector('thead tr:first-child'); let proposalHeader = null; let proposalColspan = 1; - let startColumnIndex = -1; + let startColumnIndex = 2; // Find the header matching the columnName and its position Array.from(mainHeaderRow.children).forEach((th, index) => { if (th.textContent.trim().startsWith(columnName)) { proposalHeader = th; proposalColspan = parseInt(th.getAttribute('colspan')) || 1; - startColumnIndex = index; // Starting index of the proposal header + // startColumnIndex = index; // Starting index of the proposal header + proposalNumber = parseInt(th.textContent.trim().replace(/\D/g, ""), 10); return; } }); @@ -3421,6 +3422,15 @@ // 2. Hide the main proposal header proposalHeader.style.display = "none"; + if (lead_type == 1){ + for (let i = 1; i < proposalNumber; i++) { + startColumnIndex += quotesConfig[i]?.length || 0; + } + }else{ + for (let i = 0; i < proposalNumber; i++) { + startColumnIndex += quotesConfig[i]?.length || 0; + } + } // 3. Find and hide all subheaders under this proposal const subHeaderRow = table.querySelector('thead tr:last-child'); @@ -3428,6 +3438,8 @@ // Calculate range of subheaders to hide (same colspan as proposal header) const endColumnIndex = startColumnIndex + proposalColspan - 1; + console.log("end col index : ",endColumnIndex); + for (let i = startColumnIndex; i <= endColumnIndex; i++) { if (subHeaders[i]) subHeaders[i].style.display = "none"; } @@ -3639,7 +3651,7 @@ } }); - // // console.log("Insurer names to make non-editable:", insNames); + console.log("Insurer names to make non-editable:", insNames); $("table").each(function() { var table = $(this); @@ -3653,7 +3665,7 @@ mainHeaderRow.children("th, td").each(function() { var cellText = $(this).text().trim(); var colspan = parseInt($(this).attr("colspan") || 1, 10); - + console.log("cellText",cellText); // Store the header text at this visual index for (var i = 0; i < colspan; i++) { headerMapping[visualIndex + i] = cellText; From 96ac988a7b7d9f6a149b377511f11845049fda09 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Fri, 28 Mar 2025 10:31:25 +0530 Subject: [PATCH 3/3] FIX_LENGTH_IN_RFQNONEB_SRI --- app/Views/view_rfq_non_eb.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/app/Views/view_rfq_non_eb.php b/app/Views/view_rfq_non_eb.php index 5a295b05..5b48d817 100644 --- a/app/Views/view_rfq_non_eb.php +++ b/app/Views/view_rfq_non_eb.php @@ -2849,11 +2849,20 @@ function getTotalCount(proposalDataArray) { let proposals = proposalDataArray.proposal_data.over_all_column_data; - let proposalCount = Object.keys(proposals).length; // Count proposals - let insurerCount = Object.values(proposals).reduce((sum, proposal) => { - return sum + (proposal.insurers ? proposal.insurers.length : 0); - }, 0); // Count insurers across all proposals + // Object.k(proposals) + // console.log("Proposal insurer keuys : ",proposals) + var proposalCount = 0; + var insurerCount = 0; + for (const key in proposals) { + if (proposals[key].qcr !== 0) { + proposalCount++; // Count proposals where qcr !== 0 + // Only count insurers if the proposal's qcr !== 0 + insurerCount += proposals[key].insurers + ? proposals[key].insurers.filter(insurer => insurer.qcr !== 0).length + : 0; + } + } return proposalCount + insurerCount; } @@ -3388,7 +3397,7 @@ var proposal = getProposalsWithQCRZero(overallData); // // console.log("column to hide : ", proposal); proposal.forEach(function(prop) { - console.log("column prop : ", prop); + // console.log("column prop : ", prop); hideColumn(prop); }) @@ -3438,7 +3447,7 @@ // Calculate range of subheaders to hide (same colspan as proposal header) const endColumnIndex = startColumnIndex + proposalColspan - 1; - console.log("end col index : ",endColumnIndex); + // console.log("end col index : ",endColumnIndex); for (let i = startColumnIndex; i <= endColumnIndex; i++) { if (subHeaders[i]) subHeaders[i].style.display = "none"; @@ -3651,7 +3660,7 @@ } }); - console.log("Insurer names to make non-editable:", insNames); + // console.log("Insurer names to make non-editable:", insNames); $("table").each(function() { var table = $(this); @@ -3664,8 +3673,11 @@ mainHeaderRow.children("th, td").each(function() { var cellText = $(this).text().trim(); + if (cellText.startsWith("Existing")){ + cellText = lead_type == 2 ?"Existing Renewal 0":"Existing Roll Over 0"; + } var colspan = parseInt($(this).attr("colspan") || 1, 10); - console.log("cellText",cellText); + // console.log("cellText",cellText); // Store the header text at this visual index for (var i = 0; i < colspan; i++) { headerMapping[visualIndex + i] = cellText;