Agreement details per invoice line

Error FX-SCH-A-000268 Factur-X

Element 'ram:SpecifiedLineTradeAgreement' 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:SpecifiedLineTradeAgreement does not occur exactly once in the invoice line. The element is either missing or present more than once.

What the rule means

ram:SpecifiedLineTradeAgreement contains the agreement details for the invoice line. Each line must have exactly one such agreement section.

Please include exactly one agreement section for the invoice line

The invoice line’s agreement section is missing or appears more than once. Exactly one such section is expected for each invoice line.

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

In the invoice-line context, the rule checks whether the number of direct ram:SpecifiedLineTradeAgreement 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:SpecifiedLineTradeAgreement)=1