Postman collection
Orderlines Read

pixiReadPOSItems

Returns POS (point of sale) receipt lines from `POSitem2`, filtered by key or by the create/update date of the POS header, with optional key-based paging.

Reads POS item rows (lines of point-of-sale receipts). If POSItemKey is not passed, it is treated as 0. The first matching branch decides the filter:

  1. Create or update date – if CreateAndUpdateDateFrom or CreateAndUpdateDateTo is set: items whose POS header (POSheader2) was created or updated in the range. A row matches the lower bound if PHCreateDate or PHUpdateDate is >= the from value, and the upper bound if PHCreateDate or PHUpdateDate is < the to value.
  2. Create date – else if CreateDateFrom or CreateDateTo is set: header PHCreateDate >= from and < to.
  3. Update date – else if UpdateDateFrom or UpdateDateTo is set: header PHUpdateDate >= from and < to.
  4. Key range – else if RowCount is passed: all items with POSitemKey greater than POSItemKey.
  5. Single item – otherwise: the item with exactly POSitemKey = POSItemKey.

In branches 1–4 only items with POSitemKey > POSItemKey are returned, sorted by POSitemKey ascending. Branches 1–3 only return items that have a matching POS header (inner join).

RowCount limits the number of returned rows (if not 0). For paging, pass the last received POSitemKey as POSItemKey in the next call.

Notes

  • All reads use NOLOCK; uncommitted data may be returned.
  • The row limit is applied with SET ROWCOUNT.
  • Calling without any parameter falls into the single-item branch with key 0 and normally returns an empty result.
  • Passing RowCount = 0 still selects the key-range branch (the value is not NULL) but applies no row limit, so all items above POSItemKey are returned.
  • Date upper bounds are exclusive (<). In the combined create/update filter the bounds are evaluated independently, so a row can match the from bound via one date and the to bound via the other.
  • The date filters refer to the POS header, not to the item itself.
  • The final "no data" branch in the code is unreachable because POSItemKey is never NULL after the default handling.

Tables used

POSitem2 · Read POSheader2 · Read
SQL object:
dbo.pipiReadPOSItems
Updated at 2026-10-30