Reference for a corrected invoice

Warning BR-DE-26 XRechnung

If code 384 (Corrected invoice) is transmitted in the element Invoice type code (BT-3), PRECEDING INVOICE REFERENCE BG-3 should be present at least once.

Recommendation: The invoice remains valid but should be corrected so that it can be processed automatically.
What is wrong

The invoice type is 384 (corrected invoice), but ram:ApplicableHeaderTradeSettlement does not contain a ram:InvoiceReferencedDocument.

What the rule means

A corrected invoice must refer to at least one preceding invoice document. The reference links it to the invoice being corrected.

Affected fields BT-3 BG-3
Please add the reference to the corrected invoice

Your invoice is marked as a corrected invoice with code 384, but it does not contain a reference to a preceding invoice document. You can resolve this by adding the missing reference.

What to do
  1. Check the invoice type using Type.
  2. For a corrected invoice, add a reference using AddInvoiceReferencedDocument(...).
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<rsm:ExchangedDocument>
  <ram:TypeCode>384</ram:TypeCode>
</rsm:ExchangedDocument>
<ram:ApplicableHeaderTradeSettlement/>
✓ Correct
<rsm:ExchangedDocument>
  <ram:TypeCode>384</ram:TypeCode>
</rsm:ExchangedDocument>
<ram:ApplicableHeaderTradeSettlement>
  <ram:InvoiceReferencedDocument/>
</ram:ApplicableHeaderTradeSettlement>
Check in FactoorSharp
  • FacturXInvoice.Type (BT-3)
  • FacturXInvoice.AddInvoiceReferencedDocument(id, IssueDateTime, TypeCode) (BG-3)
  • FacturXInvoice.GetInvoiceReferencedDocuments() (BG-3)
  • FacturXInvoice._InvoiceReferencedDocuments (BG-3)
Technical details

The test allows invoice type 384 only if at least one ram:InvoiceReferencedDocument is present in the header settlement.

Where the rule applies

The rule applies to the invoice type in rsm:ExchangedDocument/ram:TypeCode and the referenced documents in ApplicableHeaderTradeSettlement.

Original message from the Schematron
Wenn im Element Invoice type code (BT-3) der Code 384 (Corrected invoice) übergeben wird, soll PRECEDING INVOICE REFERENCE BG-3 mind. einmal vorhanden sein.
Context (rule/@context)
/rsm:CrossIndustryInvoice
Test expression (assert/@test)
not(normalize-space(rsm:ExchangedDocument/ram:TypeCode) = '384') or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument)