Base amount when a percentage is provided

Error PEPPOL-EN16931-R041 Peppol

Allowance/charge base amount MUST be provided when allowance/charge percentage is provided.

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

An allowance or charge contains ram:CalculationPercent but no ram:BasisAmount. The rule requires the base amount for this combination.

What the rule means

The base amount is the amount to which the allowance or charge percentage is applied.

Please add the allowance or charge base amount

A percentage is provided for an allowance or charge, but its base amount is missing. You can correct the invoice by adding that amount.

What to do
  1. Find the affected ram:SpecifiedTradeAllowanceCharge.
  2. Add ram:BasisAmount there to accompany ram:CalculationPercent.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:CalculationPercent>10</ram:CalculationPercent>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:CalculationPercent>10</ram:CalculationPercent>
  <ram:BasisAmount>100</ram:BasisAmount>
</ram:SpecifiedTradeAllowanceCharge>
Technical details

The rule context selects allowances or charges with ram:CalculationPercent and without ram:BasisAmount; the false() test fails for every entry selected this way.

Where the rule applies

The rule applies to a ram:SpecifiedTradeAllowanceCharge where ram:CalculationPercent is present and ram:BasisAmount is absent.

Context (rule/@context)
ram:SpecifiedTradeAllowanceCharge[ram:CalculationPercent and not(ram:BasisAmount)]
Test expression (assert/@test)
false()