Unit code for the quantity per package is missing

Error FX-SCH-A-001085 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, which specifies the unit of the quantity per package, is missing from ram:PerPackageUnitQuantity.

What the rule means

The unit code associates a unit of measure with the quantity per package. Without it, the quantity is not provided together with its unit.

Please add the unit for the quantity per package

The quantity per package is missing its unit code. Add it so the quantity is provided together with its unit.

What to do
  1. Add @unitCode to ram:PerPackageUnitQuantity.
  2. Use a code allowed for this unit.
  3. Generate the invoice again and validate it again.
Technical details

The XPath test @unitCode checks whether the attribute exists on the current ram:PerPackageUnitQuantity.

Where the rule applies

The rule applies to 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)
@unitCode