Investment Compliance Verification Tool

Investment Compliance Verification Tool

Verify your portfolio against key US investment compliance standards.

Investor & Portfolio Details

$
$
$

${issue.question}

Compliance Note:

${issue.note}

`; }); reportHtml += `
`; } } if (!issuesFound) { reportHtml += `

No Compliance Issues Flagged

Based on the provided information, no common compliance issues were identified. Always consult with a qualified professional for formal advice.

`; } document.getElementById('report-preview').innerHTML = reportHtml; document.getElementById('download-container').classList.remove('hidden'); lucide.createIcons(); }; // --- UI & NAVIGATION --- const updateNavButtons = () => { prevBtn.disabled = currentTab === '1'; nextBtn.disabled = currentTab === '3'; prevBtn.classList.toggle('opacity-50', prevBtn.disabled); nextBtn.classList.toggle('opacity-50', nextBtn.disabled); }; window.switchTab = (tabId) => { if (currentTab === '1' && tabId !== '1') { if (!document.getElementById('investorName').value) { alert('Please enter an Investor/Entity Name to proceed.'); return; } } currentTab = tabId; tabs.forEach(id => { document.getElementById(`tab-content-${id}`).classList.toggle('hidden', id !== currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-active', id === currentTab); document.getElementById(`tab-btn-${id}`).classList.toggle('tab-inactive', id !== currentTab); }); if (tabId === '3') { generateReport(); } updateNavButtons(); }; const navigateTabs = (direction) => { const currentIndex = tabs.indexOf(currentTab); let nextIndex = currentIndex + direction; if (nextIndex >= 0 && nextIndex < tabs.length) { switchTab(tabs[nextIndex]); } }; // --- PDF GENERATION --- const downloadPdf = () => { const { jsPDF } = window.jspdf; const doc = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const investorName = document.getElementById('investorName').value || 'N/A'; doc.setFontSize(18); doc.text("Investment Compliance Verification Report", 40, 60); doc.setFontSize(12); doc.text(`Investor/Entity: ${investorName}`, 40, 80); const tableData = []; let issuesFound = false; for (const category in checklistData) { let hasIssueInCategory = false; checklistData[category].forEach(item => { if (checklistAnswers[item.id] === item.answer) { issuesFound = true; if (!hasIssueInCategory) { tableData.push([{ content: category, colSpan: 2, styles: { fontStyle: 'bold', fillColor: '#f3f4f6' } }]); hasIssueInCategory = true; } tableData.push([ { content: `Flagged Item: ${item.question}`, styles: { fontStyle: 'bold' }}, { content: `Compliance Note: ${item.note}` } ]); } }); } if (issuesFound) { doc.autoTable({ startY: 100, head: [['Potential Issue Area', 'Guideline/Note']], body: tableData, theme: 'grid', headStyles: { fillColor: [59, 130, 246] }, didParseCell: (data) => { if (data.cell.section === 'body' && data.cell.raw.colSpan) { data.cell.styles.halign = 'center'; } } }); } else { doc.setFontSize(14); doc.setTextColor(34, 139, 34); doc.text("No Compliance Issues Flagged", 40, 120); doc.setTextColor(0, 0, 0); doc.setFontSize(11); doc.text("Based on the provided information, no common compliance issues were identified.", 40, 140); } doc.save(`Investment_Compliance_Report_${investorName.replace(/\s/g, '_')}.pdf`); }; // --- EVENT LISTENERS & INITIAL SETUP --- prevBtn.addEventListener('click', () => navigateTabs(-1)); nextBtn.addEventListener('click', () => navigateTabs(1)); document.getElementById('download-pdf-btn').addEventListener('click', downloadPdf); generateChecklist(); updateNavButtons(); lucide.createIcons(); });
Scroll to Top