Postman collection
Payments Read

pixiGetDatevExportWires

Returns the DATEV export rows for payments (bank lines and customer account events) in a date range, optionally filtered by shop, country, bank account, amount range and cost center.

Produces the content of the DATEV export file "Payment" (wires).

  1. The setting BookExportDatevActive is checked. If it is not 1, only a status row with Status = ERROR is returned.
  2. Otherwise the internal procedure Pixi_DatevExportWires is executed with the given parameters and SetStartAndEndOfDay = 0, i.e. DateFrom and DateTo are used exactly as passed, without expanding them to start/end of day.

The result combines two sources (UNION ALL):

Bank lines (BankLines)

  • Bank lines with BankDate between DateFrom and DateTo (inclusive). If the setting BookExportWiresWithBookDate = 1, the date is derived from the bank line's book date (MMDD plus year, with year-change correction), taken from a window of two weeks before/after the range.
  • Bank lines from bank headers with source type APY are always excluded; CCP only if BookExportCcpTransactions is set; UPD and business code 020 only if BookExportUpdTransactions is set.
  • Customer, shop and invoice are determined from the final (non-prematch) bank match: invoice, order, direct debit (DTAUS) or customer account entry, in this order.
  • CustomerNr is the customer's DatevAccNr, or the setting BookDefaultCustomerNr if no customer is found.
  • InvoiceNr is the external order number if the payment method is listed in the setting BookExportDatevUseOrderNrExternal; otherwise the invoice number (for direct debits the matched invoice). Fallback is BookDefaultInvoiceNr; the value is cut to 12 characters.
  • BankAccountNr is the bank line's accounting bank account (if BookExportQueryAndUseAccountingBankAccount is set), the PayPal account BookDefaultBankAccountNrPayPal for source types PPL/PLL, otherwise BookDefaultBankAccountNr.
  • WireText combines external order number, bank texts 1–3 and, for credit card payments, Kreditkarte plus the payment ID; max. 60 characters, double quotes removed.

Customer account events (CustomerAccount, events RPP, RCC, BTC)

  • Events with EventDate >= DateFrom and < DateTo.
  • Included if a manual booking is linked, or if the setting BookExportDatevExportAutomaticCAEvents is active and the event type is marked manual; additionally direct-debit-related entries with a matched invoice if BookExportManualDtausToDatev is set.
  • BankAccountNr is the booking account of the event type; BTC gets the plus sign, the others the minus sign.

Filters (both parts): ShopId (shop of the customer), CostCenter (cost center of the shop), Country (country of the invoice/order address or customer address), AmoutFrom/AmoutTo (on the absolute amount) and BankAccountNr (on the computed bank account).

The sign is s/h if the setting BookExportDatevPro is active, otherwise +/-. Rows are sorted by BankAccountNr, BankDate, Amount.

Notes

  • Read-only; all tables are read WITH (NOLOCK), so uncommitted data may appear.
  • Because SetStartAndEndOfDay = 0, a DateTo of 2024-01-31 means midnight at the start of that day: bank lines of that day after 00:00 and customer account events of that day are not included. Pass e.g. 2024-01-31T23:59:59 to include the whole day.
  • Bank lines use an inclusive upper bound (BETWEEN), customer account events an exclusive one (<).
  • Despite the comment "amount range in €", AmoutFrom/AmoutTo are compared with the absolute amount in the currency of the bank line/event, not converted.
  • ShopId is declared as varchar(3); the internal lookup by shop short name (values longer than 3 characters) can therefore not take effect through this call. An empty ShopId is not treated as NULL and yields no rows, whereas empty BankAccountNr and CostCenter are treated as NULL.
  • Customer account events are only returned if their exchange rate is found in the internally reduced exchange rate set (rates of the database currency source within ±2 weeks for currencies that occur in the selected bank lines).
  • Bank lines without a bank header are excluded by the source type filters.
  • The behaviour depends on many settings read at runtime (see description); dbo.SettingGet and pixi.GetDatabaseCurrency are not attached, so their exact semantics are not documented here.

Tables used

Settings · Read Shops · Read BankLines · Read BankHeader · Read BankMatch · Read ExchRate · Read Currency · Read CustomerAccountEvents · Read CustomerAccount · Read CustomerAccountMatch · Read CustomerAccountManualBookings · Read Invoices · Read Invlines · Read Orderlines · Read OrderHeader · Read Customers · Read Addresses · Read DTAUS · Read
SQL object:
dbo.pipiGetDatevExportWires
Updated at 2026-10-30