Percentage when a base amount is provided

Error PEPPOL-EN16931-R042 Peppol

Allowance/charge percentage MUST be provided when allowance/charge base amount 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:BasisAmount but no ram:CalculationPercent. The rule requires the percentage for this combination.

What the rule means

The percentage indicates how the base amount is used to calculate the allowance or charge.

Please add the allowance or charge percentage

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

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

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

Where the rule applies

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

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