# Enterprise Operations v11 Upgrade

1. Back up the database, application files, and `storage/uploads`.
2. Upload the v11 package over the existing FleetLume installation.
3. Open `/install.php?unlock=1` and run the updater with the existing database credentials.
4. Confirm that the new enterprise tables and user/load columns were created.
5. Clear browser, CDN, and server asset caches so `app-v11.css`, `app-v11.js`, the v11 manifest, and service worker load.
6. Configure the unified `operations_autopilot.php` cron job to run every minute.
7. Open **Guided Setup** and complete security, permissions, telematics, compliance, communications, and customer portal settings.
8. Test acquisition → negotiation → assignment → tracking → delivery → accessorial → invoice on staging.

The updater is designed to add missing tables and columns without intentionally deleting existing records. Direct provider integrations require their own credentials and staging verification.

# UI v10 Responsive Redesign Upgrade

1. Back up the existing application files and database.
2. Upload the v10 package over the v9 installation.
3. Run `/install.php?unlock=1` so all previous v6-v9 database upgrades remain applied. The v10 visual redesign itself does not add database tables.
4. Clear the browser cache, CDN cache, and any server-side asset cache so `app-v10.css` and `app-v10.js` load.
5. Test the owner/admin, dispatcher, driver, accounting, maintenance, and carrier portals on desktop and mobile.
6. Keep the existing `operations_autopilot.php` cron job running every minute.

# Carrier Network and Reefer Upgrade

This release expands FleetLume for dispatch companies that coordinate loads using equipment owned by outside carriers and owner-operators.

## Before updating

1. Back up the database.
2. Back up the `storage/uploads` folder.
3. Keep a copy of the current configuration file.

## Update procedure

1. Upload and replace the application files.
2. Open:

```text
https://fleetlume.space/install.php?unlock=1
```

3. Enter the same database credentials used by the current installation.
4. Complete the update.
5. Sign in as an administrator and review carrier, driver, truck, trailer, and load assignments.

## New records and fields

The updater adds carrier profiles, carrier-linked portal accounts, equipment ownership, carrier load economics, reefer specifications, load temperature requirements, stop temperatures, seal numbers, and temperature logs.

Existing records are retained. Older drivers, trucks, trailers, and loads may show as unassigned until a carrier is selected.

## Recommended setup after updating

- Add each carrier company and its MC, DOT, insurance, payment terms, and dispatch fee.
- Link drivers, trucks, and trailers to the correct carrier.
- Create a Carrier portal account for companies that need access.
- Review each reefer trailer’s temperature unit, safe operating range, current setpoint, fuel level, washout date, and service due date.
- Use the temperature-controlled load section when booking refrigerated freight.


## Local and staging environments

This package no longer depends on a fixed host. The installer detects the current browser host automatically. Use `http://localhost` with the appropriate subfolder Base URL for local testing, then rerun the installer on the live server with `https://fleetlume.space`.


## Compact sidebar and fuel-control upgrade

This release replaces the long navigation list with grouped, collapsible sections that remember their open state. Mobile navigation now uses a wider touch-friendly drawer with a close control.

The new Fuel Allocation area supports load-based recommendations, fuel-card and cash-advance allowances, driver receipt submissions, approval, balance reconciliation, and automatic accounting expense creation. After uploading the update, rerun the installer using the same database details so the new fuel tables and accounting category are created.

## Driver logbook and Hours-of-Service upgrade

This release adds driver HOS profiles, daily log records, duty events, certification, edit requests, HOS clocks, a dispatcher review board, an inspection view, and daily PDF output.

After replacing the files, rerun the installer with the current database credentials:

```text
/install.php?unlock=1
```

The updater creates the HOS tables and adds the log-day start-time setting without intentionally removing existing records.

After updating:

1. Open **Driver Logbooks & HOS**.
2. Open each driver's HOS profile.
3. Select the operating region, default rule set, cycle, home terminal, time zone, and log-day start time.
4. Confirm whether Personal Conveyance, Yard Move, short-haul, or an ELD exemption is allowed.
5. Link each driver portal account to the matching driver profile.
6. Review `HOS_COMPLIANCE_NOTES.md` before production use.

