Real Estate Investment Budget Planner
Property & Loan Details
Acquisition & Other Upfront Costs
Enter costs in addition to the down payment.
Monthly Holding Costs & Operating Reserves
Budget Summary
Please fill in the details on the previous tabs. The budget summary will be calculated here.
Down Payment Percent must be between 0 and 100.
"; reibDownloadPdfButtonElem.style.display = 'none'; return null; } const loanInterestRate = reibGetNumValue('reibLoanInterestRate', true); // Allow zero interest for cash or creative scenarios const loanTermYears = reibGetNumValue('reibLoanTermYears'); if ((downPaymentPercent < 100) && (isNaN(loanInterestRate) || isNaN(loanTermYears) || loanTermYears <=0 || loanInterestRate < 0 )) { reibBudgetSummaryOutputDiv.innerHTML = "Loan Interest Rate and Term must be valid if not paying 100% down.
"; reibDownloadPdfButtonElem.style.display = 'none'; return null; } const downPaymentAmount = purchasePrice * (downPaymentPercent / 100); const loanAmount = purchasePrice - downPaymentAmount; const annualPropertyTaxes = reibGetNumValue('reibAnnualPropertyTaxes', true); const annualInsurance = reibGetNumValue('reibAnnualInsurance', true); const loanClosingCosts = reibGetNumValue('reibLoanClosingCosts', true); const inspectionFees = reibGetNumValue('reibInspectionFees', true); const initialRepairs = reibGetNumValue('reibInitialRepairs', true); const legalFees = reibGetNumValue('reibLegalFees', true); const utilitySetupFees = reibGetNumValue('reibUtilitySetupFees', true); const furnishingCosts = reibGetNumValue('reibFurnishingCosts', true); const otherAcquisitionCosts = reibGetNumValue('reibOtherAcquisitionCosts', true); const totalOtherUpfrontCosts = inspectionFees + initialRepairs + legalFees + utilitySetupFees + furnishingCosts + otherAcquisitionCosts + (loanAmount > 0 ? loanClosingCosts : 0); const totalUpfrontCapitalNeeded = downPaymentAmount + totalOtherUpfrontCosts; // Monthly Costs const monthlyPI = loanAmount > 0 ? calculateMortgage(loanAmount, loanInterestRate, loanTermYears) : 0; const monthlyTaxes = annualPropertyTaxes / 12; const monthlyInsurance = annualInsurance / 12; const hoaFeesMonthly = reibGetNumValue('reibHOAFeesMonthly', true); const utilitiesMonthly = reibGetNumValue('reibUtilitiesMonthly', true); const maintenanceReserveMonthly = reibGetNumValue('reibMaintenanceReserveMonthly', true); const totalMonthlyHoldingCosts = monthlyPI + monthlyTaxes + monthlyInsurance + hoaFeesMonthly + utilitiesMonthly + maintenanceReserveMonthly; const monthsOperatingReserve = reibGetNumValue('reibMonthsOperatingReserve', true); const operatingReserveAmount = totalMonthlyHoldingCosts * monthsOperatingReserve; const totalCapitalWithReserve = totalUpfrontCapitalNeeded + operatingReserveAmount; return { purchasePrice, downPaymentPercent, downPaymentAmount, loanAmount, loanInterestRate, loanTermYears, annualPropertyTaxes, annualInsurance, loanClosingCosts, inspectionFees, initialRepairs, legalFees, utilitySetupFees, furnishingCosts, otherAcquisitionCosts, totalOtherUpfrontCosts, totalUpfrontCapitalNeeded, monthlyPI, monthlyTaxes, monthlyInsurance, hoaFeesMonthly, utilitiesMonthly, maintenanceReserveMonthly, totalMonthlyHoldingCosts, monthsOperatingReserve, operatingReserveAmount, totalCapitalWithReserve }; } function reibCalculateAndDisplay() { if (!reibBudgetSummaryOutputDiv || !reibDownloadPdfButtonElem) { console.error("REIB: Summary output elements not found."); return; } const budget = reibCalculateBudget(); if (!budget) return; // Error message already handled in reibCalculateBudget reibBudgetSummaryOutputDiv.innerHTML = `Upfront Capital Needed for Acquisition
Purchase Price: ${reibFormatCurrency(budget.purchasePrice)}
Down Payment (${budget.downPaymentPercent}%): ${reibFormatCurrency(budget.downPaymentAmount)}
${budget.loanAmount > 0 ? `Loan Closing Costs: ${reibFormatCurrency(budget.loanClosingCosts)}
` : ''}
Inspection Fees: ${reibFormatCurrency(budget.inspectionFees)}
Initial Repairs/Renovations: ${reibFormatCurrency(budget.initialRepairs)}
Legal Fees: ${reibFormatCurrency(budget.legalFees)}
Utility Setup/Transfer: ${reibFormatCurrency(budget.utilitySetupFees)}
Furnishing Costs: ${reibFormatCurrency(budget.furnishingCosts)}
Other Acquisition Costs: ${reibFormatCurrency(budget.otherAcquisitionCosts)}
Total Upfront Capital Needed: ${reibFormatCurrency(budget.totalUpfrontCapitalNeeded)}
Estimated Monthly Holding Costs
${budget.loanAmount > 0 ? `Principal & Interest (P&I): ${reibFormatCurrency(budget.monthlyPI)}
` : ''}
Property Taxes (Monthly): ${reibFormatCurrency(budget.monthlyTaxes)}
Homeowners Insurance (Monthly): ${reibFormatCurrency(budget.monthlyInsurance)}
HOA Fees (Monthly): ${reibFormatCurrency(budget.hoaFeesMonthly)}
Estimated Utilities (Monthly): ${reibFormatCurrency(budget.utilitiesMonthly)}
Maintenance Reserve (Monthly): ${reibFormatCurrency(budget.maintenanceReserveMonthly)}
Total Estimated Monthly Holding Costs: ${reibFormatCurrency(budget.totalMonthlyHoldingCosts)}
Total Capital Outlook
Total Upfront Capital Needed: ${reibFormatCurrency(budget.totalUpfrontCapitalNeeded)}
Operating Reserve (${budget.monthsOperatingReserve} Months): ${reibFormatCurrency(budget.operatingReserveAmount)}
Total Estimated Capital (Upfront + Reserve): ${reibFormatCurrency(budget.totalCapitalWithReserve)}
Property & Loan Details
`; inputsHTML += `Purchase Price: ${reibFormatCurrency(budget.purchasePrice)}
`;
inputsHTML += `Down Payment: ${budget.downPaymentPercent}% (${reibFormatCurrency(budget.downPaymentAmount)})
`;
inputsHTML += `Loan Amount: ${reibFormatCurrency(budget.loanAmount)}
`;
inputsHTML += `Interest Rate: ${budget.loanInterestRate}%
`;
inputsHTML += `Loan Term: ${budget.loanTermYears} Years
`;
inputsHTML += `Annual Property Taxes: ${reibFormatCurrency(budget.annualPropertyTaxes)}
`;
inputsHTML += `Annual Insurance: ${reibFormatCurrency(budget.annualInsurance)}
`;
let upfrontCostsHTML = `Acquisition & Other Upfront Costs
`; if (budget.loanAmount > 0) upfrontCostsHTML += `Loan Closing Costs: ${reibFormatCurrency(budget.loanClosingCosts)}
`;
upfrontCostsHTML += `Inspection Fees: ${reibFormatCurrency(budget.inspectionFees)}
`;
upfrontCostsHTML += `Initial Repairs/Renovations: ${reibFormatCurrency(budget.initialRepairs)}
`;
upfrontCostsHTML += `Legal Fees: ${reibFormatCurrency(budget.legalFees)}
`;
upfrontCostsHTML += `Utility Setup/Transfer: ${reibFormatCurrency(budget.utilitySetupFees)}
`;
upfrontCostsHTML += `Furnishing Costs: ${reibFormatCurrency(budget.furnishingCosts)}
`;
upfrontCostsHTML += `Other Acquisition Costs: ${reibFormatCurrency(budget.otherAcquisitionCosts)}
`;
upfrontCostsHTML += `Total Other Upfront (Excl. Down Payment): ${reibFormatCurrency(budget.totalOtherUpfrontCosts)}
`;
let monthlyCostsHTML = `Estimated Monthly Holding Costs
`; if (budget.loanAmount > 0) monthlyCostsHTML += `Principal & Interest (P&I): ${reibFormatCurrency(budget.monthlyPI)}
`;
monthlyCostsHTML += `Property Taxes: ${reibFormatCurrency(budget.monthlyTaxes)}
`;
monthlyCostsHTML += `Homeowners Insurance: ${reibFormatCurrency(budget.monthlyInsurance)}
`;
monthlyCostsHTML += `HOA Fees: ${reibFormatCurrency(budget.hoaFeesMonthly)}
`;
monthlyCostsHTML += `Utilities: ${reibFormatCurrency(budget.utilitiesMonthly)}
`;
monthlyCostsHTML += `Maintenance Reserve: ${reibFormatCurrency(budget.maintenanceReserveMonthly)}
`;
monthlyCostsHTML += `Total Monthly Holding Costs: ${reibFormatCurrency(budget.totalMonthlyHoldingCosts)}
`;
let summaryHTML = `Budget Summary
`; summaryHTML += `Total Upfront Capital Needed: ${reibFormatCurrency(budget.totalUpfrontCapitalNeeded)}
`;
summaryHTML += `Operating Reserve (${budget.monthsOperatingReserve} Months): ${reibFormatCurrency(budget.operatingReserveAmount)}
`;
summaryHTML += `Total Estimated Capital (Upfront + Reserve): ${reibFormatCurrency(budget.totalCapitalWithReserve)}
`;
pdfContentWrapper.innerHTML = `
Real Estate Investment Budget Plan
${inputsHTML} ${upfrontCostsHTML} ${monthlyCostsHTML} ${summaryHTML}Report generated on: ${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}
`; document.body.appendChild(pdfContentWrapper); try { const canvas = await html2canvas(pdfContentWrapper, { scale: 2, useCORS: true, backgroundColor: '#ffffff' }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const imgProps = pdf.getImageProperties(imgData); const ratio = Math.min((pdfWidth - 40) / imgProps.width, (pdfHeight - 40) / imgProps.height); pdf.addImage(imgData, 'PNG', (pdfWidth - imgProps.width * ratio) / 2, 20, imgProps.width * ratio, imgProps.height * ratio); pdf.save('Real_Estate_Investment_Budget.pdf'); } catch (error) { console.error("Error during PDF generation:", error); alert("An error occurred while generating the PDF."); } finally { document.body.removeChild(pdfContentWrapper); } }