VAT category of 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 the VAT category code ram:CategoryCode within a ram:CategoryTradeTax whose tax type is VAT.

What the rule means

The VAT category code assigns the allowance to the applicable VAT category. This classification is relevant to the invoice’s VAT breakdown.

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

The allowance is missing its VAT category code. Add it to the allowance’s VAT details.

What to do
  1. Add ram:CategoryCode under ram:CategoryTradeTax for the allowance.
  2. Check the value set through TaxCategoryCodes and the call to AddTradeAllowance(...).
  3. Regenerate the invoice and validate it again.
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

The test requires a ram:CategoryCode under ram:CategoryTradeTax whose ram:TypeCode, converted to uppercase, equals VAT.

Where the rule applies

The rule applies to a document-level allowance in ram:SpecifiedTradeAllowanceCharge and its VAT details in ram:CategoryTradeTax.

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)