Provide exactly one charge amount

Error FX-SCH-A-000532 Factur-X

Element 'ram:ChargeAmount' 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:ChargeAmount does not occur exactly once in ram:NetPriceProductTradePrice. The element is either missing or occurs more than once.

What the rule means

The net price of the invoice line must contain exactly one charge amount at this point.

Please provide exactly one charge amount for the net price

The charge amount is missing or entered more than once in the net price of an invoice line. The entry can be adjusted to contain exactly one ram:ChargeAmount.

What to do
  1. Find ram:NetPriceProductTradePrice in the affected invoice line.
  2. Check that it contains exactly one ram:ChargeAmount.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:NetPriceProductTradePrice/>
✓ Correct
<ram:NetPriceProductTradePrice>
  <ram:ChargeAmount>0</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
Technical details

The test counts the direct ram:ChargeAmount elements within ram:NetPriceProductTradePrice and requires a count of one.

Where the rule applies

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

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice
Test expression (assert/@test)
count(ram:ChargeAmount)=1