Postman collection
Invoices Read

pixiReportInvlines

Returns invoice lines within a date range, optionally filtered by shop, payment type, supplier, category, EAN and internal item number.

Reads invoice lines from the view PV_Invlines and adds the currency code of the order from the exchange rate (pixi.ExchRate) and currency (pixi.Currency) tables.

Steps:

  1. The number of returned rows is limited to Rowcount (default 1000).
  2. DateFrom is moved to the start of its day (00:00:00).
  3. If DateTo is empty or NULL, the current date and time is used. Otherwise it is moved to the end of its day (23:59:59.997).
  4. Empty strings in the optional filter parameters are treated as NULL, so the filter is not applied.
  5. Only invoice lines whose invoice date lies between DateFrom and DateTo are returned. These optional filters are combined with AND:
    • ShopID: ShopID LIKE @ShopID
    • PaymentType: exact match on PaymentType
    • SupplNr: the item must have an entry for this supplier in AddItems. Any supplier assigned to the item counts, not only the supplier stored on the invoice line.
    • Category: the category text is looked up in TontrArten.TontrText. The matching TontrArt is compared with LIKE against the configtype of the line.
    • EAN: EANUPC LIKE @EAN
    • ItemNrInt: ItemNrInt LIKE @ItemNrInt

The code has no ORDER BY, so the order of the rows is not defined.

Notes

  • All tables are read WITH (NOLOCK). Uncommitted data can appear in the result.
  • The row limit uses SET ROWCOUNT. Rowcount = 0 removes the limit.
  • ShopID, EAN and ItemNrInt are compared with LIKE, so wildcards such as % and _ can be used.
  • If the Category text is not found in TontrArten, no rows are returned. If the text exists more than once, the subquery returns several values and SQL Server raises an error.
  • If DateTo is omitted, the range ends at the current time, not at the end of the current day.
  • Invoice lines without a matching exchange rate or currency are excluded by the inner joins.
  • InvDate is returned as a string in the format yyyy-mm-dd hh:mi:ss.
  • The header comment of the procedure is a generic template text and does not describe this call.
  • PV_Invlines is a view whose definition is not attached. The data types of most columns therefore cannot be derived.

Tables used

PV_Invlines · Read ExchRate · Read Currency · Read TontrArten · Read AddItems · Read
SQL object:
dbo.pipiReportInvlines
Updated at 2026-10-30