PACKAGE WL2 - BACKOFFICE PAYROLL / LUNCH RULE SETUP

Purpose
- Adds a backoffice page where admin can create payroll/lunch rules.
- Lets admin assign payroll/lunch rules to staff.
- This is where lunch duration per staff member is loaded.
- Working lunch calculation reads lunch_minutes from the staff payroll rule.

Files
- /backoffice/payroll-lunch-rules.php
- /backoffice/payroll-lunch-rule-save.php
- /backoffice/payroll-lunch-rules.css
- /sql/verify-wl2-payroll-lunch-rules.sql
- /README-WL2.txt

Extract inside
- /home/uent/public_html

Open this page
- https://uent.co.za/backoffice/payroll-lunch-rules.php

Recommended menu placement
Add this link in the backoffice left menu near Staff Hours / Sage Payroll Export:
Payroll / Lunch Rules -> /backoffice/payroll-lunch-rules.php

What to create
1) Rule: Normal working week | Lunch duration: 60 | Working lunch paid: Yes
2) Rule: Half-day staff | Lunch duration: 30 | Working lunch paid: Yes
3) Rule: No lunch deduction | Lunch duration: 0 | Working lunch paid: No
Then assign each staff member to the correct rule.

Important business rule
- Worksite page controls where staff works.
- Payroll / Lunch Rules controls lunch duration and working lunch calculation.
- Staff assignment controls which rule applies to each staff member.
- The assignment uses effective dates so old records can remain historically correct.

Database source of truth
- payroll_rule_sets.lunch_minutes = lunch duration
- payroll_rule_sets.working_lunch_paid = whether working lunch is paid/credited
- staff_payroll_rules = which staff member uses which rule, from which date
- work_session_breaks.rule_minutes_snapshot = copied lunch duration used for that specific working lunch record

Notes
- This package does not alter the database schema.
- It uses your existing tables: payroll_rule_sets, staff_payroll_rules, users.
- The page includes staff_id and staff_name in the staff rule overview.
