Postman collection
Reports Read

pixiReportGetUnpaidInvoices

Returns all invoices that were still unpaid (fully or partially) at the end of a given day, optionally filtered by shop and payment code.

Builds an open-items list of invoices as of a reference date.

  1. Date is moved to the end of that day (23:59:59.997) by fPixi_GetDateEndOfDay. If it is omitted, the current day is used. ShopID is trimmed, and an empty ShopID or PaymentCode counts as "no filter".
  2. The call selects invoices that meet all of these conditions:
    • The invoice date is before the reference date.
    • The invoice is not a return or credit note, i.e. it has no reference to another invoice.
    • The shop matches (InvShopID = ShopID), if ShopID is given.
    • The payment code matches (Payment = PaymentCode), if PaymentCode is given.
  3. Each invoice is joined to its customer account entries. Entries that were already fully matched (Amount = Matched) and last updated before the reference date are ignored.
  4. The open amount is the customer account amount plus the sum of all matches (AbsoluteMatchAmount) created before the reference date. A match counts whether the entry is referenced as first or second match partner. Only invoices whose open amount is still below 0 are returned.
  5. For each open invoice the call returns:
    • invoice number, date and total
    • open amount
    • external customer number and DATEV account number
    • last and first name from the invoice address
    • shop
    • country of the shipping address
    • currency code

The result has no ORDER BY, so the row order is not defined.

Notes

  • All tables are read with NOLOCK. The figures can therefore include uncommitted data.
  • OffenerRechnungsbetrag uses the sign convention of the customer account: open receivables are negative values.
  • The final query uses inner joins to invoice address, shipping address, customer and currency. Invoices missing one of these references are not returned.
  • If an invoice has several customer account entries, MAX(Amount) of these entries is combined with the sum of all their matches. The open amount may then differ from the expected value.
  • Invoices dated exactly at the end-of-day timestamp (23:59:59.997) are excluded because the comparison is strict (<).
  • Column names of the result are German (Rechnungsnummer, Kundennummer, ...), except DatevUserAccount, ShopID, CountryCode and CurrencyCode.

Tables used

Invoices · Read CustomerAccount · Read CustomerAccountMatch · Read Addresses · Read Customers · Read Currency · Read
SQL object:
dbo.pipiReportGetUnpaidInvoices
Updated at 2026-10-30