# Phase 10 — Revenue, budgets, and financial dashboard

Phase 10 adds operational revenue, customer invoices and receipts, refunds, financial periods, exchange-rate records, base-currency budgets, financial KPIs, trends, and estimated flight, route, and aircraft profitability. It intentionally does not implement a general ledger.

## Revenue and receivables

Posted revenue retains category, flight, route, aircraft, customer, charter placeholder, department, gross/tax/net values, currency, fixed-scale exchange rate, base-currency value, invoice, receipt date, source, and notes. Invoiced revenue creates a linked customer invoice. Customer payments are immutable and update original- and base-currency paid balances atomically. Posted refunds remain separate records, reduce net revenue and outstanding receivables, and cannot exceed the linked net revenue.

Revenue allocations can distribute base-currency revenue to flights, routes, aircraft, departments, or general operations without changing the original posted record.

## Budgets and financial periods

Budgets are created by financial year and use the airline base currency. Lines support month or annual scope plus department, expense category, revenue category, aircraft, and route dimensions. Actuals derive from posted revenue, refunds, and approved operational expenses. Revenue variance is actual minus budget; expense variance is budget minus actual. Approved budgets and lines are immutable, while derived actual and variance fields may be refreshed.

Financial periods and dated exchange-rate records retain their source and UTC user attribution. Exchange rates use eight-decimal fixed precision.

## Financial dashboard

The dashboard reports gross and net revenue, approved operating expenses, operating contribution, revenue/cost per completed flight, revenue/cost per actual block hour, fuel, maintenance, airport and handling costs, receivables, base-currency payables, cash received, refunds, and monthly revenue/expense/contribution trends.

Only completed flights contribute to flight and block-hour denominators. Draft, submitted, rejected, and cancelled expenses are excluded from operating expense KPIs.

## Profitability estimates

Flight, route, and aircraft snapshots combine posted revenue and refunds with direct or flight-derived expense links. Costs are classified into fuel, airport and handling, crew-related, catering, navigation, maintenance, lease, and other operating costs. Each snapshot includes flight count, actual block hours, contribution, contribution percentage, cost/revenue per flight, and cost/revenue per block hour.

Every snapshot sets `is_estimate = 1`, and the interfaces clearly label these values as operational estimates wherever allocated costs are used.

## Security

Routes and services enforce finance, revenue, payment, refund, budget, and profitability permissions. Mutations use CSRF protection. Queries are prepared and airline-scoped. Money is stored as `DECIMAL` and calculated with fixed-scale integer arithmetic. Posted payments, refunds, revenue, and approved budgets are not silently overwritten. Material actions are audited.
