At most one VAT rate per allowance or charge

Error CII-SR-472 Syntax (UBL/CII)

Each Specified Trade Allowance Charge (BG-20)(BG-21) should contain a VAT rate (BT-96).

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

A ram:SpecifiedTradeAllowanceCharge contains more than one ram:RateApplicablePercent element. The test limits the count to at most one; it does not require the element to be present.

What the rule means

The rule prevents more than one VAT rate from being assigned to an allowance or charge.

Affected fields BG-20 BG-21 BT-96
Please use no more than one VAT rate for each allowance or charge.

An allowance or charge contains multiple VAT rates. Remove the extra entries; this test does not require a VAT rate to be present.

What to do
  1. Check the affected allowance or charge.
  2. Use no more than one VAT rate in AddTradeAllowance(...) or AddTradeCharge(...).
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:RateApplicablePercent>20</ram:RateApplicablePercent>
  <ram:RateApplicablePercent>10</ram:RateApplicablePercent>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:RateApplicablePercent>20</ram:RateApplicablePercent>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • AbstractTradeAllowanceCharge (Document level allowance: BG-20; Document level charge: BG-21)
  • AbstractTradeAllowanceCharge.ChargeIndicator (Document level allowance: BG-20; Document level charge: BG-21)
  • FacturXInvoice.AddTradeAllowance(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-20)
  • FacturXInvoice.AddTradeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-21)
  • FacturXInvoice.AddTradeeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-21)
Technical details

The test counts ram:RateApplicablePercent elements within ram:SpecifiedTradeAllowanceCharge and allows at most one.

Where the rule applies

The rule applies to each document-level ram:SpecifiedTradeAllowanceCharge, meaning an allowance or charge.

Context (rule/@context)
//ram:SpecifiedTradeAllowanceCharge
Test expression (assert/@test)
count(ram:RateApplicablePercent) <= 1