Invalid format code for the referenced date

Error FX-SCH-A-000642 Factur-X

Value of '@format' 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 the format attribute is not included in the code list specified for it. This check does not report an empty attribute value as an error.

What the rule means

The format code specifies how the text content of qdt:DateTimeString is to be interpreted as a date. A code not in the list does not identify a format allowed for this context.

Please use an allowed format code for the referenced date

The value of the format attribute on qdt:DateTimeString is not allowed for this date. Use a value listed in the applicable code list.

What to do
  1. Locate the additional referenced document with ram:TypeCode 50.
  2. Find ram:FormattedIssueDateTime/qdt:DateTimeString in it.
  3. Check the format attribute value against the applicable code list.
  4. Enter a value listed there.
  5. Regenerate the invoice and validate it again.
Technical details

The assertion compares the attribute value with entries in the code list identified by 17. An empty value also satisfies the condition.

Where the rule applies

The rule applies to the format attribute of qdt:DateTimeString in ram:FormattedIssueDateTime of an additional referenced document with ram:TypeCode 50.

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