Skip to main content

Journey: Unallocate and Cancel

Stock that an order has reserved comes back in four ways: the Unallocate button, deleting one pick, cancelling the order, and a short pick (see page 14). This page shows what each one frees and what it keeps.

1. What the Unallocate button does​

What this shows. Unallocate frees the picks that nobody works on and keeps the rest.

Reading notes.

  • A pick is "in work" when its task has a status other than Created. Those picks stay, with their task and their reservation.
  • If the order was released and no live pick is left, the release marker is cleared. The order goes back to New, and the toast adds order back to New.
  • If some picks stay, the toast adds N pick(s) in work kept.
  • The statuses accepted by the button: PartiallyAllocated, Allocated, PartiallyReleased, Released. Any other status is refused as an invalid transition.
  • The freed stock is available again at once. Nothing allocates it again by itself. Somebody must press Allocate or Release.

Where it comes from​

Step in the diagramCode
Button calls shipment_order_cancel_allocationcrates/services/web-ui-server/src/extensions/customization/shipment_order/unallocate_action.rs:47
Roles of the method: Admin, Managercrates/services/app-server/src/web/rpcs/shipment_order_commands_rpc.rs:55-56
Status gatecrates/libs/wms-outbound/src/service/order/cancel_allocation.rs:123-134
Release with scope "skip in work"crates/libs/wms-outbound/src/service/order/cancel_allocation.rs:143-148
"In work" means task status is not Createdcrates/libs/wms-outbound/src/allocation/release.rs:145-147
Lock order and the loop that frees balance, deletes pick and taskcrates/libs/wms-outbound/src/allocation/release.rs:296-412, crates/libs/wms-outbound/src/allocation/release.rs:416-495
Event process.order.line_allocation_releasedcrates/libs/wms-lib-core/src/model/integration/event_payloads/order.rs:238
Picks left, release marker cleared, status recomputedcrates/libs/wms-outbound/src/service/order/cancel_allocation.rs:157-172
Toast textcrates/services/web-ui-server/src/extensions/customization/shipment_order/unallocate_action.rs:113-127

2. Which action frees which reservation​

What this shows. The five actions that touch a reservation, and the rule each one applies.

Reading notes.

  • Cancel order uses the scope "all". It frees every live pick (Allocated or Released), also those with a task in work, and deletes the task of each. It is refused only when some line already has picked quantity.
  • Cancel qty works on ordered - cancelled - max(allocated, shipped). A reserved unit cannot be cancelled. Unallocate it first.
  • Adjust qty sets a new absolute quantity. It is refused below allocated + cancelled.
  • Removing a line, or changing a line through the editor, is allowed only while the order is in the New family without a release marker, and only if the line has no reserved quantity. The refusal text says: release the reservation first (Unallocate or delete its picks).
  • Unallocating does not change the policy of a line. The line keeps the policy it froze when it was created or last saved (see page 22).

Where it comes from​

RuleCode
Delete one pick: order status, same order, nothing picked, task not in workcrates/libs/wms-outbound/src/service/order/delete_pick.rs:121-188
Delete one pick: free balance and line, delete pick and taskcrates/libs/wms-outbound/src/allocation/release.rs:518-597
Cancel order: refused when a line has picked qtycrates/libs/wms-outbound/src/domain/shipment_order/aggregate.rs:206-218
Cancel order: frees all live picks, scope "all"crates/libs/wms-outbound/src/service/order/cancel.rs:92-100
Scope "all" also removes tasks in workcrates/libs/wms-outbound/src/allocation/release.rs:437-445
Live picks are the ones with status Allocated or Releasedcrates/libs/wms-lib-core/src/model/outbound/pick_detail.rs:630-645
Open quantity for cancelcrates/libs/wms-outbound/src/domain/shipment_order_line/aggregate.rs:59-63, crates/libs/wms-outbound/src/domain/shipment_order_line/aggregate.rs:110-123
Adjust qty floorcrates/libs/wms-outbound/src/domain/shipment_order_line/aggregate.rs:192-204
Line is editable only in the New family, with no reservationcrates/libs/wms-outbound/src/service/shared/mutability.rs:36-91
Remove line uses that gatecrates/libs/wms-outbound/src/service/order_line/remove.rs:79