BGI HRMS Payroll & Attendance - Phase 2 Patch
==============================================

This patch adds Leave, Holiday, Shift Roster, Special Timing and Approval Workflow on top of Phase 1.

IMPORTANT
---------
1. Apply Phase 1 first.
2. Take a full database and file backup.
3. Import phase2_schema.sql in the same ERP database.
4. Upload folders to project root without deleting existing files.
5. Open: /admin/hrms/phase2_dashboard.php

Admin Pages
-----------
/admin/hrms/phase2_dashboard.php
/admin/hrms/leave_rules.php
/admin/hrms/holidays.php
/admin/hrms/shift_roster.php
/admin/hrms/leave_applications.php
/admin/hrms/special_timing.php
/admin/hrms/approvals.php
/admin/hrms/leave_balance.php

Staff Portal Pages
------------------
/staff/hrms/leave_apply.php
/staff/hrms/ch_od_apply.php
/staff/hrms/special_timing_apply.php

Cron Files
----------
/cron/hrms_rebuild_leave_balance.php
/cron/hrms_apply_approved_phase2_effects.php

Rules Included
--------------
1. Payroll/Leave Academic Year: July to June.
2. CL annual quota: 12 by default for eligible designations.
3. Guard and Peon: No CL by default.
4. Guard: monthly off limit starter rule = 1.
5. Guard: festival holiday not allowed by default.
6. Up to 3 days leave approval = Related Head.
7. More than 3 days leave approval = Management.
8. CL future leave is not allowed by default.
9. CH/OD staff apply requires punched attendance.
10. Related Head/Admin can apply CH/OD without punch.
11. Bus Late / Condolence / Other Reason special timing approval supported.
12. Approval applies attendance effect automatically.

Recommended Menu Links
----------------------
Add these links in your admin left menu/role menu:
- HRMS Phase 2 Dashboard: admin/hrms/phase2_dashboard.php
- Leave Rules: admin/hrms/leave_rules.php
- Holiday Calendar: admin/hrms/holidays.php
- Shift Roster: admin/hrms/shift_roster.php
- Approvals: admin/hrms/approvals.php

Do Not Delete
-------------
Do not replace or delete Phase 1 files. This patch only adds Phase 2 files and tables.