## Gemini AI integration

This release adds the FleetLume AI workspace, document reader, operations assistant, fuel allowance review, and HOS/accounting explanation modes.

After replacing the files:

1. Back up the database and uploads.
2. Run `/install.php?unlock=1` with the existing database credentials.
3. Sign in as an owner or administrator.
4. Open **FleetLume AI**.
5. Enter the Gemini API key, select the model available to the Google AI project, enable the module, and run **Test Connection**.
6. Review role permissions and grant **Use FleetLume AI** only where needed.

The API key is not included in the package and is not stored in the database. The settings screen writes it to `config/gemini.php`. Human review remains required for every generated result.

## UI v3 and AI automation upgrade

After replacing files, run `/install.php?unlock=1` using the current database credentials. This creates the automation rules, runs, action queue, and AI change-log tables and adds starter rules.

Then:

1. Open **FleetLume AI → Autopilot**.
2. Review the starter automation rules and target roles.
3. Choose **Recommend only** or **Automatically run safe actions**.
4. Confirm Gemini is enabled if AI prioritization and drafting are required.
5. Run all automations once and review the approval queue and change feed.
6. Add the CLI cron command shown in `AI_AUTOMATION.md`.
7. Test the interface at desktop, tablet, and phone widths before production rollout.

The design update is loaded through `public/assets/css/app-v3.css` and `public/assets/js/app-v3.js`, which preserves compatibility with existing views while adding responsive behavior globally.

## Dispatch control center and real-time tracking upgrade

This release adds the load-acquisition pipeline, rate-negotiation records, route plans and checkpoints, automatic dispatch compliance alerts, telematics devices, and truck-location history.

After replacing the files:

1. Back up the database, files, and `storage/uploads`.
2. Run `/install.php?unlock=1` using the existing database credentials.
3. Sign in as an owner or administrator.
4. Open **Dispatch → Control Center** and run a compliance scan.
5. Review dispatcher permissions and truck assignments.
6. Test driver browser tracking and any external telematics integration in staging.

The updater creates seven new tables without intentionally deleting existing operational records. See `DISPATCH_OPERATIONS.md` for the complete workflow and integration payload.

## Telematics provider and driver equipment upgrade

This release adds driver-managed Motive, Samsara, Geotab, and generic GPS/ELD connections plus a company-wide telematics console for owners, administrators, and dispatchers.

After replacing the files:

1. Back up the database, application files, and `storage/uploads`.
2. Run `/install.php?unlock=1` using the current database credentials.
3. Confirm PHP cURL and either Sodium or OpenSSL are enabled.
4. Keep the generated `TELEMATICS_ENCRYPTION_KEY` unchanged after connections are created.
5. Add the once-per-minute cron command from `TELEMATICS_INTEGRATIONS.md`.
6. Open **Dispatch → Telematics Providers** and connect a staging provider account.
7. Map a discovered asset to a FleetLume truck or trailer.
8. Verify the mapped truck on the live tracking map.
9. Link every driver portal user to the correct driver profile before allowing driver-managed connections.

The updater creates `telematics_connections` and `telematics_assets` without intentionally deleting existing records. Provider API credentials are not bundled with the application.



## v8 Automated Operations upgrade

After backing up, run `/install.php?unlock=1` to create `operations_autopilot_runs` and the new settings. Replace separate automation cron jobs with `operations_autopilot.php` where practical, then confirm the scheduler in Company Settings.

## v9 route-deviation, hurdle, and border-delay monitoring

After backing up the application and database, upload this package and run `/install.php?unlock=1`. The updater adds route-monitor state and trip-event tables, border timing fields, and monitoring settings without intentionally deleting existing records.

Then:

