Changing a line quantity
The Ordered quantity of a line is the one field that stays editable after the order is launched.
You can change it in two places:
- the
Orderedbox of the line card, thenSave; - the
Orderedcell of the lines list, then theSaveof the lines toolbar.
Both places use the same rule. They pick the command by the state of the line.
Which command runs
| State of the order and the line | Command | Who may run it |
|---|---|---|
| The order is in the New family, was never released, and the line has no reservation | shipment_order_line_upsert (a whole-line write) | ADMIN, MANAGER, SUPERVISOR, OPERATOR |
| The order is launched, or the line has a reservation | shipment_order_line_adjust_qty (changes the quantity only) | ADMIN, MANAGER, SUPERVISOR |
The order is Closed or Cancelled | Neither. The Ordered field is read only. | Nobody |
The screen does not hide the field from an operator. The operator may type the number. If the second command is needed, the server refuses with a sentence that says to ask a supervisor. Hiding the field per role would be a weaker second copy of the server rule (line_write_route.rs, module comment).
Steps
- Open the order. Check the line.
- Change
Orderedin the line card, or in the grid cell. - Click
Save(card) orSaveof the lines toolbar (grid).
Rules of the quantity
- It must be greater than zero.
- It cannot go below what is already committed: the reserved quantity plus the cancelled quantity. The message is
cannot reduce qty_ordered to {new} — {committed} is already committed — release the line's reservations first (Unallocate). To go lower, give the reservation back first. See Unallocating an order. - To take a part of the quantity away from a launched line with a reason, use
Cancel Qtyinstead. See Cancelling part of a line. - Raising the quantity of a line that was fully cancelled brings the line back to
NotAllocated. The program works the status out from the numbers.
Source: crates/libs/wms-outbound/src/service/order_line/adjust_qty.rs:1-135, crates/libs/wms-outbound/src/domain/shipment_order_line/aggregate.rs:22.
What the screen says
| Where | Result | Message |
|---|---|---|
| Card | Saved by the quantity-only command | Ordered qty set to {qty} — now {status} |
| Card | The line is not saved yet | Save the line first |
| Card | Zero or empty | Ordered quantity must be greater than zero |
| Card | Refused, permission | Permission denied: changing the ordered quantity of a launched or reserved line is a supervisor action — ask a supervisor to make this change |
| Card | Refused, other reason | Could not change the ordered quantity: {error} |
| Card | You changed something other than Ordered on a frozen line | Only the ordered quantity can change on this line — release its reservations first (Unallocate) to edit the rest |
| Grid | Reason of a failed row (whole-line command) | Could not save the line: {error}, or Permission denied: you do not have permission to edit this order's lines |
| Grid | Reason of a failed row (quantity-only command) | Could not change the ordered quantity: {error}, or the supervisor sentence above |
| Grid | Saved | Saved {n} line(s) |
| Grid | Not saved | Nothing saved — line {id}: {reason} |
| Grid | Part saved | Saved {n} line(s), {m} failed — line {id}: {reason} |
| Grid | Somebody else changed the same line | the ordered quantity was {seen} when you started editing and is {stored} now — someone else changed it; your {typed} is still in the cell; press Save again to apply it, or Discard changes to drop it |
Source: line_save_action.rs:300-395, line_write_route.rs:196-230, lines_grid_save.rs (functions summary and changed_elsewhere_message).
What changes
| What | Change |
|---|---|
| Line | Ordered and the version are written. |
| Line status | Worked out again from the numbers. For example Allocated can become Partially allocated after a raise. |
| Order status | Worked out again in the same transaction. The order header on screen is read again. |
| Event | process.order.line_qty_adjusted (only for the quantity-only command). |
Related pages
- Line card
- Order lines list
- Cancelling part of a line
- Who can do what
- API:
shipment_order_line_upsert,shipment_order_line_adjust_qty(stateful commands, version of the line) - RF terminal: none.