Allowed unit code for the billed quantity

Error FX-SCH-A-000534 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 value of unitCode is not included in the code list used for this check. An empty value is permitted by the test condition.

What the rule means

The unit code associates the billed quantity with a standardized unit of measure. A code not listed cannot be accepted as an allowed unit code by this rule.

Please use an allowed unit code for the billed quantity

The unit code on the billed quantity is not recognized as an allowed value. Check the value of the unitCode attribute.

What to do
  1. Locate ram:BilledQuantity in ram:SpecifiedLineTradeDelivery.
  2. Check the unitCode attribute against the applicable code list.
  3. Regenerate the invoice and validate it again.
Technical details

@unitCode on ram:BilledQuantity is checked: the value must be empty or present in the enumeration with code-list ID 6 in FACTUR-X_BASIC_codedb.xml.

Where the rule applies

The rule applies to the unitCode attribute of ram:BilledQuantity in an invoice line’s delivery details.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeDelivery/ram:BilledQuantity
Test expression (assert/@test)
string-length($codeValue6)=0 or document('FACTUR-X_BASIC_codedb.xml')/codedb/cl[@id=6]/enumeration[@value=$codeValue6]