Postman collection
Reports Read

pixiReportShipOutPerTimeQuant

Returns the number of scanned-out (shipped) invoices per time slot of a configurable length within a date range, optionally for one shop.

Splits the range from startDateTime to endDateTime into consecutive slots of timePeriod hours. For each slot it counts the invoices whose ScanOutdate (scan-out time at shipping) lies in the slot, and returns one row per slot.

  • startDateTime defaults to the start of the current day (00:00), endDateTime defaults to the current time.
  • timePeriod is the slot length in hours and may be fractional (e.g. 0.5 = 30 minutes). Default is 2. If NULL is passed explicitly, 1 hour is used.
  • The last slot ends at endDateTime and can be shorter than the others.
  • shopID filters on the shop the invoice's customer belongs to (Customers.CustomerOf). An empty string (default) counts invoices of all shops.
  • Every slot produces a row, including slots with a count of 0.
  • Rows are returned in the order the slots were created, i.e. chronologically, although the final select has no explicit ORDER BY.

Notes

  • Reads Invoices and Customers with NOLOCK, so counts may include uncommitted data.
  • The slot filter uses BETWEEN, so both limits are included. An invoice scanned out exactly on a slot boundary is counted in two adjacent slots.
  • startTimePeriod and endTimePeriod are text in SQL Server's default datetime format (e.g. Jan 15 2024 2:00PM). They have minute precision, so seconds are lost.
  • The label endTimePeriod of the last slot is not shortened to endDateTime. It shows the full nominal slot end, even though the count only goes up to endDateTime.
  • The column shopID repeats the passed parameter value; it is an empty string when all shops are counted.
  • Slot limits are calculated by adding fractions of a day as float, so very small periods can produce rounding drift.
  • A timePeriod of 0 or a negative value makes the loop never end, because the slot start never moves forward. Always pass a positive value.
  • One query runs per slot, so long ranges with short periods can be slow.

Tables used

Invoices · Read Customers · Read
SQL object:
dbo.pipiReportShipOutPerTimeQuant
Updated at 2026-10-30