Invalid unit code on the allowance

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

What the rule means

The unit code identifies the unit of the allowance’s basis quantity. A permitted code ensures that this unit is identified unambiguously.

Please check the allowance’s unit code

The unit code on the allowance’s ram:BasisQuantity does not match the permitted code list. You can correct the value using the list or leave it empty.

What to do
  1. Check unitCode on the allowance’s ram:BasisQuantity.
  2. Use a value from the permitted code list or leave the value empty.
  3. Regenerate the invoice and check it again.
Technical details

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

Where the rule applies

The rule applies to ram:BasisQuantity of a document-level allowance within ram:SpecifiedTradeAllowanceCharge. Its unitCode attribute is checked.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator="false"]/ ram:BasisQuantity
Test expression (assert/@test)
string-length($codeValue15)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=15]/enumeration[@value=$codeValue15]