fix: monthly cards and table show same +/- using prorated fund for current month
Backend: per-user missing/overtime in current month now calculated against bizDaysToDate (working days up to today), not full month. Frontend: monthly card percentage and fulfilled check also use fund_to_date for current month. Now both the yearly summary table and the monthly cards agree. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -458,8 +458,9 @@ export default function AttendanceBalances() {
|
||||
{fundData.users && fundData.users.map(user => {
|
||||
const us = monthData.users?.[String(user.id)]
|
||||
if (!us) return null
|
||||
const pct = monthData.fund > 0 ? Math.min(100, (us.covered / monthData.fund) * 100) : 0
|
||||
const isFulfilled = us.covered >= monthData.fund
|
||||
const effectiveFund = (monthData as any).fund_to_date ?? monthData.fund
|
||||
const pct = effectiveFund > 0 ? Math.min(100, (us.covered / effectiveFund) * 100) : 0
|
||||
const isFulfilled = us.covered >= effectiveFund
|
||||
return (
|
||||
<div key={user.id}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '12px' }}>
|
||||
|
||||
Reference in New Issue
Block a user