Provide unitCode for UnitQuantity

Error FX-SCH-A-001152 Factur-X

Attribute '@unitCode' is required in this context.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The unitCode attribute is missing from ram:UnitQuantity. This attribute is required in this context.

What the rule means

unitCode specifies the unit of measure for the quantity in ram:UnitQuantity.

Please add `unitCode` for the quantity

The unitCode attribute is missing from ram:UnitQuantity. Add it so the unit of measure for the quantity is specified.

What to do
  1. Locate ram:UnitQuantity for the referenced product in the invoice line.
  2. Add the unitCode attribute there.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:UnitQuantity>2</ram:UnitQuantity>
✓ Correct
<ram:UnitQuantity unitCode="">2</ram:UnitQuantity>
Technical details

The check requires the unitCode attribute on ram:UnitQuantity; it does not check the attribute’s permitted value here.

Where the rule applies

The rule applies to ram:UnitQuantity of a referenced product within an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedTradeProduct/ram:IncludedReferencedProduct/ram:UnitQuantity
Test expression (assert/@test)
@unitCode