# TradeFlow

A multi-tenant field service CRM for UK trade businesses — Gas Safe engineers, electricians, plumbers, and multi-trade companies. Built with **plain PHP + MySQL** (no framework), mobile-first, and database-backed.

Current version: **5.6.16**

## ✨ Features

- **Multi-company (multi-tenant)** — every query is scoped by `business_id`; businesses, users, subscriptions and branding are isolated.
- **Authentication** — register a company + admin, login, CSRF-protected forms, password hashing (`password_hash`/`password_verify`).
- **Jobs** — full lifecycle (Pending → In Progress → Completed → Closed), job sheets with line items, compliance flags, linked customers/properties.
- **Customers** — directory with VIP tagging, contact details, spend tracking, communication history.
- **Properties & appliances** — per-property appliance tracking (boiler make/model, last service date).
- **Documents** — quotes, invoices and CP12 gas-safety certificates, generated to PDF/XML/XLSX, with branding-aware templates.
- **CP12 certificate page** — professional layout, QR verification concept, print/PDF export.
- **Schedule & reminders** — day/week/month calendar, personal schedule items, service/CP12 reminders.
- **Settings hub** — account, business details, VAT, billing entities, licences (Gas Safe no.), branding (logo + invoice/certificate templates), notifications.
- **Gas rate calculator** and gas-only feature gating for non-gas businesses.
- **Automation rules UI** — 26 event-driven rules (job lifecycle, quotes, invoices, compliance, system intelligence) with event log and cron schedule.
- **Theme system** — 6 beautiful themes (Light, Dark, Ocean, Sunset, Forest, Midnight) + System Default.