Skip to main content

Validating an adjustment

Use this page to ask the system whether the document can be posted. Validate judges every line without changing any stock.

Before you start​

  • The document has at least one line: the adjustment has no lines.
  • The status is Draft, Validated or Approved. A posted document is not validated again.

Steps​

  1. Open the adjustment.
  2. Click Validate.
  3. Read the message. If it says Adjustment {number} is Validated, all lines passed. If it says Adjustment {number} is not validated: line 2 — ..., open the list and read the column Validation of each Invalid line.
  4. Fix the lines, and click Validate again.

What it checks​

For each line, in this order (crates/libs/wms-inventory/src/service/inventory_adjustment/validate.rs):

  1. The stock rules, the same that Post applies (crates/libs/wms-inventory/src/stock_adjust/mod.rs:84-136). See the table below.
  2. The reason of the line (its own, or the document's): it must be on the list and active.
  3. The direction: a line that adds stock needs a reason that allows adding; a line that removes stock needs one that allows removing. A line whose change is 0 passes any reason.
  4. The comment: if the reason asks for a comment, the line or the document must have a non-blank one.

The document becomes Validated only if every line passes. Otherwise it is Draft, and each refused line is Invalid with a code and a message.

Line refusals​

CodeMessageMeaning
INVALID_TARGET_QTYtarget quantity {n} is not a non-negative numberThe target is negative or not a number.
DUPLICATE_IDENTITYthe identity has more than one balance row ({ids})The books have two rows for one stock identity. Repair the data first.
INVENTORY_IDENTITY_GONEthe stock this line was about is no longer thereA Existing line, and the balance row has gone.
BELOW_RESERVED_QTYbalance {id}: the target is below what is reserved (allocated {a}, picked {p})The target is lower than what orders have allocated or picked.
STOCK_CHANGED_SINCE_COUNTthe stock changed since it was counted (counted against {e}, holds {c} now): count it againA line made by a count: the stock moved after the count.
DUPLICATE_DOCUMENT_IDENTITYthe same identity is named by another line of the documentTwo lines name one stock.
SERIAL_TRACKED_NOT_SUPPORTEDserial-tracked SKU {sku}: adjustment does not support serials yetThe SKU is tracked by serial number. Adjustments cannot change it.
LOT_UNKNOWNlot {lot} does not exist for this owner and SKUA line that would create stock names a lot that does not exist.
LOCATION_REFUSES_STOCKthe location refuses this stock: {message}A line that would create stock: the location's rules (mixing of SKUs or lots) forbid it.
LOCATION_IN_TRANSITlocation {location} holds only open pick pallets: it is not adjustedThe location of open pick pallets is never adjusted.
CONTAINER_STANDS_ELSEWHEREcontainer {c} stands at {l}: no stock is created in it elsewhereA line that creates stock names a container that stands in another location.
CONTAINER_HELD_BY_PICKINGcontainer {c} is held by picking and stands at {l}: no stock is created in it elsewhereThe same, and picking holds the container.
REASON_UNKNOWNreason {code} is not on the adjustment reason list
REASON_INACTIVEreason {code} is retired
REASON_FORBIDS_INCREASEreason {code} does not allow adding stock (+{n})
REASON_FORBIDS_DECREASEreason {code} does not allow removing stock ({n})
REASON_REQUIRES_COMMENTreason {code} requires a comment

What the screen says​

ResultMessage
All lines passedAdjustment {number} is Validated
Some refusedAdjustment {number} is not validated: line {n} — {message}; ... (first 3 lines, then and {k} more)
ErrorThe adjustment was not validated: {error}
No linesThe adjustment was not validated: the adjustment has no lines
PostedThe adjustment was not validated: a posted adjustment cannot be changed

What changes​

WhatChange
LinesEach line becomes Valid or Invalid, with error_code and error_message. The version of a line does not move.
DocumentValidated (with validated_by and validated_at) or Draft. The approval, if any, is cleared. The version goes up.
StockNothing.

Validating is not a promise: the stock may change before the post. The post repeats the checks under lock.