Provide the prepaid amount total at most once

Error FX-SCH-A-000193 Factur-X

Element 'ram:TotalPrepaidAmount' 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:TotalPrepaidAmount occurs more than once in ram:SpecifiedTradeSettlementHeaderMonetarySummation. The element may occur there at most once.

What the rule means

ram:TotalPrepaidAmount contains the total amount prepaid at document level. Limiting it to at most one element prevents this amount from being stated multiple times.

Please include the total prepaid amount no more than once

The total prepaid amount has been entered more than once in the settlement totals. Remove the additional occurrences of ram:TotalPrepaidAmount.

What to do
  1. Find ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Check its ram:TotalPrepaidAmount 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:TotalPrepaidAmount>10.00</ram:TotalPrepaidAmount>
  <ram:TotalPrepaidAmount>5.00</ram:TotalPrepaidAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:TotalPrepaidAmount>10.00</ram:TotalPrepaidAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

The rule counts the direct ram:TotalPrepaidAmount 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:TotalPrepaidAmount)<=1