THE LABS GADGET FINANCE & HR — PATCH V1.1
===========================================================
IMPORTANT: For Finance HR V1 only. Do NOT reinstall or run install.php again.
Do NOT delete financehub, any existing folders, or the CRM database.

1. Backup the Finance MySQL database and folder financehub/app in cPanel.
2. Open cPanel File Manager > DOCUMENT ROOT of crm.thelabsgadget.com > financehub.
3. Upload The_Labs_Gadget_Finance_HR_PATCH_V1_1.zip and EXTRACT into financehub.
   This creates upgrade_v1_1.php and patch_v1_1/app/{bootstrap.php,actions.php,views.php}.
   DO NOT separately copy/overwrite the three app files.
4. Be logged into Finance & HR as OWNER / ADMIN.
5. In browser visit https://crm.thelabsgadget.com/financehub/upgrade_v1_1.php
   Click "Apply V1.1 Update". It checks original V1 file hashes first, backs up the
   3 PHP files automatically to app/v1_1_backup_[timestamp], performs additive DB
   migration, then replaces ONLY the 3 Finance PHP files.
6. Check Bank & Cash, Payment Vouchers, Expenses. Test with small dummy PV and
   remove test data ONLY through an approved clean-up plan; better use a staging copy.
7. DELETE upgrade_v1_1.php and the patch_v1_1 directory in File Manager.
   Leave app/config.local.php, storage, install files and app backups unchanged.

WHAT CHANGES:
- On NEW PV submission: auto-create a Pending Expenses record with PV number.
- When marked Paid: one outgoing ledger entry, linked Expense marked Paid and dated
  to actual payment date. If an OLD PV without an expense is marked paid, link it then.
- On Expenses screen, NO PV dropdown; direct expenses only. Never record PV payment
  as direct expense, or money out would be counted twice.
- Owner can adjust Opening Balance + start date before account gets transactions;
  saves change reason and owner audit, not counted as Money In.
- If starting November 1, 2026, set date to 2026-11-01 and amount to opening
  bank statement balance at start of that day. 0 may be left until the date.
- Existing historical paid PVs are NOT backfilled automatically to avoid duplicate
  expenses where manual direct entries may already exist. Ask for reconciliation.
- For prior accounts with a NULL start date, existing behavior is preserved until edit.

WARNING: This is an independently built patch. Syntax and file structure validated,
BUT not yet tested with live hosting/database. Apply after database backup and
preferably test on a STAGING COPY first. If error: screenshot WITHOUT PASSWORDS.
