Postman collection
Invoices Read Deprecated

pixiGetInkassoBookings

Returns invoices handed over to debt collection (Inkasso) in a date range, with customer address and amounts; only supported on the pixi_GCH databases.

This call is customer-specific and only works when the Pixi database is named pixi_GCH or pixi_GCH_test. On all other databases it returns one status row with Status = Info and the message that the call is no longer supported.

On the supported databases the call runs the internal procedure Pixi_CA_GetInkassoBookings and returns its rows:

  1. The booking event ID for manual Inkasso bookings is read from the setting CA_Inkasso_ManualBookingID (default INU).
  2. All customer account bookings (CustomerAccount) with this event ID and an EventDate between FromDate and ToDate (both inclusive) are selected.
  3. Through CustomerAccountMatch the matched bookings are found, in both directions, and the invoices those bookings refer to are determined.
  4. One row per invoice is returned with the customer (Customers) and the customer address (Addresses), sorted by invoice date (InvDate) ascending.

The row layout is a fixed export format for a debt collection agency:

  • Fixed values: KundenNr = 975503, RecordCode = 0, CompanyType = 99, Land = 001, Adresszusatz and Rechnungsgrund empty.
  • Sprachcode is D if the address belongs to shop GCH, otherwise F.
  • Geschlecht is m for salutation Herr, w for Frau, otherwise f.
  • Dates (Geburtsdatum, Rechnungsdatum) are formatted as dd.mm.yyyy.
  • Amounts (BetragCHF, Mahnkosten, BetragCHFtotal) are returned as text with a dot as decimal separator. BetragCHF is the amount of the matched Inkasso booking, BetragCHFtotal the invoice total, Mahnkosten the reminder costs (0 if none).

Notes

  • Outside the databases pixi_GCH / pixi_GCH_test the call is effectively retired: it always returns the Info row and never queries data.
  • Before the export, the helper util.TableDrop is called for the legacy table tmp.pipiGetInkassoBookings_Output; the data itself is collected in a temporary table that is dropped at the end. The helper procedures are not attached.
  • The event ID depends on the setting CA_Inkasso_ManualBookingID, read at runtime via dbo.SettingGet.
  • The customer account tables are read WITH (NOLOCK), so uncommitted bookings may appear.
  • EventDate BETWEEN FromDate AND ToDate is compared on datetime: a ToDate without time (midnight) excludes bookings later on that day.
  • Geburtsjahr is 0 if no birth date is stored; Geburtsdatum is then empty.
  • BetragCHF can be empty (NULL) if no matching Inkasso booking amount is found. The amount lookups use scalar subqueries; if an invoice has several customer account entries, SQL Server may raise a 'subquery returned more than 1 value' error.

Tables used

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