VAT category of the charge

Error BR-37 EN 16931

Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).

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

The charge 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 charge to the applicable VAT category. This classification is relevant to the invoice’s VAT breakdown.

Affected fields BG-21 BT-102
Please add the charge’s VAT category code

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

What to do
  1. Add ram:CategoryCode under ram:CategoryTradeTax for the charge.
  2. Check the value set through TaxCategoryCodes and the call to AddTradeCharge(...) or AddTradeeCharge(...).
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:TypeCode>VAT</ram:TypeCode>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</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-102)
  • 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)
  • FacturXInvoice.GetTradeCharges() (BG-21)
  • AbstractTradeAllowanceCharge (Document level charge: BG-21)
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 charge in ram:SpecifiedTradeAllowanceCharge and its VAT details in ram:CategoryTradeTax.

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