Allowed unit code for the charge basis quantity

Error FX-SCH-A-000974 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 in ram:BasisQuantity is not included in the code list used by this rule. The test also accepts an empty value.

What the rule means

The unit code assigns the basis quantity to a recognized unit. A value not listed cannot be matched to a unit using this code list.

Please use an allowed unit code for the charge basis quantity

The value of @unitCode in ram:BasisQuantity is not included in the applicable code list. You can change the value or leave it empty.

What to do
  1. Check @unitCode on the charge’s ram:BasisQuantity element.
  2. Use a value from the code list applicable to this rule, or leave the value empty.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty string value or a value present in the code list identified by 15.

Where the rule applies

The rule applies to the @unitCode attribute of ram:BasisQuantity for a document-level charge.

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