Provide the VAT category for the allowance

Error BR-32 EN 16931

Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).

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

The allowance is missing CategoryCode under CategoryTradeTax with tax type VAT. Each document-level allowance must have a VAT category code.

What the rule means

The VAT category code assigns the allowance to its VAT category. This information is required for every document-level allowance.

Affected fields BG-20 BT-95
Please add the allowance’s VAT category code

The VAT category code is missing for the allowance. Add the code in its associated VAT details.

What to do
  1. Review the tax category using TaxCategoryCodes.
  2. Add CategoryCode in the CategoryTradeTax with TypeCode VAT, for example through AddTradeAllowance(...).
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:TypeCode>VAT</ram:TypeCode>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>false</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:TypeCode>VAT</ram:TypeCode>
    <ram:CategoryCode>S</ram:CategoryCode>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
Check in FactoorSharp
  • TaxCategoryCodes (BT-95)
  • FacturXInvoice.AddTradeAllowance(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-20)
  • FacturXInvoice.GetTradeAllowances() (BG-20)
  • FacturXInvoice.TradeAllowanceCharges (BG-20)
  • AbstractTradeAllowanceCharge (Document level allowance: BG-20)
Technical details

For allowances with ChargeIndicator set to false, the test looks for a TypeCode with the value VAT under CategoryTradeTax and requires CategoryCode there.

Where the rule applies

The rule applies to an allowance in SpecifiedTradeAllowanceCharge at document level when ChargeIndicator has the value false.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:ChargeIndicator[udt:Indicator='false']
Test expression (assert/@test)
(../ram:CategoryTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)