Skip to content

Stock Out

Backlog fieldValue
Story IDINV-DASH-020
EpicInventory
Story typeDashboard
Review statusDraft - business analyst and business owner review required
Source evidenceInventory MFE route/form, Inventory.Apis controller, application command/query handlers, validators, domain entities, and posting services
Last source review2026-07-10

Purpose

Record stock issued from a warehouse for an authorized operational reason.

User stories

  • As a warehouse issuer, I want to create a Stock Out with warehouse, operational tag, and item lines so that issued stock is recorded.
  • As an issuer, I want to scan/search available items and tracking numbers so that I issue the correct stock.
  • As a supervisor, I want to check availability and post a valid draft so that balances and accounting are updated.
  • As an auditor, I want to view, print, search, and export Stock Out records.

Acceptance criteria

  1. A draft requires a valid date, source warehouse, applicable Stock Out tag, and at least one positive-quantity line.
  2. Item selection is constrained to items valid for the source warehouse and operation.
  3. Tracked lines use valid available tracking numbers and reconcile tracking quantity to line quantity.
  4. The system prevents quantity from exceeding available stock unless an explicit negative-stock policy permits it.
  5. Posting validates the open period, cost-center/account requirements, and Inventory settings.
  6. Successful posting decreases stock exactly once and records the resulting valuation/accounting impact.
  7. Draft edit/delete and post/print/export actions are independently permission-controlled.
  8. Posted transactions are immutable in the normal workflow.

Posting details

  1. Post accepts only a valid Draft in an open period. It verifies posted warehouse opening, absence of an active count lock, available base quantity, UOM conversion, item/warehouse eligibility, valuation cost, and exact tracking availability.
  2. For a manual Stock Out, the journal debits the selected Operational Tag GL account, grouped by the applicable cost center, and credits the source Warehouse GL account for the issued inventory value.
  3. For a delegated issue, the caller supplies the business counter-account: Sales normally supplies Cost of Goods Sold, while purchase return and warehouse transfer normally use Goods in Transit. That supplied account replaces the manual Operational Tag debit; the warehouse account remains the inventory credit.
  4. Posting consumes the appropriate stock and valuation layers, reduces on-hand/available quantities, records tracking movements, creates the linked journal, and marks Stock Out Posted. The caller retains the resulting Stock Out/journal identifiers and continues its own document lifecycle in the same unit of work.
  5. Quantity, tracking, valuation, journal, source links, and status are atomic. Any failed line or delegated operation rolls back the complete post, and retry cannot duplicate the issue. Reversal must restore both stock layers and accounting through the authorized originating-document workflow.

General ledger posting

ConditionDebitCreditAmount basisNotes
Manual Stock OutOperational Tag GL by cost centerSource Warehouse GLConsumed inventory costManual operational issue.
Sales issueCost of Goods SoldSource Warehouse GLConsumed inventory costSupplied by Sales source flow.
Purchase return or transfer issueGoods in TransitSource Warehouse GLConsumed inventory costBridge entry for the destination/vendor flow.
Failed/no-op post--NoneNo journal is retained.

Module and data effects

Affected areaEffectConditional/no-effect rule
Inventory quantityReduces source on-hand/available stock.Service/non-stock lines never call Stock Out.
ValuationConsumes the applicable valuation layers and records issue cost.No layer is consumed when availability validation fails.
TrackingConsumes selected batch/serial/expiry quantities.Untracked items have no tracking identity effect.
Source documentReturns Stock Out/journal IDs and issue cost to Sales, Purchase, Transfer, or Reconciliation.Manual Stock Out has no source lifecycle to update.
AccountingPosts cost versus warehouse inventory.No customer/vendor/cash entry is created by Stock Out itself.

Core acceptance scenarios

  1. Given valid available stock and manual Draft Stock Out, when Post is clicked, then the Operational Tag account is debited by cost-center group, Warehouse GL is credited, stock layers are consumed, and status becomes Posted atomically.
  2. Given Sales, Purchase Return, Transfer, or Reconciliation source, when delegated Stock Out posts, then its configured COGS or Goods-in-Transit account replaces the manual tag account.
  3. Given insufficient base quantity or invalid tracking/UOM/account/count lock, when Post is attempted, then no stock or GL effect is committed.

Data classification

