Skip to main content

Adjustment line card

The line card adds one line to an adjustment, or edits a line. It replaces the lines list in the bottom part of the document until you press Save or go back. The form is inventory_adjustment_line_form. The data object is inventory_adjustment_line_edit, over the table inventory_adjustment_detail. An existing line is loaded by get_inventory_adjustment_line.

You get here by pressing Add Line or by clicking a row of the lines list.

Fields​

LabelColumnTypeRequiredAllowed values and defaultWhat it does
Ownerowner_codePick list of owners (form owner_own_list_form), or typedYesAn owner code.Part of the stock identity.
SKUsku_codePick list of SKUs (form sku_list), or typed. Up to 50 characters.YesA SKU of that owner.Part of the identity. The pack and the unit are taken from the SKU.
LotlotPick list of lots (form inventory_balance_lot_list), or typed. Up to 20 characters.YesA lot code.Part of the identity.
LocationlocationPick list of locations (form location_list_form), or typed. Up to 20 characters.YesA location code.Part of the identity.
Containercontainer_codePick list of containers (form inventory_balance_container_list), or typedNoA container code. Empty means loose stock.Part of the identity.
Zone (From Stock only)zonePick list of put-away zones (form putawayzone_list_form), or typedNoA zone code. Hint: «From Stock» adds a line for every stock row these fields name; empty ones mean any.Used only by the button From Stock.
Target Quantitytarget_qtyDecimalYesA number of 0 or more. Hint: What the stock should hold after posting, not the difference.The quantity the position should hold after Post.
Reason (if not the document's)reason_codeDrop-down (code list inv_adjust_reason)NoEmpty means the reason of the document.A reason for this line only.
CommentcommentText, up to 500 charactersSometimesAny text.A note. A reason that asks for a comment is satisfied by the line's comment or the document's.
Lineline_noWhole number, read onlySet by the system.The number of the line.
StatusstatusText, read onlySee Adjustment lines.The status of the line.
Validationerror_messageText, read onlyEmpty when the line passed.The last refusal of Validate.

The fields ID, Adjustment and Version are hidden. They carry the line, its document and the version of the line.

After the first save Owner, SKU, Lot, Location, Container and Zone become read only (_code_readonly_hide_id, crates/services/web-ui-server/src/extensions/generic/code_readonly_render.rs:27-57). Only Target Quantity, Reason and Comment can change. The identity of a saved line never changes: remove the line and add another.

Sources: the form in crates/libs/wms-lib-sql/sql/wms-meta-ui/migrations/089_inventory_adjustment_ordinary_forms.sql; the line service in crates/libs/wms-inventory/src/service/inventory_adjustment/add_line.rs and form.rs.

Toolbar buttons​

ButtonEnabled whenWhat it does
SaveThe document is not postedAdds the line, or saves the changes. Then goes back to the lines list.
From StockThe document is not postedAdds a line for every stock row that the filled fields name. See below.
DeleteThe line is saved, its status is Pending, Valid or Invalid, and the document is not postedRemoves the line.

Grey texts: Save and From Stock: A posted adjustment cannot be changed. Delete: Only a saved line of an unposted adjustment is deleted.

Rules​

  • Owner, SKU, Lot and Location must be filled. Message: line {n}: SKU, unit, lot and location are all required.
  • The owner must exist: no owner {code}. The owner must have the SKU: owner {code} has no SKU {sku}. The SKU must have a default unit: SKU {sku} has no default unit; name the unit. The container must exist: no container {code}.
  • The target must be a finite number of 0 or more: target quantity {n} is not a non-negative number.
  • The same stock may be on a document only once: line {n}: the same stock is already on this adjustment.
  • A reason chosen for the line must be usable: reason {reason} is not on the adjustment reason list or reason {reason} is retired.
  • A new line is saved at the end. The document goes back to Draft.

From Stock​

From Stock reads the filters Owner, SKU, Lot, Location and Zone from the card. It needs at least one of them: name at least one of owner, SKU, lot, location or zone. For every balance row that matches it adds a line whose target equals the current quantity, so the document would change nothing until you edit the targets.

  • At most 1 000 lines are added in one go. A wider filter is refused, not cut: the filter names more than 1000 stock rows; narrow it.
  • Stock that is already on the document is skipped.
  • Messages: success Lines added from stock; failure No lines were added: {error}.

Source: crates/libs/wms-inventory/src/service/inventory_adjustment/generate_lines.rs.

Messages​

ButtonSuccessFailure
DeleteLine deletedThe line was not deleted: {error}
Delete without a saved lineSave the line first
Delete without versionReopen the line: its version is unknown
From Stock without a documentOpen the adjustment first

Not confirmed by code: what the form does when you try to clear the Reason or the Comment of a saved line. The save keeps the old value when the new one is empty (form.rs:159-160). To verify: edit a saved line, empty Comment, press Save, and read the line again.

What it affects​

  • Adding, changing or removing a line puts the document back to Draft, and every line back to Pending.
  • The identity of a new line decides the mode of the line.

Who can use it​

ADMIN, MANAGER and SUPERVISOR. See Who can do what.

  • Adjustment lines
  • Adding lines to an adjustment
  • Generating lines from stock
  • API: create_inventory_adjustment_line (the form's save, stateless), update_inventory_adjustment_line (stateful, version of inventory_adjustment_detail), inventory_adjustment_add_line (stateless), inventory_adjustment_generate_lines (stateless), inventory_adjustment_remove_line (stateful), get_inventory_adjustment_line
  • RF terminal: none.