1. Keep the unified `operations_autopilot.php` cron runner active every minute.
2. Add coordinates to planned route waypoints and border crossings.
3. Review thresholds in Company Settings.
4. Test a route deviation, driver hurdle report, late border projection, missed arrival, and stop overrun on staging.
5. Confirm notifications are visible to the assigned driver and all owner/admin/dispatcher accounts.

See `TRIP_MONITORING_V9.md` for the complete workflow and limitations.

## UI v10.1 sticky sidebar update

No database migration is required. Replace the application files and clear browser/CDN caches. On desktop, the sidebar stays anchored to the viewport, the navigation list scrolls independently, and the main workspace handles page scrolling. Tablet and mobile behavior remains unchanged.

## v12 weekly payroll, fuel slips, rate confirmations, and cheque printing

1. Back up the database, application files, configuration, and `storage/uploads`.
2. Upload the v12 package over the existing installation.
3. Run `/install.php?unlock=1` using the current database credentials.
4. Open **Company Settings → Payroll & Cheque Printing** and confirm currency wording, statement footer, and printer offsets.
5. Open **Finance → Payroll & Cheques** and create a test weekly pay run for one driver.
6. Verify load pay, fuel reimbursements, fuel advances, deductions, and net pay.
7. Approve the test statement and prepare a cheque using a non-production cheque number.
8. Print on plain paper and compare it with the intended cheque stock before using production cheques.
9. Confirm bank and accounting entries only after the test cheque is issued.
10. Verify that the linked driver can see only their own statement under **Payments & Payslips**.

The updater creates `pay_runs`, `pay_statements`, `pay_statement_items`, and `payment_cheques`. It does not intentionally delete existing settlements, fuel records, loads, invoices, or bank transactions. Review `PAYROLL_CHEQUE_PRINTING_V12.md` before production use.

## Upgrade to v13

1. Back up the v12 database, source files, `config/config.php`, and `storage/uploads`.
2. Upload the v13 files.
3. Run `/install.php?unlock=1` once.
4. Confirm the import and accounting integration tables were created.
5. Configure company logo, company website, billing email, payroll email, and dispatch email.
6. Ensure PHP cURL is installed for QuickBooks synchronization.
7. Ensure PHP Zip and SimpleXML are installed for XLSX imports.
8. Generate test payslip and invoice PDFs and inspect print alignment.
9. Connect a QuickBooks Sandbox company before enabling production synchronization.

## Upgrade to v14

1. Back up the database, source files, configuration, and `storage/uploads`.
2. Upload the v14 files over the current installation.
3. Run `/install.php?unlock=1` once to add the daily-operations tables and settings.
4. Keep `operations_autopilot.php` scheduled once per minute.
5. Open **Company Settings → Daily Use Automation** and review smart dispatch, ETA, classification, QuickBooks pullback, summaries, backups, health checks, and pay estimates.
6. Open **Import Center** and create protected scheduled drop folders only for trusted data sources.
7. Test a recurring load, smart dispatch recommendation, driver offline action, document classification, payroll lock, reconciliation, and restore point on staging.
8. Verify QuickBooks two-way synchronization in Sandbox and configure the Intuit webhook URL/signing secret before production.
9. Confirm browser, email, SMS, and mobile notification preferences for each role.
10. Review `DAILY_OPERATIONS_V14.md` and `VALIDATION_REPORT_V14.md` before release.

The default ETA provider is a configurable heuristic. Live traffic data requires a separate routing-provider connection and credentials. Scheduled imports process protected local drop folders; an external email/SFTP/cloud workflow must deliver files into those folders when needed.

## v15 Live Domain Upgrade

After backing up files and database, upload v15 and run `/install.php?unlock=1`. The schema adds `purchase_inquiries` and SMTP/public-sales settings. For a cPanel main-domain installation use the exact cPanel-prefixed database name and username. The recommended database base name is `fleetlume_app`. After upgrade, open Company Settings to configure Sales Contact Email, SMTP Host, SMTP Port, encryption, username, password, sender, and reply-to address. Send an SMTP test before enabling live email workflows. See `LIVE_DOMAIN_DEPLOYMENT_V15.md`.
