Personalized Financial Milestone Budget Tracker
Setup & Milestones
Financial Milestones
Add New Milestone
Income & Expenses (Monthly)
Income
Add Income Source
Total Monthly Income: $0.00
Expenses
Add Expense Item
Total Monthly Expenses: $0.00
Net Monthly Savings: $0.00
Track Contributions
Contributions Log for: N/A
Summary & Overview
Milestone Progress
Budget Summary (Monthly)
Total Income: $0.00
Total Expenses: $0.00
Net Savings: $0.00
Target Date: ${m.targetDate}
` : ''}`; milestonesSummaryContainer.appendChild(summaryDiv); }); } function renderAllSummaries() { calculateAndRenderBudgetSummary(); // Updates budget part in summary too renderMilestonesSummary(); } // --- PDF Download Function --- function downloadPDF() { const userName = userNameInput.value.trim(); let pdfHtml = `
Personalized Financial Milestone Budget Tracker
`; if (userName) { pdfHtml += `Prepared for: ${userName}
`; } pdfHtml += `Date: ${new Date().toLocaleDateString()}
`; // Milestones Data if (appData.milestones.length > 0) { pdfHtml += `Milestones Overview
`; pdfHtml += `| Milestone | Target ($) | Saved ($) | Remaining ($) | Progress |
|---|---|---|---|---|
| ${m.name} ${m.targetDate ? `(Target: ${m.targetDate})` : ''} | ${formatCurrency(m.target)} | ${formatCurrency(m.saved)} | ${formatCurrency(remaining)} |
${progress.toFixed(1)}%
|
Milestones Overview
No milestones defined.
`; } // Budget Data const totalIncome = appData.incomeSources.reduce((sum, item) => sum + item.amount, 0); const totalExpenses = appData.expenses.reduce((sum, item) => sum + item.amount, 0); const netSavings = totalIncome - totalExpenses; const netSavingsClass = netSavings >= 0 ? 'text-success' : 'text-danger'; pdfHtml += `Budget Summary (Monthly)
`; pdfHtml += `Total Income: $${formatCurrency(totalIncome)}
`; pdfHtml += `Total Expenses: $${formatCurrency(totalExpenses)}
`; pdfHtml += `Net Savings: $${formatCurrency(netSavings)}
`; // Optionally list income/expense items if(appData.incomeSources.length > 0){ pdfHtml += `Income Sources:
- `;
appData.incomeSources.forEach(inc => { pdfHtml += `
- ${inc.name}: $${formatCurrency(inc.amount)} `; }); pdfHtml += `
Expense Items:
- `;
appData.expenses.forEach(exp => { pdfHtml += `
- ${exp.name}: $${formatCurrency(exp.amount)} `; }); pdfHtml += `
