BR-DE-26
The rule sets below word this rule differently; each wording is shown with its rule set.
Why it fails
- The invoice is marked as corrected (type code
384) but does not say which invoice it corrects.
How to fix it
Add the number of the corrected invoice in cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID (ram:InvoiceReferencedDocument/ram:IssuerAssignedID in CII), with its issue date if you have it.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
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.
/ubl:Invoice | /cn:CreditNote
((not(normalize-space(cbc:InvoiceTypeCode) = '384' or normalize-space(cbc:CreditNoteTypeCode) = '384') or (cac:BillingReference/cac:InvoiceDocumentReference)))
Checked with XRechnung 3.0 Invoice (UBL), XRechnung 3.0 Credit Note (UBL)
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.
/rsm:CrossIndustryInvoice
not(normalize-space(rsm:ExchangedDocument/ram:TypeCode) = '384') or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument)
Checked with XRechnung 3.0 Invoice (CII)