Merge branch 'claude/ecstatic-elgamal'

This commit is contained in:
2026-03-13 14:52:59 -04:00

View File

@@ -741,11 +741,11 @@ export class ReportsService {
AND LOWER(a.name) LIKE '%interest%' AND LOWER(a.name) LIKE '%interest%'
`, [currentYear - 1]); `, [currentYear - 1]);
// Projected interest for current year (YTD actual + remaining months estimated) // Projected interest for current year: YTD actual + remaining months using
// the rate-based est_monthly_interest (same source as the dashboard KPI)
const currentMonth = new Date().getMonth() + 1; const currentMonth = new Date().getMonth() + 1;
const ytdInterest = parseFloat(interestEarned[0]?.total || '0'); const ytdInterest = parseFloat(interestEarned[0]?.total || '0');
const monthlyAvg = currentMonth > 0 ? ytdInterest / currentMonth : 0; const projectedInterest = ytdInterest + (estMonthlyInterest * (12 - currentMonth));
const projectedInterest = ytdInterest + (monthlyAvg * (12 - currentMonth));
// Planned capital spend for current year // Planned capital spend for current year
const capitalSpend = await this.tenant.query(` const capitalSpend = await this.tenant.query(`