Mandate reference for direct debit

Error PEPPOL-EN16931-R061 Peppol

Mandate reference MUST be provided for direct debit.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

For a payment method indicated by ram:TypeCode value 49 or 59, the mandate reference ram:DirectDebitMandateID is missing from ram:SpecifiedTradePaymentTerms.

What the rule means

The mandate reference links the direct debit to its associated mandate.

Please add the mandate reference for the direct debit

The invoice contains a payment method with value 49 or 59, but no mandate reference. You can resolve this by adding the reference to the payment terms.

What to do
  1. Find the affected ram:SpecifiedTradeSettlementPaymentMeans with ram:TypeCode 49 or 59.
  2. Add ram:DirectDebitMandateID to ram:SpecifiedTradePaymentTerms.
  3. Generate the invoice again and validate it.
Technical details

Relative to the payment means element, the test checks whether ../ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID is present in the enclosing settlement structure. It applies when the normalized ram:TypeCode is 49 or 59.

Where the rule applies

The rule applies to ram:SpecifiedTradeSettlementPaymentMeans when ram:TypeCode, after surrounding spaces are removed, is 49 or 59.

Context (rule/@context)
ram:SpecifiedTradeSettlementPaymentMeans[ some $code in tokenize('49 59', '\s') satisfies normalize-space(ram:TypeCode) = $code ]
Test expression (assert/@test)
../ram:SpecifiedTradePaymentTerms/ram:DirectDebitMandateID