Disallowed unit code for the quantity per package

Error FX-SCH-A-001086 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 @unitCode attribute of ram:PerPackageUnitQuantity contains a value that is not in the corresponding code list. This check permits an empty value.

What the rule means

The unit code identifies the unit of measure in which the quantity per package is expressed. A disallowed code can prevent consistent interpretation of the quantity.

Please use an allowed unit code for the quantity per package

The unit code for the quantity per package is not in the code list provided for it. You can adjust the code and check the invoice again.

What to do
  1. Check @unitCode on ram:PerPackageUnitQuantity.
  2. Use a unit code allowed by the corresponding code list.
  3. Generate the invoice again and validate it again.
Technical details

The check verifies that the unit code is empty or occurs as enumeration/@value in codedb/cl[@id=15].

Where the rule applies

The rule applies to @unitCode on ram:PerPackageUnitQuantity in the delivery details of an invoice line.

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