fatalEN 16931syntax binding ruleUBL
Scheme identifier shall only be used for invoiced object (document type code with value 130 or 50)
A schemeID is used on a document reference that is not an invoiced object.
The scheme identifier is only meaningful when the DocumentTypeCode is 130 or 50. Remove it elsewhere.
UBL — context cac:AdditionalDocumentReference
((cbc:DocumentTypeCode='130') or ((local-name(/*) = 'CreditNote') and (cbc:DocumentTypeCode='50')) or (not(cbc:ID/@schemeID) and not(cbc:DocumentTypeCode)))
Nothing is stored, and the whole invoice is checked, not just this rule. A PDF only works if it is Factur-X / ZUGFeRD — a PDF with the invoice XML inside it.