Provide the invoice line total 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. It must occur exactly once.

What the rule means

ram:LineTotalAmount contains the total of the invoice lines at document level. The required occurrence count ensures that this total amount is present unambiguously.

Please provide the invoice line total exactly once

The invoice line total is missing from the settlement totals or has been entered more than once. This can be resolved by including ram:LineTotalAmount once.

What to do
  1. Find ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Include exactly one ram:LineTotalAmount in it and remove any additional occurrences.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation/>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:LineTotalAmount>100.00</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

The rule counts the direct ram:LineTotalAmount child elements of ram:SpecifiedTradeSettlementHeaderMonetarySummation and requires the value 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:LineTotalAmount)=1