Credit Impact on Budget Report
`; pdfHtml += `${dataToExport.inputs.type} Analysis
`; pdfHtml += `Input Parameters:
`; if (dataToExport.inputs.type === 'Credit Card APR') { pdfHtml += `Average Balance Carried: $${dataToExport.inputs.balance.toFixed(2)}
`; } else { pdfHtml += `Loan Amount: $${dataToExport.inputs.amount.toFixed(2)}
Loan Term: ${dataToExport.inputs.termYears.toFixed(1)} years (${dataToExport.inputs.termMonths} months)
`; } pdfHtml += `Rates Compared: Scenario A (${dataToExport.inputs.rates.A.toFixed(2)}%), Scenario B (${dataToExport.inputs.rates.B.toFixed(2)}%) ${dataToExport.inputs.rates.C > 0 ? `, Scenario C (${dataToExport.inputs.rates.C.toFixed(2)}%)` : ''}
Results Comparison:
`; if (dataToExport.inputs.type === 'Credit Card APR') { pdfHtml += `| Scenario | Est. Monthly Interest ($) | ||
|---|---|---|---|
| ${res.scenario} | ${res.monthlyInterest.toFixed(2)} |
| Scenario | Monthly Payment ($) | Total Interest Paid ($) | Total Loan Cost ($) |
|---|---|---|---|
| ${res.scenario} | ${res.monthlyPayment.toFixed(2)} | ${res.totalInterest.toFixed(2)} | ${res.totalCost.toFixed(2)} |
Budget Impact Summary (Scenario A vs. Scenario B):
`; if (dataToExport.inputs.type === 'Credit Card APR') { const diffAB = dataToExport.results[0].monthlyInterest - dataToExport.results[1].monthlyInterest; pdfHtml += `Scenario A has an estimated monthly interest cost $${Math.abs(diffAB).toFixed(2)} ${diffAB < 0 ? 'lower' : 'higher'} than Scenario B.
`; } else { const paymentDiffAB = dataToExport.results[1].monthlyPayment - dataToExport.results[0].monthlyPayment; const interestDiffAB = dataToExport.results[1].totalInterest - dataToExport.results[0].totalInterest; pdfHtml += `Scenario A's monthly payment is $${Math.abs(paymentDiffAB).toFixed(2)} ${paymentDiffAB > 0 ? 'lower' : 'higher'}.
`; pdfHtml += `Choosing Scenario A could ${interestDiffAB > 0 ? 'save' : 'cost an extra'} $${Math.abs(interestDiffAB).toFixed(2)} in total interest.
`; } pdfHtml += `