fix: separate full month fund from prorated fund

Monthly cards show full month fund (e.g., 168h for 21 days).
Yearly summary table uses fund_to_date (prorated to today for
current month) so the +/- column is accurate mid-month.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-24 19:12:13 +01:00
parent db9c2929a8
commit 9724a7b2e9
2 changed files with 7 additions and 4 deletions

View File

@@ -275,7 +275,8 @@ export default function AttendanceBalances() {
let totalWorked = 0
let totalCovered = 0
for (const monthData of Object.values(fundData.months)) {
totalFund += monthData.fund
// Use prorated fund (fund_to_date) for current month, full fund for past
totalFund += (monthData as any).fund_to_date ?? monthData.fund
const us = monthData.users?.[userId]
if (us) {
totalWorked += us.worked