Document type code not allowed

Error FX-SCH-A-000618 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

The value of ram:TypeCode is neither empty nor included in the applicable code list.

What the rule means

ram:TypeCode identifies the type of the additional referenced document. A code that is not allowed does not conform to the applicable value list.

Please use an allowed document type code

The additional document type has a value that is not in the applicable code list. You can replace it with an allowed code.

What to do
  1. Locate ram:TypeCode in the relevant ram:AdditionalReferencedDocument.
  2. Check its value and use only a code from the allowed code list.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:TypeCode>INVALID</ram:TypeCode>
✓ Correct
<ram:TypeCode/>
Technical details

The XPath test accepts an empty value or a value included in code list 13.

Where the rule applies

The rule applies to ram:TypeCode in ram:AdditionalReferencedDocument in a line item's settlement information.

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