Invalid unit of measure code

Error FX-SCH-A-001037 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 the unitCode attribute is not included in the code list permitted for this field. The test also accepts an empty value.

What the rule means

The unit of measure code identifies the unit to which the gross price basis relates. A code from the designated list enables standardized interpretation of the unit.

Please use an allowed unit code for the price basis

The unit code on ram:BasisQuantity is not in the permitted code list. You can use an allowed code or leave the value empty.

What to do
  1. Locate ram:BasisQuantity for the invoice line’s gross price.
  2. Replace the unitCode value with a code allowed by the code list, or leave it empty.
  3. Generate the invoice again and validate it again.
Technical details

The test checks whether the value of the unitCode attribute of ram:BasisQuantity is empty or appears as an enumeration in code list 15.

Where the rule applies

The rule applies to the unitCode attribute of ram:BasisQuantity for an invoice line’s gross price.

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