Skip to main content

Adjustment lines

The lines list is the bottom part of the adjustment document. Each line names one stock position (owner, SKU, lot, location, container) and the target quantity it should hold after posting. The form is inventory_adjustment_line_list_form. The data object is inventory_adjustment_line, over the table inventory_adjustment_detail. The list is read by inventory_adjustment_line_preview_list, which adds a live forecast to every line.

A click on a row opens the line card in the same place (TargetForm to inventory_adjustment_line_form, slot slot_2).

Columns​

All columns are read only. The columns Mode, ID and Version are hidden.

LabelColumnTypeWhat it shows
Lineline_noWhole numberThe number of the line in the document. New lines get the next number.
Ownerowner_codeTextThe code of the owner.
SKUsku_codeText, up to 50 charactersThe SKU code.
LotlotText, up to 20 charactersThe lot.
LocationlocationText, up to 20 charactersThe location.
Containercontainer_codeTextThe container code. Empty means loose stock.
UnituomText, up to 10 charactersThe unit of measure. Taken from the SKU when the line is made.
Currentcurrent_qtyDecimalBefore posting: what the position holds now (0 when it has no balance row). Empty when the forecast refuses the line. After posting: empty.
Targettarget_qtyDecimalThe quantity the position should hold after posting. Never negative.
Effecteffect_qtyDecimalBefore posting: Target − Current, the change the post would make.
Beforeqty_beforeDecimalAfter posting: the quantity before, read from the ledger. For a line that changed nothing: the target.
Deltaqty_deltaDecimalAfter posting: the change, from the ledger. 0 for a line that changed nothing.
Afterqty_afterDecimalAfter posting: the quantity after.
Modetarget_modeTextHidden. Existing or CreateIfMissing. See below.
Reasonreason_codeText, up to 40 charactersThe reason of the line. Empty means the reason of the document.
StatusstatusTextThe status of the line: Pending, Valid, Invalid, Posted, NoChange.
Would Refuseforecast_messageTextBefore posting: why Post would refuse this line now. Empty when it would accept it.
Validationerror_messageTextThe refusal stored by the last Validate. Empty when the line passed or was never validated.
Ledgertransaction_log_codeText, up to 20 charactersAfter posting: the code of the ledger row in Transactions. Empty for a line that changed nothing.

Sources: the columns of the table in crates/libs/wms-lib-sql/sql/wms-app/migrations/053_the_inventory_adjustment_document.sql:49-75; the columns of the preview in crates/libs/wms-inventory/src/service/inventory_adjustment/read.rs:111-146; the list in 088_inventory_adjustment_screens.sql (meta-ui).

Line statuses​

StatusMeaning
PendingNew or changed. Not judged yet.
ValidThe last Validate accepted it.
InvalidThe last Validate refused it. Validation says why.
PostedThe post changed the stock. Ledger holds the ledger code.
NoChangeThe post found the stock already at the target and wrote nothing.

Any content change to the document (a line added, changed or removed, or a changed Reason or Comment saved on the header) puts every line back to Pending and clears Validation (crates/libs/wms-lib-core/src/model/inventory/inventory_adjustment.rs:571-583). Saving unchanged effective header values preserves the existing line verdicts.

Mode​

The mode is not chosen by the user. When a line is added, the system looks for a balance row with the same owner, SKU, pack, unit, lot, location and container:

  • It exists: the mode is Existing. Post adjusts that row. If the stock has moved away by the time of the post, the line is refused with INVENTORY_IDENTITY_GONE. It is never recreated.
  • It does not exist: the mode is CreateIfMissing. Post creates the stock. This is for stock that was found and the system did not have.

Source: crates/libs/wms-inventory/src/service/inventory_adjustment/add_line.rs:90-96.

Toolbar buttons​

ButtonEnabled whenWhat it doesTask page
Add LineThe document is saved and not postedOpens an empty line card for this document.Adding lines to an adjustment
DeleteOne line is ticked, and the document is not postedRemoves the line. It sends the version of the line.Deleting an adjustment
RefreshAlwaysReads the list again.

Grey texts: Add Line: Save the adjustment first (new document) or A posted adjustment cannot be changed. Delete: Tick a line to delete, A posted adjustment cannot be changed.

Result of DeleteMessage
RemovedLine {line} deleted
No rowTick one line to delete
The list changedThe lines have moved on — tick the line again and retry
Version unknownTick the line again: its version is unknown
RefusedLine {line} was not deleted: {error}

What it affects​

  • Adding, changing or removing a line moves the version of the document and puts it back to Draft.
  • Nothing changes stock until the document is posted.
  • The forecast columns read the stock of every line each time the list is drawn; they take no locks.

Who can use it​

Reading: ADMIN, MANAGER, SUPERVISOR, VIEWER. Adding and removing lines: ADMIN, MANAGER, SUPERVISOR. See Who can do what.