Debt Payoff Planner

Debt Payoff Planner

Visualize your path to becoming debt-free.

1. List Your Debts

2. Extra Monthly Payment

Add an extra amount to your total monthly payments to get out of debt faster.

$

Your debt payoff summary and amortization schedules will appear here.

No debts to display.

`; return; } const debtNames = schedule[0].debts.map(d => d.name); let table = `${debtNames.map(n => ``).join('')}`; schedule.forEach(row => { table += ` ${row.debts.map(d => ``).join('')} `; }); table += `
Month${n}
${row.month}${d.balance > 0 ? formatCurrency(d.balance) : '-'}
`; container.innerHTML = table; } const resultTabs = ['summary', 'snowball', 'avalanche']; resultTabs.forEach(id => { document.getElementById(`${id}-tab`).addEventListener('click', () => switchTab(id)); }); function switchTab(activeId) { resultTabs.forEach(id => { document.getElementById(`${id}-tab`).classList.toggle('active', id === activeId); document.getElementById(`${id}-content`).classList.toggle('hidden', id !== activeId); }); } window.generatePdf = function() { if (!snowballResult || !avalancheResult) { alert('Please calculate a plan first.'); return; } const { jsPDF } = window.jspdf; const pdf = new jsPDF(); let yPos = 15; pdf.setFontSize(20); pdf.setFont('helvetica', 'bold'); pdf.text('Debt Payoff Plan Report', 105, yPos, { align: 'center' }); yPos += 15; // Summary Table pdf.setFontSize(14); pdf.text('Strategy Comparison', 15, yPos); yPos += 5; pdf.autoTable({ startY: yPos, head: [['Strategy', 'Payoff Date', 'Total Interest Paid']], body: [ ['Debt Snowball', document.getElementById('snowball-payoff-date').textContent, document.getElementById('snowball-total-interest').textContent], ['Debt Avalanche', document.getElementById('avalanche-payoff-date').textContent, document.getElementById('avalanche-total-interest').textContent], ], theme: 'grid', headStyles: { fillColor: '#3b82f6' } }); yPos = pdf.lastAutoTable.finalY + 15; // Snowball Amortization pdf.addPage(); yPos = 15; pdf.setFontSize(14); pdf.text('Debt Snowball Amortization Schedule', 15, yPos); yPos += 5; pdf.autoTable({ html: '#snowball-table table', startY: yPos, theme: 'striped' }); // Avalanche Amortization pdf.addPage(); yPos = 15; pdf.setFontSize(14); pdf.text('Debt Avalanche Amortization Schedule', 15, yPos); yPos += 5; pdf.autoTable({ html: '#avalanche-table table', startY: yPos, theme: 'striped' }); pdf.save('Debt-Payoff-Plan.pdf'); } });
Scroll to Top