Alternative Fixed-Income Investment Tracker

Investment Setup

For reference and projection purposes.

Cash Flows & Current Status

Performance Summary

Please complete investment details and cash flow information, then click "Update & View Performance".

Current Status: ${actuals.currentStatus}

Data Last Updated: ${actuals.dateLastUpdated}

`; dlButton.style.display = 'block'; summaryTabLink.disabled = false; summaryTabLink.click(); } } window.afit_downloadPDF = function() { const { jsPDF } = window.jspdf; if (!jsPDF || !afit_investmentData.inputs || Object.keys(afit_investmentData.inputs).length === 0) { alert("PDF library not loaded or no data to export. Please track performance first."); return; } const doc = new jsPDF(); let yPos = 20; const lineHeight = 7; const indent = 5; const pageMargin = 15; const pageWidth = doc.internal.pageSize.getWidth(); const usableWidth = pageWidth - 2 * pageMargin; doc.setFontSize(18); doc.setTextColor(30, 58, 138); // #1e3a8a doc.text("Alternative Fixed-Income Investment Summary", pageWidth / 2, yPos, { align: 'center' }); yPos += lineHeight * 2.5; function addSection(title, dataObj) { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - 30) { doc.addPage(); yPos = pageMargin; } doc.setFontSize(13); doc.setFont(undefined, 'bold'); doc.setTextColor(37, 99, 235); // #2563eb doc.text(title, pageMargin, yPos); yPos += lineHeight * 1.5; doc.setFontSize(10); doc.setFont(undefined, 'normal'); doc.setTextColor(51,51,51); for (const [key, value] of Object.entries(dataObj)) { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - lineHeight) { doc.addPage(); yPos = pageMargin; } let formattedKey = key.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase()); let valStr = String(value); if (typeof value === 'number') { if (key.toLowerCase().includes('rate') || key.toLowerCase().includes('percent') || key.toLowerCase().includes('apr') || key.toLowerCase().includes('roi')) { valStr = value.toFixed(2) + '%'; } else { valStr = afit_formatCurrency(value); } } else if (key === 'annualizedROI') { valStr = String(value); // Already formatted or N/A } doc.text(`${formattedKey}:`, pageMargin + indent, yPos); doc.text(valStr, pageMargin + indent + 75, yPos, {align: 'left', maxWidth: usableWidth - (indent + 75)}); yPos += lineHeight * 1.1; } yPos += lineHeight * 0.5; } addSection("Investment Details", { "Investment Name": afit_investmentData.inputs.investmentName, "Investment Type": afit_investmentData.inputs.investmentType, "Platform/Issuer": afit_investmentData.inputs.platformIssuer, "Initial Investment Amount": afit_investmentData.inputs.initialInvestment, "Investment Start Date": afit_investmentData.inputs.investmentDate, "Original Expected Term (Years)": afit_investmentData.inputs.investmentTermYears, "Stated Annual Rate/APR": afit_investmentData.inputs.statedAPR // Number, will be formatted with % }); addSection("Actual Cash Flows & Status", { "Total Principal Received": afit_investmentData.actuals.totalPrincipalReceived, "Total Interest Received": afit_investmentData.actuals.totalInterestReceived, "Total Fees Paid": afit_investmentData.actuals.totalFeesPaid, "Amount Recovered (Post-Default)": afit_investmentData.actuals.amountRecoveredDefault, "Data Last Updated": afit_investmentData.actuals.dateLastUpdated, "Current Status": afit_investmentData.actuals.currentStatus }); if (afit_investmentData.actuals.notes && afit_investmentData.actuals.notes !== 'N/A' && afit_investmentData.actuals.notes.trim() !== '') { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - 20) { doc.addPage(); yPos = pageMargin; } doc.setFontSize(13); doc.setFont(undefined, 'bold'); doc.setTextColor(37, 99, 235); doc.text("Notes:", pageMargin, yPos); yPos += lineHeight * 1.5; doc.setFontSize(10); doc.setFont(undefined, 'normal'); doc.setTextColor(51,51,51); const notesLines = doc.splitTextToSize(afit_investmentData.actuals.notes, usableWidth - indent); notesLines.forEach(line => { if (yPos > doc.internal.pageSize.getHeight() - pageMargin - lineHeight) { doc.addPage(); yPos = pageMargin; } doc.text(line, pageMargin + indent, yPos); yPos += lineHeight; }); yPos += lineHeight * 0.5; } addSection("Performance Metrics", { "Total Capital Invested": afit_investmentData.results.totalCapitalInvested, "Total Cash Returned": afit_investmentData.results.totalCashReturned, "Net Cash Flow (Profit/Loss)": afit_investmentData.results.netCashFlow, "Return on Investment (ROI)": afit_investmentData.results.roiPercentage, // Number, will be formatted with % "Annualized ROI (Simplified)": afit_investmentData.results.annualizedROI }); doc.save('Alternative_Fixed_Income_Summary.pdf'); }
Scroll to Top