# Phase 10.9 — Revenue Legacy Functional Parity

## Scope

Phase 10.9 closes the confirmed legacy Revenue function family:

- `monthly_revenue`
- `monthly_revenue_csh`
- `monthly_revenue_ins`
- `monthly_revenue_moh`
- `monthly_profilt_loss`

## Confirmed legacy contract

The old Revenue page exposed five charts and sent `var1`, `var2`, `from_date_v`, `to_date_v`, and `to_year` to the legacy dispatcher. The confirmed function family uses:

- `T_INP_OUTP_REVENUE_BATCH`
- `CREDIT_VALUE`
- `CASH_VALUE`
- `VISIT_END_DATE`
- `CUSTOMER_CODE` for MOH
- `INCOME_STATMENTS.CURR` for Profit/Loss
- `COMP_ID=31` for NJCH/JCKH and `32` for MNH
- MOH customer `365` for NJCH/JCKH and `9002` for MNH

## Runtime parity evidence

The phase executes two independent paths:

1. `LegacyRevenueRepository` — independent implementation of the confirmed old contract.
2. `RevenueRepository` — production implementation used by the modern Revenue page.

The gate compares every month, current total, comparison total, and maximum absolute delta. Money tolerance is `0.01`.

## Date range behavior

The old UI required From/To dates in the same year. Phase 10.9 preserves that contract. Revenue values use `VISIT_END_DATE` inclusively. The comparison window uses the same month/day range in the comparison year. Profit/Loss is monthly statement data, so date range is normalized to the inclusive selected month span.

## Executive UI requirements

The Revenue page follows Executive Leadership UI Standard v1.0:

- Primary text at least 16px.
- Arabic primary text 17px where appropriate.
- Three immediate context signals: current period, comparison period, active branch.
- Five primary financial views only.
- No technical QA or database text in the executive page.

## Security

`dashboard_role_revenue` is enforced in the controller and the Revenue navigation item is hidden when the user lacks access.

## Oracle writes

NONE. All Phase 10.9 parity checks are SELECT-only.
