From eeab3b1fcfc4eccdea047495e880e609cc5602cc Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Mon, 16 Mar 2026 19:46:51 +0800 Subject: [PATCH] render overtime anytime needed --- lib/screens/attendance/attendance_screen.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/screens/attendance/attendance_screen.dart b/lib/screens/attendance/attendance_screen.dart index 344fa79e..7b914a0e 100644 --- a/lib/screens/attendance/attendance_screen.dart +++ b/lib/screens/attendance/attendance_screen.dart @@ -402,6 +402,15 @@ class _CheckInTabState extends ConsumerState<_CheckInTab> { .where((l) => (l.justification ?? '').trim().isNotEmpty) .toList(); + // Roles allowed to render overtime anytime + final allowedOvertimeRoles = { + 'admin', + 'programmer', + 'dispatcher', + 'it_staff', + }; + final canRenderOvertime = allowedOvertimeRoles.contains(profile.role); + return SingleChildScrollView( padding: const EdgeInsets.all(16), child: Column( @@ -649,9 +658,9 @@ class _CheckInTabState extends ConsumerState<_CheckInTab> { if (activeOvertimeLog.isNotEmpty || _overtimeLogId != null) _buildActiveOvertimeCard(context, theme, colors, activeOvertimeLog) - else if (todaySchedule.isEmpty && - activeLog.isEmpty && - _overtimeLogId == null) + else if (_overtimeLogId == null && + (canRenderOvertime || + (todaySchedule.isEmpty && activeLog.isEmpty))) _buildOvertimeCard(context, theme, colors) else if (todaySchedule.isEmpty && (activeLog.isNotEmpty || _overtimeLogId != null))