Postman collection
Reports Read

pixiReportGetUnshippableOrders

Returns open order lines that cannot be shipped because of missing stock, either as a summary row or as a per-line detail list.

The call is a wrapper around the internal procedure Report_GetUnshippableOrders. It always passes OrderlineStatus = NULL and ShopId = NULL, so all statuses and all shops are evaluated. It captures the result in a temporary table and returns a subset of the columns.

Selection of order lines

  1. Order lines must have status ANG or HAL, a set ItemRef and Qty > 0.
  2. Only orders are considered that have at least one such line in a location with SpecialStock = 0. If LocID is given, that location must be the one. An empty string counts as no filter.
  3. If IncludeCustLock is 0 or not sent, two kinds of orders are excluded:
    • orders whose customer has SLocked set to a value other than N/NULL
    • orders whose shipping address is locked (ASlocked = 'Y')
  4. If IncludeCustLock is 1, locked customers and addresses are included.
  5. For all ANG/HAL lines of the candidate orders, the internal procedure pixi_CalculateStockForOrderLines calculates whether each line can be shipped. Only lines with reservation info that are not shippable are returned.

Output depending on ViewDetails

  • 0: exactly one summary row with these values:
    • Orders: number of distinct orders
    • OrderTotal: sum of line prices
    • ShipCost: sum of shipping costs, counted once per order
    • DiffrentCustomers: number of distinct customers
    • MissingArticles: sum of quantities
    • DiffrentArticles: number of distinct items
    • dbCurrency
  • 1: one row per unshippable order line. The rows carry no defined sort order.

All amounts are converted into the database currency if the setting MultiCurrencyEnabled is active.

Notes

  • Always send ViewDetails explicitly. The wrapper checks ViewDetails = 0. A NULL value (the default) therefore takes the detail branch. The inner procedure, however, treats NULL as 0 and returns the 7-column summary. The INSERT ... EXEC into the 21-column detail table then most likely fails with a column mismatch error.
  • The header comment mentions order status OPEN/HOLD and line status NLB. The code only filters line statuses ANG and HAL and does not check the order status.
  • The LocID filter only selects candidate orders. Once an order qualifies, all its ANG/HAL lines are evaluated, including lines in other locations.
  • The shippability logic is in pixi_CalculateStockForOrderLines, which is not attached. It is called with SkipZeroStockItemsCalc = 1. The exact stock and reservation rules cannot be derived here.
  • OrderTotal and Price are based on the line field Price and are not multiplied by Qty.
  • In the detail list, ShipCost repeats the order's shipping cost on every line.
  • SLocked is not the customer's lock flag. It reflects the parameter: Y if IncludeCustLock = 1, otherwise N.
  • Shippable is always 0.
  • dbCurrency is only filled when MultiCurrencyEnabled is active, otherwise it is NULL. Amounts are divided by the exchange rate of the matching date. If no rate is found, the value is left unconverted.
  • In the summary, OrderTotal, MissingArticles and DiffrentArticles can be NULL or 0 when no unshippable lines exist, but a row is still returned.
  • All reads use NOLOCK, so uncommitted data may be included.

Tables used

Location · Read OrderStates · Read Orderlines · Read Addresses · Read OrderHeader · Read Customers · Read ExchRate · Read Items · Read
SQL object:
dbo.pipiReportGetUnshippableOrders
Updated at 2026-10-30