Postman collection
Reports Read

pixiGetPOSSalesReport

Returns the POS (point of sale) sales lines of a date range, optionally limited to one location, with item, supplier and price data.

Builds a report of point-of-sale sales. According to the code comment, it was created for a specific customer (ERK).

  • Each row is one POS line from POSitem2. It is joined to its POS header (POSheader2) and to the item (items). The supplier (Suppliers) is joined optionally through the item's SupplNr, so SupplName can be empty.
  • LocID filters on the location of the POS header (PHlocID). An empty string or NULL means all locations.
  • DateFrom and DateTo filter on the POS header date PHdate with an inclusive BETWEEN. A value that is NULL or earlier than 1990-01-01 is replaced by the current date and time.
  • The report shows the list sales price of the item (VK_List) next to the price actually charged on the POS line (VK_Real). It also returns the purchase price of the supplier and the quantity.
  • Rows are sorted by POS header key in ascending order, so they appear in the order the POS receipts were created.

Notes

  • If DateFrom and DateTo are both omitted, both are set to the current time, which is only milliseconds apart. The result is then practically always empty, so always pass both dates.
  • BETWEEN includes both ends. If DateTo is passed as a date without a time (midnight), sales later on that day are not included. To cover the whole day, pass the next day or a time of 23:59:59.
  • All tables are read with NOLOCK, so uncommitted data can appear in the result.
  • There is no paging. Large date ranges can return many rows.

Tables used

POSitem2 · Read POSheader2 · Read items · Read Suppliers · Read
SQL object:
dbo.pipiGetPOSSalesReport
Updated at 2026-10-30