Provide the allowance total 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:AllowanceTotalAmount occurs more than once in ram:SpecifiedTradeSettlementHeaderMonetarySummation. The element may occur there at most once.

What the rule means

ram:AllowanceTotalAmount contains the total of allowances at document level. Limiting it to at most one element prevents the total from being stated multiple times.

Please include the allowance total no more than once

The allowance total has been entered more than once in the settlement totals. Remove the additional occurrences of ram:AllowanceTotalAmount.

What to do
  1. Find ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Check its ram:AllowanceTotalAmount elements and remove all but at most one.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount>
  <ram:AllowanceTotalAmount>5.00</ram:AllowanceTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

The rule counts the direct ram:AllowanceTotalAmount child elements of ram:SpecifiedTradeSettlementHeaderMonetarySummation and permits a count of 0 or 1.

Where the rule applies

The rule applies to the monetary totals of the settlement at document level in ram:SpecifiedTradeSettlementHeaderMonetarySummation.

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