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

What the rule means

ram:ChargeTotalAmount states the total charges at document level. A single entry avoids ambiguity in the charge total.

Please state the total charges no more than once

The total charges 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:ChargeTotalAmount occurs in it.
  3. Keep at most one ram:ChargeTotalAmount, or remove the element entirely.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:ChargeTotalAmount>...</ram:ChargeTotalAmount>
  <ram:ChargeTotalAmount>...</ram:ChargeTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation/>
Technical details

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