PEPPOL-EN16931-R101
The rule sets below word this rule differently; each wording is shown with its rule set.
Why it fails
- A line has a
cac:DocumentReferencewhosecbc:DocumentTypeCodeis not130, such as a delivery note or an order reference.
How to fix it
On a line, cac:DocumentReference is only for the invoiced object identifier, with cbc:DocumentTypeCode 130. A line's order reference goes in cac:OrderLineReference/cbc:LineID.
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.
Element Document reference can only be used for Invoice line object
cac:InvoiceLine | cac:CreditNoteLine
(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))
Checked with Peppol BIS Billing 3.0 Invoice, Peppol BIS Billing 3.0 Credit Note
Element Additional referenced document can only be used for Invoice line object.
ram:IncludedSupplyChainTradeLineItem
(not(ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument) or (ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument/ram:TypeCode='130'))
Checked with XRechnung 3.0 Invoice (CII)