Allowed value for unitCode

Error FX-SCH-A-001153 Factur-X

Value of '@unitCode' 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 non-empty value of unitCode does not match any value allowed for this attribute. An empty value passes this value check, provided the attribute is present.

What the rule means

The allowed values identify valid units for ram:UnitQuantity. A different non-empty value cannot be interpreted as a unit code provided for this element.

Please use an allowed value for `unitCode`

The value provided for unitCode is not in the code list allowed for this attribute. You can replace it with an allowed unit code.

What to do
  1. Locate ram:UnitQuantity in the referenced product on the invoice line.
  2. Check the unitCode attribute against the values allowed for this field.
  3. Generate the invoice again and validate it again.
Technical details

The test passes if the checked value is empty or occurs in the enumeration for code list ID 15 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

This rule applies to the unitCode attribute of ram:UnitQuantity of a referenced product on an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:IncludedReferencedProduct/ram:UnitQuantity
Test expression (assert/@test)
string-length($codeValue15)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=15]/enumeration[@value=$codeValue15]