Personal & Business Insurance Law Compliance Guide

Personal & Business Insurance Law Compliance Guide

Assess your insurance practices against key legal and regulatory standards.

Select Your Profile

Step 1 of 3

${assessment}

Actionable Recommendations

${recommendations.length === 0 ? '

Excellent! Your responses indicate good alignment with key compliance standards.

' : `
    ${recommendations.map(r => `
  • Issue: A 'No' was indicated for: '${r.text}'
    Recommendation: ${r.recommendation}
  • `).join('')}
`}
`; getEl('report-container').innerHTML = html; showTab(3); } function downloadPdf() { if (!appData.guideResults) { alert('Please generate a report first.'); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(18); doc.text("Insurance Compliance Report", 105, 20, { align: 'center' }); doc.setFontSize(11); doc.text("Assessment Profile", 14, 35); doc.setFontSize(10); const profileText = `Profile: ${appData.profileType.charAt(0).toUpperCase() + appData.profileType.slice(1)}\nInsurance: ${appData.insuranceTypeName}\nState: ${appData.state}`; doc.text(profileText, 14, 42); const score = appData.guideResults.reduce((sum, item) => sum + item.answer, 0); const total = appData.guideResults.length; const percentage = total > 0 ? Math.round((score / total) * 100) : 100; doc.setFontSize(11); doc.text(`Overall Compliance Score: ${percentage}%`, 14, 65); const tableBody = appData.guideResults.map(r => [r.text, r.answer === 1 ? 'Yes' : 'No']); doc.autoTable({ startY: 75, head: [['Compliance Checkpoint', 'Response']], body: tableBody, theme: 'grid', headStyles: { fillColor: [13, 148, 136] }, didParseCell: function(data) { if (data.section === 'body' && data.column.index === 1 && data.cell.raw === 'No') { data.cell.styles.textColor = [220, 53, 69]; } } }); let finalY = doc.autoTable.previous.finalY + 15; const recommendations = appData.guideResults.filter(r => r.answer === 0); if(recommendations.length > 0) { doc.setFontSize(11); doc.text("Recommendations", 14, finalY); const recText = recommendations.map(r => `- Issue: ${r.text}\n Recommendation: ${r.recommendation}`).join('\n\n'); doc.setFontSize(9); doc.text(recText, 14, finalY + 7, { maxWidth: 180 }); } doc.save(`Insurance-Compliance-Report.pdf`); } // --- Event Listeners --- document.querySelectorAll('input[name="profileType"]').forEach(radio => { radio.addEventListener('change', handleProfileTypeChange); }); nextBtn.addEventListener('click', () => { saveTabData(); if (currentTab < totalTabs - 1) { populateGuide(); showTab(currentTab + 1); } else { const form = getEl('form-guide'); if (form && !form.checkValidity()) { form.reportValidity(); return; } generateReport(); } }); prevBtn.addEventListener('click', () => { if (currentTab > 1) { showTab(currentTab - 1); } }); getEl('download-pdf-btn').addEventListener('click', downloadPdf); // --- Initialization --- handleProfileTypeChange(); updateNavigation(); });
Scroll to Top