Postman collection
Stock Read

pixiGetItemsStockHistory

Returns the bin stock movement log for all items in a date range, with optional filters by location, order, delivery and relocation transaction.

Returns entries of the bin item log (stock movements on bins), similar to the bin history in the Pixi client but for all items at once.

Steps:

  1. Normalises the input: an empty or missing DateTo becomes the current date and time, blank Location and OrderNumberExternal become NULL (after trimming), DeliveryNumber = 0 is treated as no filter, RowCount defaults to 1000 and IbilKey to 0.
  2. Selects log entries with:
    • IBILkey greater than IbilKey (for paging),
    • UpdateDate >= DateFrom and < DateTo (the upper bound is exclusive),
    • optionally LocID = Location,
    • optionally the external order number of the linked order line = OrderNumberExternal,
    • optionally the number of the linked supplier delivery = DeliveryNumber,
    • optionally the linked relocation transaction = RelocateTransactionID,
    • entries written by the user AutoExport are always excluded.
  3. Enriches each entry with item data (internal item number, EAN, supplier item number), bin name, stock movement type and operation, batch number, best-before date, relocation transaction ID, delivery number and external order number.
  4. Returns at most RowCount rows, sorted by IBILkey ascending.

Paging: pass the highest IBILkey of the previous response as IbilKey to fetch the next page.

Notes

  • All tables are read with NOLOCK, so uncommitted movements may appear and results are not guaranteed to be consistent.
  • The procedure is created WITH RECOMPILE; a new execution plan is built on every call.
  • Entries whose UpdateEmp is AutoExport or NULL are never returned (the comparison <> 'AutoExport' excludes NULL).
  • Bins are joined with a LEFT JOIN, so entries for deleted bins are returned with an empty BinName. Log entries whose item no longer exists in Items are not returned.
  • Setting OrderNumberExternal, DeliveryNumber or RelocateTransactionID implicitly returns only entries that are linked to an order line, delivery or relocation transaction.
  • If a log entry is linked to several relocation transactions, it can appear more than once.
  • A negative RowCount causes a SQL error from TOP.

Tables used

InvBinItemLog · Read InvBin · Read Items · Read StockMovementOperations · Read StockMovementTypes · Read RelocateLogTransactionMatch · Read Orderlines · Read SDelHeader · Read
SQL object:
dbo.pipiGetItemsStockHistory
Updated at 2026-10-30