Product details per invoice line

Error FX-SCH-A-000267 Factur-X

Element 'ram:SpecifiedTradeProduct' must occur exactly 1 times.

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

ram:SpecifiedTradeProduct does not occur exactly once in the invoice line. The element is either missing or present more than once.

What the rule means

ram:SpecifiedTradeProduct contains the product details for the invoice line. Each line must have exactly one such product entry.

Please provide exactly one product for each invoice line

A product entry is missing from an invoice line or appears more than once. This can be fixed by having a single product entry.

What to do
  1. Find the affected ram:IncludedSupplyChainTradeLineItem.
  2. Check that it contains exactly one ram:SpecifiedTradeProduct.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:IncludedSupplyChainTradeLineItem/>
✓ Correct
<ram:IncludedSupplyChainTradeLineItem>
  <ram:SpecifiedTradeProduct/>
</ram:IncludedSupplyChainTradeLineItem>
Technical details

In the invoice-line context, the rule checks whether the number of direct ram:SpecifiedTradeProduct elements equals 1.

Where the rule applies

The rule applies within each invoice line (ram:IncludedSupplyChainTradeLineItem).

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