fix(fusion_clock): NFC clock-out shows gross worked time, not net-of-penalty
The result card showed x_fclk_net_hours = worked_hours − break − early-out penalty minutes. Tapping out before the scheduled end adds a 15-min early-out penalty to the break field, so short shifts clamped to 0 → "Worked 0h 0m". Show GROSS attendance.worked_hours (the actual clock-in → clock-out elapsed time) instead, and format adaptively (Xh Ym / Ym / Ys) so brief shifts and quick tests don't all read 0. Net-of-deductions stays in the payroll reports. Live as 19.0.3.11.5 (verified worked_hours computes correctly in the DB). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -367,7 +367,7 @@ class FusionClockNfcKiosk(http.Controller):
|
||||
'employee_name': employee.name,
|
||||
'employee_avatar_url': avatar_url,
|
||||
'message': f'{employee.name} clocked in at {location.name}',
|
||||
'net_hours_today': 0.0,
|
||||
'worked_hours': 0.0,
|
||||
'needs_photo': not employee.image_1920,
|
||||
}
|
||||
else:
|
||||
@@ -393,7 +393,10 @@ class FusionClockNfcKiosk(http.Controller):
|
||||
'employee_name': employee.name,
|
||||
'employee_avatar_url': avatar_url,
|
||||
'message': f'{employee.name} clocked out',
|
||||
'net_hours_today': round(attendance.x_fclk_net_hours or 0, 2),
|
||||
# GROSS time between clock-in and clock-out (what the employee
|
||||
# expects to see). x_fclk_net_hours subtracts break + early-out
|
||||
# penalty minutes, which zeroed short shifts — that's for payroll.
|
||||
'worked_hours': attendance.worked_hours or 0.0,
|
||||
'needs_photo': not employee.image_1920,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user