Postman collection
Invoices Read

pixiReadPOSHeader

Returns POS document headers (cash register receipts) from POSheader2, either a single header by key or a list filtered by create/update dates with key-based paging.

Reads header records of POS documents from table POSheader2. All branches return the same column set. If POSHeaderKey is not passed, it is treated as 0.

If RowCount is set to a value other than 0, the number of returned rows is limited via SET ROWCOUNT.

The parameters are evaluated in this order; only the first matching branch runs:

  1. Create or update date – if CreateAndUpdateDateFrom or CreateAndUpdateDateTo is set: returns headers with POSheaderKey > POSHeaderKey where PHcreateDate or PHupdateDate is >= CreateAndUpdateDateFrom and PHcreateDate or PHupdateDate is < CreateAndUpdateDateTo.
  2. Create date – if CreateDateFrom or CreateDateTo is set: headers with POSheaderKey > POSHeaderKey and PHcreateDate in the range [CreateDateFrom, CreateDateTo).
  3. Update date – if UpdateDateFrom or UpdateDateTo is set: headers with POSheaderKey > POSHeaderKey and PHupdateDate in the range [UpdateDateFrom, UpdateDateTo).
  4. Key range – if RowCount is passed (not NULL): headers with POSheaderKey > POSHeaderKey.
  5. Single header – otherwise: the header with POSheaderKey = POSHeaderKey.

Branches 1–4 are sorted by POSheaderKey ascending. For paging, pass the last POSheaderKey received as POSHeaderKey in the next call together with RowCount.

Lower date bounds are inclusive, upper bounds exclusive. Omitting one bound leaves that side open.

Notes

  • The table is read WITH (NOLOCK); uncommitted data can be returned.
  • In the date branches POSHeaderKey is a lower bound (>), not an exact match. Passing a specific key together with a date filter does not return that header itself.
  • In the combined create/update filter the two bounds are checked independently: a row matches if any of the two dates is >= the lower bound and any of the two dates is < the upper bound, which is not necessarily the same date.
  • Calling without any parameter returns no rows (it searches for POSheaderKey = 0).
  • Passing RowCount = 0 explicitly selects the key-range branch without a row limit, i.e. all headers with a key greater than POSHeaderKey are returned.
  • Column data types are not visible in the code; they come from table POSheader2.

Tables used

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