Exactly one indicator for the charge

Error FX-SCH-A-000546 Factur-X

Element 'ram:ChargeIndicator' 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

In this ram:SpecifiedTradeAllowanceCharge, ram:ChargeIndicator does not occur exactly once. The test counts the occurrences and requires exactly one.

What the rule means

ram:ChargeIndicator identifies whether the amount represents an allowance or a charge. Here, true indicates a charge, for which exactly one indicator must be present.

Please provide exactly one indicator for the charge

The charge on the invoice line does not contain exactly one ram:ChargeIndicator. A single occurrence identifies the charge unambiguously.

What to do
  1. Locate the relevant ram:SpecifiedTradeAllowanceCharge on the invoice line.
  2. Ensure it contains exactly one ram:ChargeIndicator with udt:Indicator set to true.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The test requires count(ram:ChargeIndicator) to equal 1 in the selected ram:SpecifiedTradeAllowanceCharge.

Where the rule applies

The rule applies to ram:SpecifiedTradeAllowanceCharge at invoice line level when its ram:ChargeIndicator has the value true.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/ udt:Indicator="true"]
Test expression (assert/@test)
count(ram:ChargeIndicator)=1