Skip to main content

Direct Debit Mandates from Extensions

Obsolete

This event is obsolete. It passes the document number without the document type, so a posted invoice and a posted credit memo with the same number cannot be told apart. Use OnBeforeResolveDirectDebitMandateForDocument instead.

For payment means 59 (SEPA direct debit) mseDoc365 reads the mandate (BT-89) and the debtor IBAN (BT-91) from the BC table SEPA Direct Debit Mandate — see Payment Means. Some payment add-ons keep their mandates in their own tables. For them, mseDoc365 raises an integration event before it resolves the mandate.

Event​

Table mseBC mseDoc365 S. Inv.Buffer (5563231):

[IntegrationEvent(false, false)]
local procedure OnBeforeResolveDirectDebitMandate(DocumentNo: Code[20]; BillToCustomerNo: Code[20]; SellToCustomerNo: Code[20]; DirectDebitMandateID: Code[35]; DueDate: Date; var ResolvedMandateID: Code[35]; var ResolvedDebtorIBAN: Code[50]; var IsHandled: Boolean)
ParameterMeaning
DocumentNoNo. of the posted sales invoice or credit memo the xInvoice is built for
BillToCustomerNo, SellToCustomerNoCustomers of the document
DirectDebitMandateIDMandate ID on the document (the original invoice's mandate for a credit memo), may be empty
DueDateDue date of the document
ResolvedMandateIDReturn the mandate reference (BT-89)
ResolvedDebtorIBANReturn the debtor IBAN (BT-91); spaces are removed
IsHandledSet to true to use the returned values instead of the standard resolution

The event is raised only for payment means 59, for sales invoices and sales credit memos.

Rules for a handled mandate​

  • An empty ResolvedMandateID stops with the error No SEPA Direct Debit Mandate could be resolved ….
  • An empty ResolvedDebtorIBAN stops with the error The direct debit mandate … of customer … has no debtor IBAN.
  • The creditor ID (BT-90) is always resolved from the company bank account, as described on Payment Means.

Leave IsHandled at false to keep the standard resolution from the BC mandate table.