Provide the invoice total exactly once

Error FX-SCH-A-000043 Factur-X

Element 'ram:GrandTotalAmount' 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:SpecifiedTradeSettlementHeaderMonetarySummation does not contain ram:GrandTotalAmount exactly once. The element is missing or occurs more than once.

What the rule means

ram:GrandTotalAmount gives the invoice total. Requiring it exactly once keeps this total unambiguous.

Please provide the invoice total exactly once

The totals are missing ram:GrandTotalAmount, or the element appears more than once. Providing it exactly once clearly states the invoice total.

What to do
  1. Open ram:SpecifiedTradeSettlementHeaderMonetarySummation.
  2. Make sure it contains ram:GrandTotalAmount exactly once.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementHeaderMonetarySummation/>
✓ Correct
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  <ram:GrandTotalAmount>0</ram:GrandTotalAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
Technical details

The test counts the direct ram:GrandTotalAmount children of ram:SpecifiedTradeSettlementHeaderMonetarySummation and requires a count of 1.

Where the rule applies

In the document-level totals within ram:SpecifiedTradeSettlementHeaderMonetarySummation.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeSettlementHeaderMonetarySummation
Test expression (assert/@test)
count(ram:GrandTotalAmount)=1