ram:AllowanceTotalAmount may occur at most once

Error FX-SCH-A-000191 Factur-X

Element 'ram:AllowanceTotalAmount' 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:SpecifiedTradeSettlementHeaderMonetarySummation contains ram:AllowanceTotalAmount more than once. The element may be absent but must not occur multiple times.

What the rule means

ram:AllowanceTotalAmount states the total allowances at document level. A single entry avoids ambiguity in the allowance total.

Please state the total allowances no more than once

The total allowances are stated more than once in ram:SpecifiedTradeSettlementHeaderMonetarySummation. Remove the duplicate occurrences; the entry may also be omitted.

What to do
  1. Locate ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Check how many times ram:AllowanceTotalAmount occurs in it.
  3. Keep at most one ram:AllowanceTotalAmount, or remove the element entirely.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:AllowanceTotalAmount>...</ram:AllowanceTotalAmount>
  <ram:AllowanceTotalAmount>...</ram:AllowanceTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation/>
Technical details

The XPath test counts the direct ram:AllowanceTotalAmount elements within ram:SpecifiedTradeSettlementHeaderMonetarySummation and allows at most one.

Where the rule applies

The rule applies to the settlement totals in ram:SpecifiedTradeSettlementHeaderMonetarySummation.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
count(ram:AllowanceTotalAmount)<=1