Skip to main content

Influence: What a Reservation Protects

A reservation is a number on a stock row: inventory_balances.qty_allocated. Other inventory operations read this number. This page shows which operation respects it and what the user sees when it refuses.

1. Who respects qty_allocated​

What this shows. For one stock row with a reserved quantity, what each operation may do with the reserved part.

OperationRuleWhat the user sees
New allocationThe available quantity is qty - qty_allocated - qty_picked, minus the whole row if a blocking hold covers it, and never below 0Reserved units are not offered twice
Generic moveTakes only free stock (AvailableMove)insufficient qty: requested {r}, available {a}
Full move of a rowA partly reserved row refuses the whole movefull move refused: only {a} of {r} is available — the rest is reserved (qty_allocated/qty_picked)
Move of a containerRefused if any row inside carries reserved or picked stockcontainer move refused: container {id} still holds reserved stock ...
RepackRefused if a row that would change container is reservedrepack refused: container {id} still holds reserved stock ...
Stock adjustmentThe new quantity cannot be below qty_allocated + qty_pickedbalance {id}: the target is below what is reserved (allocated {x}, picked {y})
Discrepancy quarantine (short pick follow-up)Whole-row mode needs proof that no row is reserved. Partial mode moves only the free part. Reserved and picked stock staysThe location keeps its flag CycleCountActive, so nobody allocates the rest
Pick of the reservationReduces qty and qty_allocated together on exactly the source row of the pickThe pick is the only operation that consumes a reservation

Reading notes.

  • To free a reservation, use Unallocate, delete the pick, cancel the order or short the pick (see page 13 and page 14). No inventory screen releases it.
  • A hold does not change qty_allocated. It makes the row unavailable for new allocation and stops the pick (see page 24).
  • The reservation is recorded twice: on the stock row and on the order line (shipment_order_line.qty_allocated). The pick_detail row keeps the position (lot, location, LPN) that was reserved.

Where it comes from​

RuleCode
Available quantity of the viewcrates/libs/wms-lib-sql/sql/wms-app/migrations/011_a_hold_says_what_it_forbids.sql:105-114
Accounting modes of a movecrates/libs/wms-inventory/src/stock_move/accounting.rs:12-52
Generic move takes the free partcrates/libs/wms-inventory/src/movement/move_lines.rs:100-190
Refusal texts of full move and container movecrates/libs/wms-inventory/src/movement/types.rs:473-510
Refusal text of repackcrates/libs/wms-inventory/src/error/container.rs:83-104
Adjustment floorcrates/libs/wms-inventory/src/stock_adjust/plan.rs:112-123, crates/libs/wms-inventory/src/stock_adjust/mod.rs:91-100
Quarantine: proof of no reservation, partial quarantinecrates/libs/wms-inventory/src/stock_move/accounting.rs:54-77, crates/libs/wms-inventory/src/picking/remediation.rs:1-20
Pick consumes its reservation: source must hold qty and qty_allocatedcrates/libs/wms-inventory/src/picking/reserved_pick.rs:306-314
Reserve writes qty_allocated on the balance and on the linecrates/libs/wms-outbound/src/allocation/reserve.rs:186-205