Invalid document type code for document type 50

Error FX-SCH-A-000643 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 not included in the code list specified for this element. This check does not report an empty value as an error.

What the rule means

ram:TypeCode identifies the kind of referenced document. A code not in the list does not correspond to a document type allowed in this context.

Please use an allowed `ram:TypeCode` for the type `50` referenced document

The value of ram:TypeCode is not included in the applicable code list. Using a value listed there can resolve the issue.

What to do
  1. Locate the additional referenced document with ram:TypeCode 50.
  2. Check the value of ram:TypeCode against the applicable code list.
  3. Enter a value listed there.
  4. Regenerate the invoice and validate it again.
Technical details

The assertion compares the value with entries in the code list identified by 39. An empty value also satisfies the condition. The rule context filters for documents with ram:TypeCode 50.

Where the rule applies

The rule applies to ram:TypeCode of an additional referenced document with ram:TypeCode 50 within the document-level agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="50"]/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue39)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=39]/enumeration[@value=$codeValue39]