Invalid invoice line unit code

Error FX-SCH-A-001076 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 on ram:BilledQuantity is not included in the list of values allowed in this context. The test also allows an empty value.

What the rule means

The unit code identifies the unit used for the billed quantity. A code that is not allowed may prevent the unit of that quantity from being identified unambiguously.

Please use an allowed unit code for the invoice line

The unit code on the billed quantity is not accepted in this context. Use a value allowed by the related code list, or leave the value empty.

What to do
  1. Locate ram:BilledQuantity on the invoice line.
  2. Check the unitCode attribute value against the code list for this context.
  3. Replace it with an allowed code from that list or leave it empty.
  4. Generate the invoice again and validate it again.
Technical details

The test accepts an empty value or a value listed in code list 15 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to the unitCode attribute of ram:BilledQuantity on an invoice line.

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