Skip to content

Commit

Permalink
Update fee calculation logic in YearlyForecast2025 component
Browse files Browse the repository at this point in the history
- Enhanced the total actual revenue calculation to include actual consulting fees for the current month, improving accuracy in financial forecasting.
- Adjusted the logic to sum consulting fees only for past months and the current month, ensuring a more precise representation of realized revenue.
- These changes improve the clarity and reliability of the financial data presented in the Yearly Forecast 2025 feature.
  • Loading branch information
ElemarJR committed Jan 10, 2025
1 parent 51a1f5c commit 305c450
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/app/financial/2025/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,13 @@ export default function YearlyForecast2025() {

const totalActual = forecast.byMonth.reduce((sum: number, month: any) => {
const isPast = isMonthInPast(month.month);
const monthValue = isPast ? month.actual : 0;
return sum + monthValue;
const isCurrentMonth = currentYear === 2025 && currentMonth === month.month;
return sum + ((isPast || isCurrentMonth) ? (
month.actualConsultingFee +
month.actualConsultingPreFee +
month.actualHandsOnFee +
month.actualSquadFee
) : 0);
}, 0);
const remaining = forecast.goal - totalActual;

Expand Down

0 comments on commit 305c450

Please sign in to comment.