Inventory Units (UNT)
The unt submodule of inv owns the lowest-level identity-tracked inventory record: an InventoryUnit is one physical "thing" tracked by its cost-unit code (a coil, a roll, a pallet) plus its current location, supplier-lot, and a bundle of operational status flags. The submodule also owns the timestamped status-event and location-transaction streams that drive every status change and physical move. It depends on inv.loc for warehouse locations, inv.bun for the optional bundle a unit belongs to, inv.lot for the supplier lot and item lot, inv.lev for the on-hand inventory levels consulted before a move, acc.cst for the cost unit, and cat.itm for the item.
Concepts
Inventory UnitA single identity-tracked physical thing. Identified by its
CostUnit(one-to-one). Tracks the current location, the supplier lot, a derived availability status, and a small set of status flags (obsolete, complaint, reject, blocked, inspect).Inventory Unit StatusA reference type that maps a status code to two derived flags —
statusBlockedandstatusInspect— that a unit inherits when the status is applied.Inventory Unit Status EventAn immutable timestamped record of a status change on a unit, carrying the user, the (optional) new status, and a free-form description. Goes through
Draft→Processed.Inventory Location TransactionAn immutable timestamped record of a unit moving from one warehouse location to another, optionally as part of a bundle move. Goes through
Draft→Processed; processing flips the unit’s current location and rolls the bundle along when present.Inventory Availability StatusA derived enum (
UUnrestricted /BBlocked /IInspect) that other modules consult to decide whether a unit may participate in a flow.Inventory Transaction TypeThe classifier consumed by
HasInventoryTransaction(ininv.loc) to say what kind of inventory operation a row represents — see Inventory Transaction Types below.
Entities
Inventory Unit (InventoryUnit)
A single identity-tracked physical thing.
| Field | Description |
|---|---|
| The cost unit (one-to-one, business key, final). |
| Optional supplier lot. |
| Optional current warehouse location. |
| Operational flag: marked obsolete. Default |
| Operational flag: marked under complaint. Default |
| Operational flag: marked rejected. Default |
| Derived flag: blocked from outbound flows. |
| Derived flag: requires inspection before release. |
| Optional derived |
| Derived availability — |
| Internal shortcut to the cost unit’s item (business-information). |
A validation rule enforces that the cost unit’s item equals the supplier lot’s item.
Inventory Availability Statuses (InventoryAvailabilityStatus)
| Code | Name | Meaning |
|---|---|---|
| Unrestricted | Available for any flow. |
| Blocked | Not available for outbound flows. |
| Inspect | Quarantined pending inspection. |
Inventory Transaction Types (InventoryTransactionType)
These are the kinds of inventory operations carried by every HasInventoryTransaction implementation across the ERP.
| Code | Meaning |
|---|---|
| Purchase receipt |
| Sales delivery |
| Warehouse receipt |
| Warehouse issue |
| Production issue |
| Production receipt |
| Sales issue |
| Sales return / receipt |
| Subcontract issue |
| Subcontract receipt |
| Adjustment |
Inventory Unit Status (InventoryUnitStatus)
A reference status code with two derived flags.
| Field | Description |
|---|---|
| Business key (up to 4 characters). |
| Human-readable name. |
| Whether units carrying this status are blocked. Default |
| Whether units carrying this status require inspection. Default |
Inventory Unit Status Event (InventoryUnitStatusEvent)
A timestamped record of a status change. Implements the framework IsEvent interface.
| Field | Description |
|---|---|
| Owning unit (composite business key with |
| When the event was recorded (final). |
| The user who applied the status (final). |
| Optional new status (final). |
| Optional free-form note. |
| Lifecycle flag. |
Inventory Location Transaction (InventoryLocationTransaction)
A timestamped record of a unit moving between warehouse locations.
| Field | Description |
|---|---|
| Owning unit (composite business key with |
| When the move happened (final). |
| Optional bundle the move applies to (final). |
| Optional source location (final). |
| Destination location (final). |
| Lifecycle flag. |
Functionality
Recording a unit move
InventoryLocationTransactionActionWriter.addInventoryLocationTransaction records a fresh InventoryLocationTransaction for a unit (and optional bundle) moving to a target location, in Draft state. The from location is captured from the unit’s currentLocation at the time of recording.
Processing a unit move
processInventoryLocationTransaction is the seam invoked by the confirm action on the move event. It looks up the unit’s on-hand inventory line through inv.lev, raises a business exception if there is no on-hand stock or if there is more than one on-hand line (an integrity invariant), updates the unit’s currentLocation, rolls the bundle along when one is present, and marks the transaction Processed.
Bundle relocation
changeBundleLocation is the bundle-side counterpart used when a whole bundle moves. It records and processes a single transaction per affected unit while keeping the bundle/unit relationship in sync.
Status events
InventoryUnitStatusEventActionWriter is the action handler for the confirm and confirmUndo actions on a InventoryUnitStatusEvent. Confirming the event applies the new status to the unit (recomputing biStatusBlocked, biStatusInspect, and the derived biAvailabilityStatus); confirmUndo reverts to the previous state. The unit entity recalculates biAvailabilityStatus whenever a status flag changes (__setBiStatusBlocked and friends).
Public API
INV_UNT_QueryApi
This submodule does not provide a query API class. Other modules read units, statuses, status events, and location transactions through the standard generated readers.
INV_UNT_CommandApi
Write-side facade. All three methods delegate to InventoryLocationTransactionActionWriter.
| Method | Description |
|---|---|
| Records a draft move event for a unit (and optional bundle) to a target location. |
| Moves a whole bundle to a target location. |
| Processes a draft move event: updates the unit’s current location and (when relevant) the bundle, marks the event processed. |
ViewModel actions
| Action | User-visible effect |
|---|---|
| Processes a drafted move: updates the unit’s location and rolls the bundle along. |
| Reverts a processed move back to draft. |
| Applies the status to the unit and recomputes its availability. |
| Reverts the status change. |