DataRule
Receipt dateRequired by the page/business process and must resolve to a valid financial period.
Source document type and IDRequired; identifies the operational tag or upstream transaction.
WarehouseRequired; must exist, have a Warehouse GL account, and have no open reconciliation.
LinesAt least one required; duplicate item/UOM/variant/tracking combinations are rejected.
Item and variantRequired unless a valid barcode ID supplies them.
UOMRequired with a non-zero base conversion.
QuantityRequired and greater than zero.
CostDerived from stock for source flows using Weighted Average or Last Purchase; displayed/submitted cost produces subcost.
TrackingTracking type must match item configuration. Tracking number is required for serial, batch, or expiry-only stock.
Expiry dateRequired for batches and expiry-enabled serials.
Cost centerOptional per line; applied 100% to the matching debit journal group.
Notes/descriptionOptional; retained on the stock document and journal context.

Clicking Save

Save creates a Draft with a Stock Out sequence and no stock or GL effect. Draft changes remain permitted only while state and permissions allow.

Clicking Post

  1. Rejects missing or non-Draft documents and revalidates active references.
  2. Blocks the warehouse when reconciliation is open.
  3. Groups requested base quantity by variant and rejects insufficient warehouse stock; negative stock is not permitted in this posting service.
  4. Converts quantities to base UOM and selects matching stock by item, variant, warehouse, tracking type/number, and expiry behavior.
  5. Consumes inbound stock-detail availability in chronological order; source purchase returns use their source detail where tracking requires it.
  6. Decreases batch and aggregate warehouse availability and creates outbound stock history.
  7. Creates and links the journal, changes status to Posted, and commits once.

GL effect

  • Manual Stock Out: debit Operational Tag GL grouped by optional cost center; credit Warehouse GL.
  • Sales Invoice or reconciliation shortage: debit Inventory Settings COGS; credit Warehouse GL.
  • Transfer or Purchase Return: debit Goods in Transit; credit Warehouse GL.
  • Purchase Return with landed cost separates the non-landed portion to Goods in Transit and debits landed-cost expense accounts/cost centers for the returned landed-cost portion.

See Posting and Account Resolution.

Post failures

No committed effect occurs for insufficient stock, missing stock header/batch, invalid tracking, zero/missing UOM conversion, open reconciliation, missing warehouse/COGS/Goods-in-Transit/operational-tag GL, invalid period, inactive reference, or journal failure.

Status, action, and reversal controls

ActionRequired state/authorityPreconditions and affected dataFailure/reversal rule
Add/SaveStock Out Add; new/DraftDate, source warehouse, tag/source, positive lines, UOM and tracking; Draft onlyNo stock or GL effect before Post
Edit/DeleteDraft plus corresponding permission and state guardCurrent record, no posted dependencyPosted issue cannot be changed/deleted through Draft workflow
PostDraft plus PostOpen period, opening posted, no count lock, sufficient base quantity/tracking, issue cost and accountsLayer consumption, quantities, tracking, journal, links, and status are atomic
View/PrintView/print authorityAuthorized recordRead-only; exposes source and journal links when present
ReverseOriginating source reversal authorityLater consumption/transfer/count and period controls permit restorationRestore exact quantity, cost-layer relationship, and tracking plus opposite journal; original remains Posted/auditable

Reconciliation controls

ControlRequired equality
Requested base quantityConsumed layer and tracking quantities
Issue valuationDebit counter-account and credit Warehouse GL
Remaining warehouse stockPrior stock plus receipts minus issues, never below permitted policy
Source issueReturned Stock Out ID/cost and source posted/returned quantities

Frontend page coverage

The following UI coverage is sourced from the pulled MFE route configuration. A Module-level supporting artifact mapping is evidence of a reachable screen, but requires BA confirmation that it belongs to this story rather than a more specific feature story.

Route/pageComponentModeRoute permission/guardMapping confidenceSource
(module default)StockOutListComponentList/navigationPermission: AppInventoryPermissions.StockOut_List; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:134
:codeStockOutListComponentView/detailPermission: AppInventoryPermissions.StockOut_Add; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:145
addAddStockOutComponentAddPermission: AppInventoryPermissions.StockOut_Add; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:153
edit/:idEditStockOutComponentEditPermission: AppInventoryPermissions.StockOut_Edit; Guards: PolicyAuthGuard, preventPostedGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:164
stockoutMainStockOutComponentList/navigationPermission: AppInventoryPermissions.StockOut_List; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:124
view/:idViewStockOutComponentView/detailPermission: AppInventoryPermissions.StockOut_View; Guards: PolicyAuthGuardExplicit frontend feature ruleapps/inventory/src/app/remote-entry/transactions/transactions.module.ts:186

