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.
The invoice type is 384 (corrected invoice), but ram:ApplicableHeaderTradeSettlement does not contain a ram:InvoiceReferencedDocument.
A corrected invoice must refer to at least one preceding invoice document. The reference links it to the invoice being corrected.
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.
- Check the invoice type using
Type. - For a corrected invoice, add a reference using
AddInvoiceReferencedDocument(...). - Generate the invoice again and validate it again.
<rsm:ExchangedDocument> <ram:TypeCode>384</ram:TypeCode> </rsm:ExchangedDocument> <ram:ApplicableHeaderTradeSettlement/>
<rsm:ExchangedDocument> <ram:TypeCode>384</ram:TypeCode> </rsm:ExchangedDocument> <ram:ApplicableHeaderTradeSettlement> <ram:InvoiceReferencedDocument/> </ram:ApplicableHeaderTradeSettlement>
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.
The rule applies to the invoice type in rsm:ExchangedDocument/ram:TypeCode and the referenced documents in ApplicableHeaderTradeSettlement.
rule/@context)assert/@test)