Postman collection
Shipping Write

pixiSetOrderlinesInBoxToAUS

Ships out an order that sits alone in exactly one box: sets its boxed orderlines to status AUS and empties the box.

Performs the ship-out (scan-out) of an order that has been collected in a box and empties the box.

Steps:

  1. Collects all boxes that contain orderlines of OrderNr (via boxitems) and every order that is in these boxes.
  2. Checks that at least one of the settings Premium_API or Centralized_Ship_Out is enabled. Otherwise an error is returned.
  3. Checks that the order is in exactly one box. If no box is found, or the order is spread over several boxes, an error is returned.
  4. Checks that the box contains no other order. If it does, an error is returned.
  5. Reads the shipping address of the box (boxes.SAddrRef) and checks the shipping lock. The customer flag Customers.SLocked and the address flag Addresses.ASLocked are checked. If either is Y, an error is returned.
  6. If all checks pass, three internal procedures run:
    • GOSScanOutOrderline with status AUS. It sets the orderlines in the box with status EIN to AUS. It also sets orderlines of the same invoices that have status MIN, or a status listed in the setting PutThisStatusesOnInvoice, to AUS. For these lines it sets ShipDate, updates the order header status, writes order history, deletes reservations, updates bundle lines and closes related return case lines and return cases.
    • GOSDeleteAllItemsForBox removes all boxitems of the box.
    • GOSEmptyBox resets the box: customer, addresses and order are set to 0, BoxEndDate is set to now, and the wait and lock flags are reset.

The call always returns one row with Status (SUCCESS or ERROR) and Info. UserName is stored as the updating employee on the changed records.

Notes

  • All work runs in the named transaction OrderToAUS. On an error in the main procedure the transaction is rolled back. The returned row then has Status = ERROR and the SQL error text in Info. Info is truncated to 150 characters.
  • The called GOS… procedures catch their own errors and log them via log.InsertError without re-raising them. A failure inside them can therefore be rolled back (completely or to a savepoint) while the call still reports SUCCESS. Check the data if in doubt.
  • The box and order counts are taken from grouped queries. The value of the last processed group is used. In mixed cases (for example several boxes that hold several orders), the specific error message returned may vary. The call is still rejected as long as the order is not alone in a single box.
  • Reads use NOLOCK. Updates in the sub-procedures use ROWLOCK. GOSScanOutOrderline suppresses the Orderlines update trigger via CONTEXT_INFO and writes OrderHistory itself.
  • Validation errors still end with a commit, but nothing has been written at that point.

Tables used

Orderlines · Write boxitems · Write boxes · Write Customers · Read Addresses · Read Settings · Read Invlines · Read OrderHeader · Write OrderHistory · Write Reservation · Write BundleOrderlines · Write RET_CASE_LINES · Write RET_CASES · Write RET_CASES_HISTORY · Write
SQL object:
dbo.pipiSetOrderlinesInBoxToAUS
Updated at 2026-10-30