Use an allowed unitCode value

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 on ram:UnitQuantity is not included in the code list used by this rule. An empty value or a value included in the code list passes this check.

What the rule means

The code list limits the permitted units of measure to recognized values; the check also permits an empty attribute value.

Please use an allowed value for `unitCode`

The value entered for unitCode on ram:UnitQuantity is not in the permitted code list. Use a value listed there or leave the value empty.

What to do
  1. Locate ram:UnitQuantity for the referenced product.
  2. Check the unitCode attribute value against the permitted code list.
  3. Replace it with a listed value or clear it.
  4. Regenerate the invoice and validate it again.
Technical details

The XPath passes when unitCode is empty or its value matches an entry in code list 15.

Where the rule applies

The rule checks the value of the unitCode attribute on ram:UnitQuantity of a referenced product within 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]