ram:LineTotalAmount must occur exactly once

Error FX-SCH-A-000189 Factur-X

Element 'ram:LineTotalAmount' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

ram:LineTotalAmount is missing from ram:SpecifiedTradeSettlementHeaderMonetarySummation or occurs more than once. The check requires exactly one element.

What the rule means

ram:LineTotalAmount is the sum of the invoice lines in the settlement totals and must be stated unambiguously.

Please provide the invoice line total exactly once

ram:LineTotalAmount is missing from the settlement totals or appears more than once. Adjust the entry in ram:SpecifiedTradeSettlementHeaderMonetarySummation.

What to do
  1. Locate ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Check how many times ram:LineTotalAmount occurs in it.
  3. Ensure that it contains exactly one ram:LineTotalAmount.
  4. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation/>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:LineTotalAmount>...</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

The XPath test counts the direct ram:LineTotalAmount elements within ram:SpecifiedTradeSettlementHeaderMonetarySummation and requires the count to be 1.

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:LineTotalAmount)=1