# Indirect Goods Upgrade — Phase 9 Completion

## Scope completed

Phase 9 unifies direct and indirect demand on the Material Issue workflow while preserving separate stock ledgers and fulfillment services.

### Material Issue workflow

- Direct and indirect request rows are grouped into one Material Issue entry when their request number, project and requester match.
- The issue screen keeps separate direct and indirect sections for warehouse inventory, supplier direct delivery and FOC stock.
- Each indirect source has its own quantity and division input. Quantities are no longer merged into a single indirect allocation array.
- Source-specific availability is displayed and refreshed by division.
- Requested, previously issued, proposed and remaining quantities are shown and checked in the browser; the service layer remains the authoritative server-side validator.
- Direct and indirect allocations can be submitted together, with database transactions protecting the combined operation.

### Issue details and documents

- The issued-details page displays both goods types on one screen.
- Each indirect line displays its actual fulfillment type, quantity, source reference, returned quantity and consumed quantity.
- Direct lines display recorded fulfillment type, quantity and reference.
- The combined Material Issue Note includes direct and indirect lines and prints source-specific warehouse, FOC and supplier direct-delivery quantities and references.
- View and print actions are kept together on the Material Issued listing and the details page exposes the combined print action.

## Data integrity boundaries

- Direct goods continue to use direct inventory, fulfillment, transfer and FOC records.
- Indirect goods use `indirect_goods_fulfillments` and fulfillment allocations as the issued-quantity/source authority.
- Indirect project returns remain FOC-only and are not mixed into the direct-goods damaged-item tables.
- Feature flags continue to control indirect warehouse issue, supplier direct delivery, FOC issue and returns independently.

## Verification

- PHP syntax check for `MaterialIssueController`.
- Laravel Blade compilation for all views.
- Indirect domain invariant unit tests.
- Diff whitespace/error check for Phase 9 files.
- Read-only fulfillment/released-quantity reconciliation.

## Phase 9 exit criteria

- Mixed direct/indirect requests support partial allocations across their allowed sources.
- UI labels and printed source descriptions reflect the stored fulfillment type.
- Existing direct-goods issue records remain on their original ledger path.

