Add timeclock break/lunch tracking, manual entries, and attendance period picker

- ClockEntryType enum (Work/Break/Lunch) on EmployeeClockEntry; default 0 = Work
  so all existing entries are unaffected
- Migration AddClockEntryType applied
- Break and Lunch buttons on clock status card (only when AllowMultiplePunchesPerDay
  is enabled); GoOnBreak closes current Work segment and opens Break/Lunch segment
- Return to Work button when on break/lunch; closes break segment, opens new Work
- Status badges on clock card and Who'\''s In grid: Working / On Break / At Lunch
- Break/Lunch hours excluded from all day totals, week totals, metrics, and CSV
- Manager: Manual Entry modal to create a time entry for any company employee
- Attendance report defaults to current ISO week; Week/Month mode toggle with
  auto-submitting dropdowns (last 12 weeks or months); period label shown inline
- Attendance CSV: Type column added; day/week totals blank on Break/Lunch rows;
  filename uses period label
- Week subtotal rows suppressed in single-week view (shown in month view only)
- Help article and AI knowledge base updated for all new features

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 09:30:39 -04:00
parent 8ae61b6c78
commit 9dd36238bb
14 changed files with 11909 additions and 181 deletions
@@ -1440,25 +1440,40 @@ public static class HelpKnowledgeBase
**Employee Timeclock (/Timeclock):**
Facility-level clock in/out for employees tracks when workers arrive and leave, separate from Job Time Entries which log hours against a specific job.
Multiple punches per day fully supported (clock out for lunch, clock in again, clock out, etc.); each segment tracked separately with its own in/out and hours.
Only constraint: you cannot clock in while already clocked in clock out first.
Each punch creates a segment with a type: Work, Break, or Lunch. Only Work segments count toward paid-hours totals Break and Lunch time is recorded for reference but excluded from all day/week totals and the payroll CSV.
Segment types (ClockEntryType enum): Work=0 (default), Break=1, Lunch=2.
Dashboard (/Timeclock):
- Your clock status card: shows "Clocked In" (with time) or "Clocked Out"; one-click Clock In / Clock Out buttons
- Who's In table: all employees currently clocked in, with elapsed time; refreshes every 60 seconds
- My Recent History: last 14 days of your own punch segments grouped by day with daily totals
- Manager section (CompanyAdmin and Manager roles only): Team History with date-range filter; edit/delete any entry for any employee in the company
- My Clock Status card: shows current state with color-coded badge green "Working", yellow "On Break", blue "At Lunch", or grey "Clocked Out"
- Clock In button: appears when clocked out; starts a new Work segment
- Clock Out button: appears when Working; ends the current Work segment (end of day)
- Break button: appears when Working AND company has "Allow Multiple Punches Per Day" enabled; closes the Work segment and opens a Break segment
- Lunch button: same as Break but opens a Lunch segment
- Return to Work button: appears when on break or lunch; closes the break/lunch segment and opens a new Work segment
- Who's In table: all employees with an open segment, showing their status badge (Working / On Break / At Lunch) and elapsed time; refreshes every 60 seconds
- My Recent History: last 14 days of your own punch segments grouped by day; each row shows a type badge (Work/Break/Lunch); daily totals count Work only
Editing entries: Only Managers and Company Admins can edit or delete clock entries. Workers cannot edit their own entries all corrections must go through a manager.
Manager tools (CompanyAdmin and Manager roles):
- Edit entry: pencil icon on any entry in My Recent History or Team History adjust clock-in, clock-out, notes; hours recalculated on save
- Delete entry: trash icon; soft-deletes the entry
- Manual Entry button (in Team History card header): opens a modal to create a time entry for any active employee in the company; fields: employee dropdown, clock-in datetime, optional clock-out datetime, optional notes; manual entries are always Work type
- Team History: date-range loader showing all employees' segments with type badges and edit/delete controls
Kiosk mode (/Timeclock/Kiosk):
A shared shop tablet page that does not require login. Employees tap their name tile enter 4-digit PIN system automatically clocks in (if out) or clocks out (if in). Confirmation screen shows time, segment hours, and today's running total. Returns to employee grid after 4 seconds.
Activation: Manager navigates to /Timeclock/Kiosk/Activate generates device cookie; kiosk then runs without login. Re-visiting /Kiosk/Activate revokes the old device and re-activates the current one.
A shared shop tablet page that does not require login. Employees tap their name tile enter 4-digit PIN system automatically clocks in (if out) or clocks out (if in). Confirmation screen shows time, segment hours, and today's running total. Returns to employee grid after 4 seconds. Kiosk performs a simple toggle only no Break/Lunch buttons on the kiosk; use the main dashboard for break tracking.
Activation: Manager navigates to /Timeclock/Kiosk/Activate generates device cookie; kiosk then runs without login. Multiple tablets per company supported, each with its own token. Deactivate from Settings Company Timeclock tab.
PIN management: on a user's Edit page (Settings Users Edit User) there is a "Timeclock Kiosk PIN" section. Enter a 4-digit PIN and click "Set PIN" to enable that employee on the kiosk. Click "Clear" to disable them.
PIN management: on a user's Edit page (Settings Users Edit User) there is a "Timeclock Kiosk PIN" section. Enter a 4-digit PIN and click "Set PIN" to enable that employee on the kiosk. Click "Clear" to disable them. Only employees with a PIN appear on the kiosk grid.
Attendance Report (/Reports/Attendance): shows daily punch detail per employee with date-range filter. Each employee card groups segments by day (with day totals) and by ISO week (with weekly subtotal rows). Managers see all employees; workers see their own history only.
CSV Export: "Export CSV (Payroll)" button downloads a flat CSV with one row per punch segment columns: Employee Name, Date, Day of Week, Clock In, Clock Out, Segment Hours, Day Total Hours, Week Total Hours, Notes. Suitable for import into payroll software or handoff to a payroll provider.
Attendance Report (/Reports/Attendance):
- Defaults to the current ISO week; toggle between Week and Month view using the mode buttons
- Week view: dropdown of the last 12 weeks (labelled "This Week", "Last Week", then date ranges); weekly subtotal rows hidden (redundant for a single-week view)
- Month view: dropdown of the last 12 months; weekly subtotal rows shown inside each employee card
- Dropdown auto-applies on change no separate submit button needed
- Each segment row has a type badge (Work/Break/Lunch); Break and Lunch hours shown in muted text and excluded from all totals
- Employee total badge and day totals count Work segments only
CSV Export: "Export CSV (Payroll)" downloads a flat file for the selected period one row per segment; columns: Employee Name, Date, Day of Week, Type, Clock In, Clock Out, Segment Hours, Day Total Hours (Work rows only), Week Total Hours (Work rows only), Notes. Filename includes the period label.
Help article: Help Timeclock
""";