Use an allowed format code for the referenced date

Error FX-SCH-A-000596 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 on qdt:DateTimeString is not included in the code list assigned to this date field. This test also accepts an empty value.

What the rule means

The format code identifies how to interpret the issue date of the referenced document. A code that is not listed does not match a designation intended for this field.

Please use a valid format code for the referenced date

The format code for the referenced document’s issue date is not recognized as an allowed value. You can correct it using the code list that applies to this field.

What to do
  1. Find ram:InvoiceReferencedDocument and its ram:FormattedIssueDateTime containing qdt:DateTimeString.
  2. Compare the format attribute value with the code list that applies to this field.
  3. Replace any unlisted value with an allowed value.
  4. Generate the invoice again and validate it.
Technical details

The test accepts an empty value or a value listed in code list 33; a non-empty value that is not listed fails.

Where the rule applies

This rule applies to the format attribute of the date in qdt:DateTimeString under ram:FormattedIssueDateTime within ram:InvoiceReferencedDocument.

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