ChargeTotalAmount at most once

Error FX-SCH-A-001140 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 within ram:SpecifiedTradeSettlementLineMonetarySummation.

What the rule means

ram:ChargeTotalAmount contains the total charges on the invoice line. The element may occur at most once in this summary.

Please include the total charges only once

ram:ChargeTotalAmount appears more than once in the invoice-line summary. It may occur there at most once.

What to do
  1. Locate ram:SpecifiedTradeSettlementLineMonetarySummation for the affected invoice line.
  2. Make sure ram:ChargeTotalAmount occurs there no more than once.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:ChargeTotalAmount/>
  <ram:ChargeTotalAmount/>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
✓ Correct
<ram:SpecifiedTradeSettlementLineMonetarySummation>
  <ram:ChargeTotalAmount/>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
Technical details

The test counts direct ram:ChargeTotalAmount elements within ram:SpecifiedTradeSettlementLineMonetarySummation and requires their count to be no greater than one.

Where the rule applies

The rule applies to ram:SpecifiedTradeSettlementLineMonetarySummation of an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation
Test expression (assert/@test)
count(ram:ChargeTotalAmount)<=1