# WP3 — FE: line unit dropdown scoped to the product's units

## Goal
Today the per-line unit dropdown lists **every company unit** (`selectAllUnits`) and `unit_id` is **locked** in doc-config, so a user can't meaningfully pick the right unit for a product. Make the per-line unit dropdown show **only the selected product's units** (its base unit + its `product_units`), unlock the column so it's selectable, and default a line to the product's base unit on product pick. This is FE-only — the BE already converts based on the chosen `unit_id` (WP1/WP2). Re-pricing on unit change is WP4 (out of scope here).

## Explore first (Phase-1 research pointers; verify current state)
- The shared line grid: `src/app/features/**/TransactionLineItemsComponent` (descriptor-driven) and the per-doc components (sales invoices/orders, purchases). The unit column options come from `selectAllUnits` (all company units) via `UnitsActions.loadUnits`.
- `src/app/core/services/doc-config.service.ts` — `unit_id` is marked `locked`. Unlock it (or make it selectable) for the line grid.
- Product model/resource: check whether the product payload the line already has includes `product_units` (and `base_unit_id`). `src/app/core/models/product.model.ts` has `ProductUnit`. `product.service.ts` has `listProductUnits`. The product-search result may or may not include productUnits — determine how to get the selected product's units into the line context (prefer data already on the product payload; only fetch if necessary).

## Implement
1. **Scope the per-line unit options to the product's units:** when a line has a product, its unit dropdown options = the product's base unit + its `product_units` (mapped to the `units` they reference). If the product has no alternate units, the dropdown shows just the base unit (or is effectively fixed) — so single-unit products are unchanged in behaviour. Do NOT globally remove `selectAllUnits` if other screens depend on it — scope at the line level.
2. **Default the line unit** to the product's `base_unit_id` on product select (Phase-1 says this already happens for most docs — verify + keep).
3. **Unlock the unit column** in the line grid (doc-config) so the dropdown is editable.
4. Keep the entered quantity as-is on unit change (document qty stays in the ENTERED unit — the convention). No qty auto-conversion, no re-pricing here (WP4).
5. i18n if any new labels.

## Acceptance criteria
- On a sales/purchase line, after picking a product that HAS alternate units (e.g. base kg + carton), the unit dropdown shows only kg + carton — not all company units; picking carton sets the line `unit_id` accordingly (which the BE then converts).
- A product with only a base unit → dropdown effectively shows just that unit; behaviour unchanged.
- `unit_id` is selectable (unlocked) on the line grid.
- `ng build` green.

## Tests
- `cd /home/moonui2/public_html/moon-erp && npx ng build` → success. (No FE unit-test harness in this project; build + manual reasoning is the gate.)

## Flags
- Not [FIN] (presentation/selection only — the money conversion is BE). No migration.

## Out of scope
- Re-pricing per unit + POS barcode (WP4). Display of unit on balances/reports (WP5). Any BE change.
