Postman collection
Orders Read

pixiReportGetShippableOrdersV2

Returns open orders or order lines that can be shipped from current stock, either as line details or as totals, optionally per location.

Determines which open orders can be shipped with the current stock and returns them as line details or as aggregated totals.

1. Candidate orders

  • Only order lines in status ANG or EIN (as far as these exist in OrderStates) with an ItemRef and Qty > 0 are considered. Replacement lines without an item are skipped.
  • ShopId: only orders whose customer has CustomerOf = @ShopId. An empty string (the default) means all shops.
  • Orders whose shipping or billing address is locked (ASlocked = 'Y') are excluded.
  • Orders whose header is locked (OhSLocked = 'Y') are excluded.
  • Ship date: by default only orders without a ship date or with a ship date before tomorrow are included. With IncludeOrdersWithAnyShipDate = 1 the ship date is ignored.

2. Stock check For every candidate line, the internal procedure pixi_CalculateStockForOrderLines decides whether the line is shippable. Stock of locations with SpecialStock = 0 is used. Earlier reservations and older unreserved order lines (FIFO by reservation date / order line key) are subtracted from the stock. Lines in status EIN always count as shippable. UseFIFObyLocationV2 selects whether stock is checked per location of the line (1) or summed over all locations (0). NULL means the value of the setting UseFIFObyLocation is used.

3. Filter by part delivery

  • OnlyPartDelivery = 0, IncludePartDelivery = 0: all lines of orders in which every candidate line is shippable (complete orders only).
  • OnlyPartDelivery = 0, IncludePartDelivery = 1: all shippable lines, regardless of whether the order is complete.
  • OnlyPartDelivery = 1: only shippable lines of orders that also contain at least one line that is not shippable. IncludePartDelivery is ignored.

4. Currency If the setting MultiCurrencyEnabled is 1, Price and ShipCost are divided by the exchange rate of the database currency source for the order's currency and exchange date. The result is in the database currency, and dbCurrency holds its code. If no matching rate is found, the amounts are left unchanged. Without multi-currency, amounts are returned as stored and dbCurrency is NULL.

5. Output (exactly one result set, chosen by ViewDetails and PerLocation)

  • ViewDetails = 1, PerLocation = 0: one row per line, sorted by OrderNr, OrderlineRef.
  • ViewDetails = 0, PerLocation = 0: one total row with the number of orders, order value (Price * Qty), shipping cost and picks.
  • ViewDetails = 1, PerLocation = 1: like the details, with an additional LocationId column.
  • ViewDetails = 0, PerLocation = 1: one total row per location.

Notes

  • All reads use NOLOCK. The result can contain uncommitted data and is a snapshot only; nothing is reserved or changed.
  • NULL values for ViewDetails, IncludePartDelivery, OnlyPartDelivery and PerLocation are treated as 0. An empty ShopId is treated as "all shops". A NULL value for IncludeOrdersWithAnyShipDate acts like 0.
  • Settings that change the behaviour:
    • MultiCurrencyEnabled: currency conversion and the dbCurrency column.
    • HomeCurrency and DatabaseCurrencyExchRateSourceId: which database currency and rate source are used.
    • UseFIFObyLocation: used when UseFIFObyLocationV2 is NULL.
  • Whether an order is "complete" is judged only by its ANG/EIN lines with an item and positive quantity. Lines in other statuses are ignored.
  • ShipCost is the shipping cost of the order header, repeated on every line. The totals add it once per order. In the per-location totals it is added once per order and location, so an order spread over several locations counts its shipping cost in each of them.
  • In the overall totals (ViewDetails = 0, PerLocation = 0) one row is always returned. If nothing is shippable, Orders = 0, ShipCost = 0, and OrderTotal/Picks are NULL. The per-location totals return no rows in that case.
  • The comment in the code marks PerLocation as the "old way".
  • The internal stock procedure calls log.EventDurationInsert (definition not attached), which presumably writes a duration log entry.
  • The call scans all open ANG/EIN order lines and their reservations and can be expensive on large databases.

Tables used

OrderStates · Read Orderlines · Read OrderHeader · Read Customers · Read Addresses · Read ExchRate · Read Currency · Read Settings · Read Location · Read ItemLocationSpecific · Read Reservation · Read
SQL object:
dbo.pipiReportGetShippableOrdersV2
Updated at 2026-10-30