Use an allowed unit code for the free-of-charge quantity

Error FX-SCH-A-001078 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:ChargeFreeQuantity is not included in the code list allowed by this rule. A non-empty value must match an entry in that list.

What the rule means

The unit code identifies the unit of measure for the free-of-charge quantity. A code that is not allowed may prevent the quantity from being interpreted as intended.

Please use an allowed unit code for the free-of-charge quantity

The unit code on ram:ChargeFreeQuantity is not recognized as an allowed value. Replace it with a value permitted by the code list.

What to do
  1. Check the value of @unitCode on ram:ChargeFreeQuantity.
  2. Replace any disallowed value with an entry from the applicable code list.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:ChargeFreeQuantity unitCode="INVALID">1</ram:ChargeFreeQuantity>
✓ Correct
<ram:ChargeFreeQuantity unitCode="C62">1</ram:ChargeFreeQuantity>
Technical details

The test accepts an empty value or a value present as @value in the code list with id 15. The error occurs when a non-empty value has no matching entry.

Where the rule applies

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

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