VAT category for 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 ram:TypeCode is VAT.

What the rule means

The VAT category code assigns the charge to a VAT category. This classification is needed to state the tax treatment of the charge.

Affected fields BG-21 BT-102
Please add the VAT category for the charge

A charge is missing its VAT category. Add the category code in the charge’s tax details.

What to do
  1. Add ram:CategoryCode within ram:CategoryTradeTax with the tax type VAT.
  2. Check the AddTradeCharge(...) call and the VAT category code passed to it.
  3. Regenerate the invoice and validate it again.
Check in FactoorSharp
  • TaxCategoryCodes (BT-102)
  • FacturXInvoice.AddTradeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode) (BG-21)
  • FacturXInvoice.GetTradeCharges() (BG-21)
  • AbstractTradeAllowanceCharge (Document level charge: BG-21)
  • AbstractTradeAllowanceCharge.ChargeIndicator (Document level charge: BG-21)
Technical details

The check applies to charges with ram:ChargeIndicator equal to true and looks for ram:CategoryCode under ram:CategoryTradeTax where ram:TypeCode matches VAT case-insensitively.

Where the rule applies

The rule applies to each charge in ram:SpecifiedTradeAllowanceCharge within ram:ApplicableHeaderTradeSettlement.

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)