PACKAGE FL2 - FORCED LOGOUT PAYROLL CLASSIFICATION LOCK

Purpose
- Forced/auto logout sessions must never create overtime in payroll reports or exports.
- FL1 controls how the cron closes future forgotten sessions.
- FL2 protects payroll classification even if the raw forced session span looks wrong.

Main rule
If a work session is marked as forced normal day, payroll classification becomes:
- Normal = payroll setup normal_minutes for that day, capped to worked minutes
- OT 1.5 = 0
- OT 2.0 = 0

Detected forced-normal markers
FL2 detects a session as forced normal if:
- clock_out_status = FORCED_NORMAL_DAY
OR
- close_reason contains NORMAL DAY and NO OVERTIME
OR
- close_reason contains FORCED LOGOUT and NO OVERTIME

Files
- /backoffice/payadj2-payroll-calculator.php
- /sql/verify-fl2-forced-logout-payroll-lock.sql
- /sql/mark-old-forced-sessions-fl2.sql
- /README-FL2.txt

Extract inside
- /home/uent/public_html

Pages affected
Any page using /backoffice/payadj2-payroll-calculator.php, including:
- /backoffice/payroll-adjustments.php
- /backoffice/payroll-working-lunch-export.php
- /backoffice/sage-payroll-export.php

What to test
1. Open Payroll Adjustments.
2. Filter a date range with forced logout sessions.
3. Confirm those sessions do not create OT 1.5 or OT 2.0.
4. Open Payroll Working Lunch Export and Sage Payroll Export.
5. Confirm final export values do not include overtime from forced logout sessions.

Verification SQL
Run:
/sql/verify-fl2-forced-logout-payroll-lock.sql

Old data repair
If older auto-closed sessions are not marked with FORCED_NORMAL_DAY or no-overtime close_reason, use:
/sql/mark-old-forced-sessions-fl2.sql

Do not blindly update old rows. First inspect candidate rows, then mark only sessions that were truly forced/auto logout.
