Skip to main content

xInvoice Payment Means

mseDoc365 emits the EN16931 payment-means groups in both syntaxes — CII (XRechnung) and UBL (XRechnung-UBL) — by classifying the document's payment method and resolving SEPA-specific data from BC standard records. This page explains how a posted sales invoice or credit memo on the BC side gets translated into the correct payment-means block on the receiver side.

Payment Method → payment-means classification

The classifier reads the document's Payment Method → mseBC mseDoc365 UNECE Code field (BT-81). That code drives which payment-means group the XML emits:

UNECE CodeMeaningXML emits
30Generic credit transferBG-17PayeePartyCreditorFinancialAccount (CII) / PayeeFinancialAccount (UBL)
58SEPA credit transferBG-17
59SEPA direct debitBG-19PayerPartyDebtorFinancialAccount / PaymentMandate + BT-89 (Mandate Reference) + BT-90 (Creditor Identifier)
anything else (e.g. 42 cheque, 48/54/55 card)non-SEPA / no bank infoNeither BG-17 nor BG-19 — only the TypeCode / PaymentMeansCode element

If the Payment Method on the document is empty (or its UNECE Code is empty), the system defaults the UNECE code to 30 before classification. To intentionally suppress both groups, configure the Payment Method's UNECE Code to something other than 30 / 58 / 59.

SEPA Direct Debit (BG-19) — data resolution

For code 59 the system needs three pieces of SEPA data:

  • BT-89 Mandate reference — the SEPA Direct Debit Mandate ID
  • BT-90 Creditor identifier — the SEPA Creditor No. of the company's bank account
  • BT-91 Debtor IBAN — the IBAN of the customer's bank account referenced by the mandate

Mandate (BT-89) — resolution order

For sales invoices:

  1. The mandate set directly on the sales document (Sales Invoice Header."Direct Debit Mandate ID").
  2. A scan of the Bill-to customer's SEPA Direct Debit Mandates that are open (Closed = No, Blocked = No), valid on the document's Due Date, and either have Ignore Expected Number of Debits = Yes or Expected Number of Debits > Debit Counter. The first match wins.
  3. The same scan against the Sell-to customer when Bill-to and Sell-to differ.

For sales credit memos: the BC standard Sales Cr.Memo Header table does not carry a Direct Debit Mandate ID. The system instead reads Applies-to Doc. Type = Invoice + Applies-to Doc. No., looks up the original posted invoice, and uses its mandate ID. If the credit memo is not applied to an invoice, the Bill-to → Sell-to fallback scan runs.

If none of the steps yields a mandate, the system raises an error and the XML is not produced.

Debtor IBAN (BT-91) — resolution order

  1. The Customer Bank Account referenced by the resolved mandate (SEPA Direct Debit Mandate."Customer Bank Account Code").
  2. The first Customer Bank Account with a non-empty IBAN belonging to the Bill-to customer.
  3. The same lookup against the Sell-to customer when Bill-to and Sell-to differ.

The IBAN itself comes from Customer Bank Account.IBAN. If none of the steps yields an IBAN, the system raises an error.

Creditor identifier (BT-90) — resolution order

  1. The company Bank Account referenced by Sales Header."Company Bank Account Code" on the document.
  2. A Bank Account flagged Use as Default for Currency whose Currency Code matches the document's currency.
  3. The LCY default (Bank Account marked default-for-currency with an empty Currency Code) — used when the document is in a foreign currency and no currency-specific default is configured.
  4. As a last resort, any Bank Account that has a Creditor No. set.

Every step filters out Blocked Bank Accounts. The BT-90 value itself comes from Bank Account."Creditor No.".

If you set Company Bank Account Code explicitly on a document and the chosen account is Blocked, the system raises an error rather than silently falling back — the explicit choice wins, and a blocked account is never the right answer.

Credit transfer (BG-17) emission

For codes 30 and 58, BG-17 is emitted with the company's IBAN (Company Information.IBAN) and BIC (Company Information.SWIFT Code) as the payee. This applies to invoices and credit memos alike — credit memos use the same payment-means workflow as invoices, the only difference is direction of monetary settlement (which is independent of the XML structure).

Errors and how to fix them

When a document is configured for SEPA direct debit but any of the BG-19 fields cannot be resolved, the system raises a descriptive error. The error stops emission on the BC side so you can fix the data before the receiver sees an invalid invoice.

Error messageWhere to fix it
No SEPA Direct Debit Mandate could be resolved … on customer XSet Direct Debit Mandate ID on the document, or create an active mandate (open, in-date, with debit headroom) for the customer.
SEPA Direct Debit Mandate %1 referenced by the document does not existThe mandate ID on the document points to a deleted or renamed mandate — repick a valid one.
SEPA Direct Debit Mandate %1 has no Customer Bank Account CodeOpen the mandate card and set its Customer Bank Account Code.
Customer Bank Account … has no IBANFill IBAN on the Customer Bank Account record.
Customer X has no bank account with an IBANAdd a Customer Bank Account with an IBAN under the customer card.
Company Bank Account %1 is blockedThe Company Bank Account Code on the document points to a blocked account — pick a different account or unblock it.
Bank Account %1 has no Creditor No. setFill Creditor No. on the company Bank Account card (the SEPA Creditor Identifier, typically DE…).
No company Bank Account with a Creditor No. could be foundAt least one company Bank Account must carry the SEPA Creditor No. — usually the one marked Use as Default for Currency.

Technical reference

The classifier is the public procedure SetPaymentMeansFlags on the buffer table mseBC mseDoc365 S. Inv.Buffer (table 5563231). It writes five buffer fields that the schema rows read:

Field No.Field nameRole
30Is Credit TransferBoolean gate driving BG-17 emission (CII + UBL)
31Is Direct DebitBoolean gate driving BG-19 emission (CII + UBL) and the BT-90 wrapper in UBL
32Direct Debit Mandate IDBT-89
33Bank Assigned Creditor IDBT-90
34Debtor IBANBT-91

The schema rows for the gated groups carry Data Type = TypeBoolean, Source Table No. = 5563231, and Check to Process or Ignore = Yes. See XML Schema Line for how that flag drives child-tree suppression.

Customising on the customer side

Because SetPaymentMeansFlags runs inside CreateBuffer before OnAfterCreateBuffer fires, extensions can read or override any of the five buffer fields in their OnAfterCreateBuffer subscriber when a specific scenario needs different data.

To customise the schema rows themselves, toggle Locked = Yes on the BG-17 / BG-19 / BT-89 / BT-90 / BT-91 rows on the XML Schema Lines page. Your customisations are then preserved across schema refreshes from standard — see the Locking section on the XML Schema Line page for details.