Illustrative Annual Percentage Rate (APR) Range for this profile could be around:
${selectedRange.low.toFixed(1)}% - ${selectedRange.high.toFixed(1)}%.
| Metric |
Based on Low End of Est. APR (${selectedRange.low.toFixed(1)}%) |
Based on High End of Est. APR (${selectedRange.high.toFixed(1)}%) |
| Est. Monthly Payment |
$${detailsLowAPR.monthlyPayment.toFixed(2)} |
$${detailsHighAPR.monthlyPayment.toFixed(2)} |
| Est. Total Interest Paid |
$${detailsLowAPR.totalInterest.toFixed(2)} |
$${detailsHighAPR.totalInterest.toFixed(2)} |
| Est. Total Loan Cost (Principal + Interest) |
$${detailsLowAPR.totalCost.toFixed(2)} |
$${detailsHighAPR.totalCost.toFixed(2)} |
`;
if (creditScoreKey !== "excellent" && csiplLastEstimationData.comparison.moreInterestThanExcellent > 0) {
outputHTML += `
Illustrative Cost Comparison:
Compared to an 'Excellent' credit profile (which might secure an APR around ${excellentRange.low.toFixed(1)}%),
if your APR is at the higher end of your estimated range (${selectedRange.high.toFixed(1)}%), you could potentially pay around
$${csiplLastEstimationData.comparison.moreInterestThanExcellent.toFixed(2)}
more in total interest over the life of this example loan.
`;
}
resultsOutputEl.innerHTML = outputHTML;
}
function csiplDownloadPDF() {
if (!csiplLastEstimationData) {
alert("Please generate estimates first.");
csiplNavigateTab('csiplEstResultsTab'); csiplEstimateAPRCosts();
if (!csiplLastEstimationData) return;
}
const { jsPDF } = window.jspdf;
const doc = new jsPDF();
const { inputs, estimatedAprRange, results, comparison } = csiplLastEstimationData;
const primaryColor = [0, 121, 107];
let y = 15;
doc.setFontSize(16); doc.setTextColor(primaryColor[0], primaryColor[1], primaryColor[2]);
doc.text("Credit Score Impact on Personal Loan Rates", doc.internal.pageSize.getWidth() / 2, y, { align: 'center' });
y += 8;
doc.setFontSize(8); doc.setTextColor(100);
doc.text("General estimates for illustrative purposes only. Not financial advice or actual loan offers.", doc.internal.pageSize.getWidth() / 2, y, { align: 'center' });
y += 10;
doc.setFontSize(11); doc.setTextColor(51, 51, 51);
doc.text(`Loan Amount: $${inputs.loanAmount.toLocaleString()}`, 14, y);
doc.text(`Loan Term: ${inputs.loanTermYears} years`, 100, y); y += 7;
doc.text(`Self-Assessed Credit Profile: ${inputs.creditScoreText}`, 14, y); y += 7;
doc.setFont(undefined, 'bold');
doc.text(`Illustrative APR Range for this Profile: ${estimatedAprRange.low.toFixed(1)}% - ${estimatedAprRange.high.toFixed(1)}%`, 14, y);
doc.setFont(undefined, 'normal'); y += 10;
const head = [['Metric', `Based on Low Est. APR (${estimatedAprRange.low.toFixed(1)}%)`, `Based on High Est. APR (${estimatedAprRange.high.toFixed(1)}%)`]];
const body = [
['Est. Monthly Payment', `$${results.low.monthlyPayment.toFixed(2)}`, `$${results.high.monthlyPayment.toFixed(2)}`],
['Est. Total Interest Paid', `$${results.low.totalInterest.toFixed(2)}`, `$${results.high.totalInterest.toFixed(2)}`],
['Est. Total Loan Cost', `$${results.low.totalCost.toFixed(2)}`, `$${results.high.totalCost.toFixed(2)}`]
];
doc.autoTable({ startY: y, head: head, body: body, theme: 'grid',
headStyles: { fillColor: primaryColor, textColor: [255,255,255] },
columnStyles: { 0: { cellWidth: 60 }, 1: { halign: 'right' }, 2: { halign: 'right' } }
});
y = doc.lastAutoTable.finalY + 10;
if (inputs.creditScoreKey !== "excellent" && comparison.moreInterestThanExcellent > 0) {
doc.setFont(undefined, 'bold'); doc.setTextColor(51,51,51);
doc.text("Illustrative Cost Comparison:", 14, y); y += 6;
doc.setFont(undefined, 'normal');
const excellentRange = csiplAprRanges.excellent;
const compText = `Compared to an 'Excellent' credit profile (est. APR around ${excellentRange.low.toFixed(1)}%), if your APR is ${estimatedAprRange.high.toFixed(1)}%, you might pay around $${comparison.moreInterestThanExcellent.toFixed(2)} more in total interest.`;
const splitText = doc.splitTextToSize(compText, doc.internal.pageSize.getWidth() - 28);
doc.text(splitText, 14, y); y += (splitText.length * 5) + 5;
}
if (y > 250) { doc.addPage(); y = 20; }
doc.setFontSize(9); doc.setTextColor(120);
const footerText = "APRs vary based on lender, creditworthiness, income, DTI, loan amount/term, and market conditions. Origination fees can affect APR. Always compare actual lender offers.";
const splitFooter = doc.splitTextToSize(footerText, doc.internal.pageSize.getWidth() - 28);
doc.text(splitFooter, 14, y);
doc.save("Personal_Loan_Credit_Impact.pdf");
}
csiplUpdateNavButtons();
window.csiplSwitchTab = csiplSwitchTab;
window.csiplNavigateTab = csiplNavigateTab;
window.csiplEstimateAPRCosts = csiplEstimateAPRCosts;
window.csiplDownloadPDF = csiplDownloadPDF;