Partial payment amount at most once

Error FX-SCH-A-000330 Factur-X

Element 'ram:PartialPaymentAmount' may occur at maximum 1 times.

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

Within ram:SpecifiedTradePaymentTerms, ram:PartialPaymentAmount occurs more than once. This element may occur at most once in this context.

What the rule means

ram:PartialPaymentAmount contains a partial payment amount in the payment terms. The limit prevents multiple occurrences of this amount field in the same context.

Please include the partial payment amount only once

The invoice contains multiple ram:PartialPaymentAmount elements in the payment terms. Only one such element is allowed in this context.

What to do
  1. Locate ram:SpecifiedTradePaymentTerms in the invoice.
  2. Check its ram:PartialPaymentAmount elements and remove the duplicate occurrence.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradePaymentTerms>
  <ram:PartialPaymentAmount>10.00</ram:PartialPaymentAmount>
  <ram:PartialPaymentAmount>20.00</ram:PartialPaymentAmount>
</ram:SpecifiedTradePaymentTerms>
✓ Correct
<ram:SpecifiedTradePaymentTerms>
  <ram:PartialPaymentAmount>10.00</ram:PartialPaymentAmount>
</ram:SpecifiedTradePaymentTerms>
Technical details

The test counts the direct ram:PartialPaymentAmount elements in ram:SpecifiedTradePaymentTerms and permits no more than one.

Where the rule applies

The rule applies within ram:SpecifiedTradePaymentTerms at document level.

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