iBilik Capital Phase 5 v9 - Formula / Waterfall Engine Foundation

Golden Reference workbooks parsed:
- Advance Profit: 1110 formula cells
- CAPEX Funding: 1261 formula cells
- Revenue Management: 859 formula cells
- Flexible Forward Rental: 582 formula cells

Architecture
1. formula_versions locks the financial model version used by each Deal.
2. formula_parameters defines editable and required inputs.
3. formula_reference_cells maps the system back to the exact Excel sheet/cell/formula.
4. calculation_runs / inputs / outputs / snapshots remain the immutable execution layer.
5. Formula PHP engines implement the calculations; they do not query HTML/UI state directly.
6. formula_golden_test_cases stores Excel default-input expected results for automated reconciliation.

Rules
- Never silently change an ACTIVE formula version. Create v1.1/v2.0 instead.
- Approved Deals stay linked to the formula version used at approval time.
- User overrides may only affect formula_parameters.editable_flag=1.
- All calculation runs save inputs, outputs and snapshot JSON.
- Excel remains Golden Reference until a new formula version is explicitly approved.
- P05 Recycled Capital Pool is not part of these four Excel engines; it consumes actual recovered capital and has its own lineage/risk engine.

Deployment
1. Backup database.
2. Import database/ibilik_capital_database_v1.7_formula_golden_reference.txt.
3. Do NOT overwrite the live UI yet; this package is the calculation-core increment.
4. Keep src/Formula classes for the next integrated application bundle.
5. Final integrated test will compare PHP results against formula_golden_test_cases.
