Postman collection
Stock Read

pixiGetChangedItems

Returns all items changed since a given point in time with their available stock and the earliest expected delivery date from open supplier orders.

Returns one row per item in Items whose UpdateDate is greater than or equal to @Since. This makes the call suitable for delta synchronisation of stock levels, for example to an online shop.

For each item the call calculates:

  • AvailableStock: the item quantity (Items.Quantity) minus open order quantities minus open reservations. Negative results are returned as 0.
    • Open orders are computed by fPIXI_OpenOrdersCountForItem_ForStockExport. It sums OrderLines.Qty for lines with status ANG or BES, plus lines with status HAL whose order date is at most HalOrdersActiveDays days old.
    • Open reservations are the sum of InvBinItem.BinItemQty over pick list items whose pick list header has a ReservedOrderNr and an expiry date (PLHexpiryDate) in the future.
  • EstimatedDelivery: the earliest EstimatedDeliveryDate of supplier order lines for the item that still have an open quantity, meaning ordered minus delivered minus undelivered is greater than 0. Only supplier orders whose status has IsOrderedConfirmed = 1 count; a code comment names these as ordered/confirmed. The value is NULL if there is no such line.

The call does not sort the rows and has no paging.

Notes

  • All tables are read WITH (NOLOCK), so results may include uncommitted data.
  • The HAL window comes from the setting HalOrdersActiveDays, read via fPIXI_GetSetting (not attached). If the setting is 0 or empty, 7 days are used.
  • Only changes to Items.UpdateDate select an item. The code does not show whether new orders, reservations or supplier orders update this column. Stock changes caused by those records may therefore not be reported.
  • If @Since is NULL, no rows are returned.
  • The calculation runs a scalar function and two subqueries per item. Use a recent @Since to keep the result small.

Tables used

Items · Read PLHeader · Read PLitem · Read InvBinItem · Read SupplierOrderLine · Read SupplierOrder · Read SupplierOrderStatus · Read OrderLines · Read
SQL object:
dbo.pipiGetChangedItems
Updated at 2026-10-30