Bank export — system description
Data model of transfer batches, items and templates, the rules for taking over invoices, the checks of pain.001 XML generation and the permission layers.
Overview
Management of transfer batches: invoices (from a bulk selection on the Invoices list), manual and template items in one batch, each item with value date, amount and beneficiary account. An ISO 20022 pain.001.001.03 XML can be downloaded from the batch with the ERSTE or UniCredit protocol.
Data model
Table names carry the installation's own prefix in the database.
| Table | Purpose | Main fields |
|---|---|---|
bank_export_batch | batch header | name, client, debit account, protocol, status (0 = Draft, 1 = Generated), generated_at, created_by |
bank_export_item | batch item | source (invoice, manual, template), partner name, account number, amount, value date, memo |
bank_export_template | recurring transfer template | global, no company restriction; status |
invoice, bankaccount, company | master data read | outstanding amount, due date, default bank account |
Process
- New batch: status draft (0) with the creating user. Name, client and bank account are required; the client must be within the content scope.
- Item: the account number is normalised to 24 digits; the memo is at most 140 characters.
- Adding invoices: beneficiary account is the supplier's default bank account in the invoice currency (
company::getDefaultBankaccountId), amount the outstanding amount (or gross), value date the due date, memo the invoice number plus the system's own mark carrying the invoice identifier, which the bank import recognises exactly. Invoices already in the batch are skipped; the list of invoices without an account number is returned. A new batch can also be created from the modal. - Generation: checks the IBAN of the debit account, a valid normalised IBAN, a positive amount and a value date per item; builds the XML (the invoice mark is put into the memo even if it was edited by hand), sets the batch to Generated (1) and returns it as a download (file name e.g.
ERSTE_2026-11-20_batch12.xml). On error it redirects to the form with the message in the session. - Delete: a draft batch physically with its items; a generated batch cannot be deleted. A template only if no batch item references it.
Permissions
- Layer 1: the page opens with base access to the path; saving, item, template, generation and delete operations also require modify permission.
- Layer 2:
list,add(the button; saving a new record asksadd, oreditif the catalogue has no add row),edit,generate,delete,debug(SQL of the batch list). - Layer 3: the list is limited to the user's permitted companies (empty when the filter is disabled); header, item, template item, generation and delete operations check that the batch client is within the content scope; taking over invoices also filters on the invoices' owner client. Templates are global.
Known limitations
- Item operations do not check the batch status, so items of a generated batch can still be changed.
- The generated file is not stored in the document centre.