Prepared for Legal Counsel | Date: ${new Date().toLocaleDateString()}
`;
// I. Testator & Family
html += `
I. Testator & Family Details
`;
html += `
| Testator Name | ${data.name} |
| Spouse Name | ${data.spouse} |
| State of Residency | ${data.state} |
| Minor Children | ${data.minors} |
`;
// II. Representatives
html += `
II. Executors and Guardians
`;
html += `
| Executor | ${data.executor} |
| Contingent Executor | ${data.contExecutor} |
| Guardian (Minor Children) | ${data.guardian} |
| Contingent Guardian | ${data.contGuardian} |
`;
// III. Assets
html += `
III. Assets (Real Property, Investments, Major Accounts)
`;
html += `
| Type |
Location / Institution |
Est. Value (USD) |
${data.assets.map(a => `| ${a[0]} | ${a[1]} | ${a[2]} |
`).join('') || `| No major assets listed. |
`}
`;
// IV. Liabilities
html += `
IV. Liabilities & Debts
`;
html += `
| Type of Debt |
Creditor / Institution |
Approx. Amount (USD) |
${data.liabilities.map(l => `| ${l[0]} | ${l[1]} | ${l[2]} |
`).join('') || `| No major liabilities listed. |
`}
`;
// V. Bequests
html += `
V. Specific Bequests and Beneficiaries
`;
html += `
| Recipient |
Specific Gift |
Contingent Beneficiary |
${data.bequests.map(b => `| ${b[0]} | ${b[1]} | ${b[2]} |
`).join('') || `| No specific bequests listed (Residue Clause will apply). |
`}
`;
container.innerHTML = html;
}
function wticSwitchTab(tabId) {
document.querySelectorAll('.wtic-tab-btn').forEach(b => b.classList.remove('active'));
document.querySelectorAll('.wtic-content').forEach(c => c.classList.remove('active'));
const idx = tabId === 'builder' ? 0 : 1;
document.querySelectorAll('.wtic-tab-btn')[idx].classList.add('active');
document.getElementById('wtic-' + tabId).classList.add('active');
if (tabId === 'preview') {
wticRenderChecklist();
}
}
function wticLoadExample() {
if(!confirm("Overwrite current data with example estate details?")) return;
document.getElementById('inp-name').value = "David M. Reynolds";
document.getElementById('inp-spouse').value = "Eleanor K. Reynolds";
document.getElementById('inp-state').value = "Florida";
document.getElementById('inp-minors').value = "0";
document.getElementById('inp-executor').value = "Eleanor K. Reynolds, 777 Palm Dr, Miami, FL";
document.getElementById('inp-cont-executor').value = "Brother, Daniel Reynolds, 440 Oak St, Atlanta, GA";
document.getElementById('inp-guardian').value = "N/A";
document.getElementById('inp-cont-guardian').value = "N/A";
// Clear and fill rows
document.getElementById('wtic-asset-rows-container').innerHTML = '';
document.getElementById('wtic-liability-rows-container').innerHTML = '';
document.getElementById('wtic-beneficiary-rows-container').innerHTML = '';
wticAddAssetRow("Investment Account", "Fidelity Brokerage, Acct #1234", "Estimate $550,000");
wticAddAssetRow("Vacation Condo", "22 Ocean View Dr, Sarasota, FL", "Estimate $350,000");
wticAddLiabilityRow("Home Equity Line of Credit (HELOC)", "Wells Fargo", "$50,000");
wticAddBeneficiaryRow("Nephew, Ethan R. Chen", "All shares of Apple Stock (AAPL)", "Contingent Beneficiary: Niece, Emma S. Chen");
wticAddBeneficiaryRow("Local Animal Shelter", "$10,000 cash bequest", "N/A");
wticRenderChecklist();
wticSwitchTab('preview');
}
/* --- PDF Generation --- */
async function wticGeneratePDF() {
wticRenderChecklist(); // Final render
const data = {
name: document.getElementById('inp-name').value || "[TESTATOR NAME]",
spouse: document.getElementById('inp-spouse').value || "N/A",
state: document.getElementById('inp-state').value || "N/A",
minors: document.getElementById('inp-minors').value || "0",
executor: document.getElementById('inp-executor').value || "N/A",
contExecutor: document.getElementById('inp-cont-executor').value || "N/A",
guardian: document.getElementById('inp-guardian').value || "N/A",
contGuardian: document.getElementById('inp-cont-guardian').value || "N/A",
assets: wticGetRowData('#wtic-asset-rows-container .wtic-dynamic-row'),
liabilities: wticGetRowData('#wtic-liability-rows-container .wtic-dynamic-row'),
bequests: wticGetRowData('#wtic-beneficiary-rows-container .wtic-dynamic-row')
};
const { jsPDF } = window.jspdf;
const doc = new jsPDF('p', 'mm', 'a4');
const green = [0, 100, 0];
let y = 20;
// 1. Header
doc.setFillColor(...green);
doc.rect(0, 0, 210, 20, 'F');
doc.setTextColor(255, 255, 255);
doc.setFontSize(16);
doc.text("Estate Planning Information Checklist", 14, 13);
// 2. Metadata Block
y = 30;
doc.setTextColor(0, 0, 0);
doc.setFontSize(10);
doc.setFont("helvetica", "bold");
doc.text("Testator Name:", 14, y);
doc.text("State of Residency:", 105, y);
y += 5;
doc.setFont("helvetica", "normal");
doc.text(data.name, 14, y);
doc.text(data.state, 105, y);
y += 10;
// Helper function for general tables
const addSectionTable = (title, startY, header, body) => {
doc.setFontSize(12);
doc.setFont("helvetica", "bold");
doc.setTextColor(...green);
doc.text(title, 14, startY);
startY += 5;
doc.autoTable({
startY: startY,
head: [header],
body: body,
theme: 'grid',
headStyles: { fillColor: green, fontSize: 10 },
styles: { fontSize: 9 },
columnStyles: { 0: { cellWidth: 30, fontStyle: 'bold' } }
});
return doc.lastAutoTable.finalY + 10;
};
// 3. Representatives
const repsBody = [
['Executor', data.executor],
['Contingent Executor', data.contExecutor],
['Guardian (Minors)', data.guardian],
['Contingent Guardian', data.contGuardian]
];
y = addSectionTable("II. Executors and Guardians", y, ['Role', 'Name and Contact'], repsBody);
// 4. Assets
const assetsHeader = ['Type', 'Location / Institution', 'Est. Value (USD)'];
y = addSectionTable("III. Assets", y, assetsHeader, data.assets);
// 5. Liabilities
const liabilitiesHeader = ['Type of Debt', 'Creditor / Institution', 'Approx. Amount (USD)'];
y = addSectionTable("IV. Liabilities & Debts", y, liabilitiesHeader, data.liabilities);
// 6. Bequests
const bequestsHeader = ['Recipient', 'Specific Gift', 'Contingent Beneficiary'];
y = addSectionTable("V. Specific Bequests and Beneficiaries", y, bequestsHeader, data.bequests);
// 7. Signature Block
y += 10;
if (y > 270) { doc.addPage(); y = 20; }
doc.setFontSize(10);
doc.text("Testator Signature: ___________________________", 14, y);
doc.text("Date Reviewed: _______________", 140, y);
doc.save(`EstatePlan_Checklist_${data.name.replace(/\s/g, '_')}.pdf`);
}