Postman collection
Stock Read

pixiGetRelocations

Returns stock relocations of items between locations (take-out and put-in pairs) from the bin item log within a date range of at most 31 days, with paging.

Returns stock movements created when items are relocated from one location to another.

  1. Defaults and cleanup: if ChangeDateFrom is empty, the start of the current month (00:00) is used; if ChangeDateTo is empty, the end of the current day (23:59:59.997) is used. FromLocation and ToLocation are trimmed; empty strings are treated as "no filter".
  2. Validation: if the period between ChangeDateFrom and ChangeDateTo is more than 31 days (counted as day boundaries), a single status row with Status = Error is returned and the call ends.
  3. Candidates: from the bin item log, all entries with UpdateDate within the period are read in two groups:
    • take-out entries (SMTRef = 19, SMORef = 11),
    • put-in entries (SMTRef = 11, SMORef = 12). Each group is numbered separately in the order of the log key.
  4. Pairing: the n-th take-out entry is paired with the n-th put-in entry. Only pairs where a put-in entry exists and the item of the take-out entry exists in the item master are returned. FromLocation is the location of the take-out entry, ToLocation the location of the put-in entry.
  5. Location filters: FromLocation filters on the source location, ToLocation on the target location; both can be combined.
  6. Paging: the remaining rows are numbered again (in log key order) in RowNumber. The call returns at most RowCount rows with RowNumber > Offset, sorted by RowNumber.

Qty is the quantity of the take-out entry multiplied by -1, i.e. the relocated quantity as a positive number.

Notes

  • Take-out and put-in entries are paired by position only (n-th take-out with n-th put-in in log key order), not by item or relocation document. If the numbers of take-out and put-in entries in the period differ, or a relocation spans the period boundary, pairs can be shifted and ToLocation may belong to another movement.
  • The meaning of the codes SMTRef/SMORef (19/11 and 11/12) is not documented in the code; the interpretation as take-out/put-in comes from the temporary table names.
  • If ChangeDateTo is passed as a date without time, it means midnight at the start of that day, so movements later that day are excluded.
  • All reads use NOLOCK, so uncommitted data can appear.
  • The helper procedures util.IndexCreate and util.TempTableDrop are used for temporary tables only; their definitions are not attached.
  • RowNumber is computed after the location filters, so paging with Offset is consistent for the same filter values.

Tables used

InvBinItemLog · Read Items · Read
SQL object:
dbo.pipiGetRelocations
Updated at 2026-10-30