Disallowed reference type code

Error FX-SCH-A-001126 Factur-X

Value of 'ram:ReferenceTypeCode' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value provided for ram:ReferenceTypeCode is not in the code list defined for it. This check also accepts an empty value.

What the rule means

ram:ReferenceTypeCode identifies the type of the referenced document. A disallowed code does not match the values defined for this document-type information.

Please use an allowed code for the reference type

ram:ReferenceTypeCode in the invoice line’s ram:AdditionalReferencedDocument contains a disallowed code. You can update the code or leave the value empty.

What to do
  1. Check ram:ReferenceTypeCode within ram:AdditionalReferencedDocument.
  2. Use a code allowed by the associated code list, or leave the value empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts either an empty $codeValue20 or a value present in the code list with ID 20.

Where the rule applies

The rule applies to ram:ReferenceTypeCode within ram:AdditionalReferencedDocument in the settlement of an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument/ram:ReferenceTypeCode
Test expression (assert/@test)
string-length($codeValue20)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=20]/enumeration[@value=$codeValue20]