Observed frontend fields and validation

ComponentControlObserved frontend ruleComponent source
AddStockOutComponentbarCodeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentcostVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentcostCenterIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentitemNumberVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentnotesVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentquantityVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentreceiptDateConditionally required/validated in componentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentsourceDocumentIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentsourceDocumentTypeRequired in component validatorapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponenttrackingNoVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentuomIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentwarehouseNameVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
EditStockOutComponentbarCodeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentcostVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentcostCenterIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentitemNumberVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentnotesVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentquantityVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentreceiptDateVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentsourceDocumentIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentsourceDocumentTypeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponenttrackingNoVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentuomIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentwarehouseIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
ViewStockOutComponentcodeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentjournalCodeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentnotesVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentreceiptDateVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentsourceDocumentVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentsourceDocumentTypeVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentwarehouseIdVisible control; optional or API-dependentapps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts

Observed frontend actions

ComponentClick action/handlerBusiness review requirementComponent source
AddStockOutComponentaddNewRowAdd one initialized detail row without changing existing rows; apply defaults and line validators, preserve stable row identity, and exclude incomplete rows from Save/Post.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentdeleteRowAvailable only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
AddStockOutComponentopenDialogOpen the item/lookup/tracking dialog with the current warehouse, item, UOM, and remaining quantity context; accepted values must return to the correct line and cancel must not mutate it.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/add-stock-out/add-stock-out.component.ts
EditStockOutComponentaddNewRowAdd one initialized detail row without changing existing rows; apply defaults and line validators, preserve stable row identity, and exclude incomplete rows from Save/Post.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentdeleteRowAvailable only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
EditStockOutComponentopenDialogOpen the item/lookup/tracking dialog with the current warehouse, item, UOM, and remaining quantity context; accepted values must return to the correct line and cancel must not mutate it.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/edit-stock-out/edit-stock-out.component.ts
StockOutListComponentnavigateHelpPageComponentDocument the enabled state, permission, input context, resulting API or navigation effect, success refresh, and concrete failure behavior for this handler.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentonDeleteAvailable only in deletable states with Delete permission; identify the record in confirmation, call delete once, remove/refresh the list row on success, and retain the row with the API reason on failure.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentonEditOpen the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentonPostAvailable only for a postable Draft and Post permission; confirm the document, prevent a second submission, call the posting API, and refresh status, journal/stock links, and row actions. Failure must keep the pre-post state.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentonVeiwOpen the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentprintoutGenerate the printout for the selected record and authorized branch/tenant; use posted/current values and surface print, template, ZATCA/ETA, or popup failures without changing transaction state.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentrouteToJournalentryViewOpen the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
StockOutListComponentrouteToViewOpen the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/stock-out-list/stock-out-list.component.ts
ViewStockOutComponentrouteToJournalentryViewOpen the authorized record in view mode with its status, totals, lines, source and generated-document links; handle deleted, forbidden, and missing records without exposing stale data.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts
ViewStockOutComponentrouteToSourceTypeOpen the correct originating document type and ID only when a source link exists and its module view permission is available.apps/inventory/src/app/remote-entry/transactions/pages/stock-out/view-stock-out/view-stock-out.component.ts

Page-specific frontend acceptance criteria

  1. (module default) - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppInventoryPermissions.StockOut_List; Guards: PolicyAuthGuard
  2. :code - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: AppInventoryPermissions.StockOut_Add; Guards: PolicyAuthGuard
  3. add - Add: Render permitted fields, required indicators, defaults, dependent lookups, validation, Save/Cancel, loading, success, and API-error states. Security observed: Permission: AppInventoryPermissions.StockOut_Add; Guards: PolicyAuthGuard
  4. edit/:id - Edit: Load the identified record, enforce state/permission field locks, preserve concurrency identity, validate changes, and return without losing filters. Security observed: Permission: AppInventoryPermissions.StockOut_Edit; Guards: PolicyAuthGuard, preventPostedGuard
  5. stockout - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Permission: AppInventoryPermissions.StockOut_List; Guards: PolicyAuthGuard
  6. view/:id - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: AppInventoryPermissions.StockOut_View; Guards: PolicyAuthGuard

Internal Documentation — Microtec