Provide the charge total at most once

Error FX-SCH-A-000190 Factur-X

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

What the rule means

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

Please include the charge total no more than once

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

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

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