Disallowed ReferenceTypeCode

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 of ram:ReferenceTypeCode is not included in the applicable code list. The check also permits an empty code value.

What the rule means

ram:ReferenceTypeCode identifies the type of document reference. A non-empty value must belong to the codes defined for this element so that the reference type can be identified unambiguously.

Please use an allowed ReferenceTypeCode

ram:ReferenceTypeCode contains a value that does not match the applicable code list. You can adjust the value so that it is empty or included in that list.

What to do
  1. Locate ram:ReferenceTypeCode in the affected ram:AdditionalReferencedDocument.
  2. Check its value against the code list applicable to this element.
  3. Generate the invoice again and check it once more.
Technical details

The test accepts an empty $codeValue20 value or a value listed under cl[@id=20] in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to ram:ReferenceTypeCode within ram:AdditionalReferencedDocument in the settlement for 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]