Unit code not allowed for gross price

Error FX-SCH-A-000611 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 in ram:BasisQuantity is neither empty nor included in the applicable code list.

What the rule means

The unit code identifies the measurement unit of the quantity basis for the gross price. A code that is not allowed prevents this quantity from being interpreted unambiguously according to the applicable code list.

Please use an allowed unit code for the gross price

The quantity basis for the gross price contains a unit code that is not in the applicable code list. You can adjust this entry using an allowed unit code.

What to do
  1. Locate the ram:BasisQuantity under the line item's ram:GrossPriceProductTradePrice.
  2. Check the @unitCode attribute and use only a code from the allowed code list.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:BasisQuantity unitCode="INVALID">1</ram:BasisQuantity>
✓ Correct
<ram:BasisQuantity unitCode="">1</ram:BasisQuantity>
Technical details

The XPath test accepts an empty value or a value included in code list 8.

Where the rule applies

The rule applies to the ram:BasisQuantity of a line item's ram:GrossPriceProductTradePrice.

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