At most one UnitQuantity

Error FX-SCH-A-000344 Factur-X

Element 'ram:UnitQuantity' may occur at maximum 1 times.

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

ram:IncludedReferencedProduct contains more than one ram:UnitQuantity element. In this context, the element may occur at most once.

What the rule means

The quantity for the referenced product must not be repeated in this XML context.

Please use no more than one `ram:UnitQuantity` for the referenced product

ram:UnitQuantity is entered more than once for the referenced product. You can resolve this by removing the duplicate quantity entry.

What to do
  1. Locate ram:IncludedReferencedProduct in the invoice-line product.
  2. Remove any extra ram:UnitQuantity elements there.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedReferencedProduct>
  <ram:UnitQuantity/>
  <ram:UnitQuantity/>
</ram:IncludedReferencedProduct>
✓ Correct
<ram:IncludedReferencedProduct>
  <ram:UnitQuantity/>
</ram:IncludedReferencedProduct>
Technical details

The check counts the direct ram:UnitQuantity children of ram:IncludedReferencedProduct and passes when their number is at most one.

Where the rule applies

The rule applies to ram:IncludedReferencedProduct within an invoice-line product.

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