Invalid referenced document type

Error FX-SCH-A-001136 Factur-X

Value of 'ram:TypeCode' is not allowed.

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

A non-empty value in ram:TypeCode is not included in the value list designated for this document type. An empty value passes this check.

What the rule means

ram:TypeCode identifies the type of the referenced document. A non-empty value must correspond to an allowed code.

Please use an allowed type for the referenced document

The value in ram:TypeCode of the referenced document is not in the designated value list. You can satisfy the check by using an allowed code.

What to do
  1. Check the value in ram:TypeCode of the referenced document.
  2. For a non-empty value, use an entry from the designated value list.
  3. Generate the invoice again and validate it.
Technical details

The test permits an empty code value; otherwise, it checks the value against the enumeration in code list 33.

Where the rule applies

The rule applies to ram:TypeCode of a referenced document on an invoice line.

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