IPSI charge VAT rate must not be negative

Error BR-AG-07 EN 16931

In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is "IPSI" the Document level charge VAT rate (BT-103) shall be 0 (zero) or greater than zero.

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

The VAT rate of the document-level charge is less than zero. For a charge with VAT category M, ram:RateApplicablePercent must not be negative.

What the rule means

A negative VAT rate conflicts with the rule for a document-level charge in category M, which requires a rate of at least zero.

Affected fields BG-21 BT-102 BT-103
Please set the IPSI charge VAT rate to zero or more

The VAT rate for the document-level charge with VAT category M is below zero. Adjust the value so that it is zero or higher.

What to do
  1. Check the value of ram:RateApplicablePercent for the relevant charge.
  2. Check the VAT rate value in AddTradeCharge(...).
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:CategoryCode>M</ram:CategoryCode>
    <ram:RateApplicablePercent>-1</ram:RateApplicablePercent>
  </ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
✓ Correct
<ram:SpecifiedTradeAllowanceCharge>
  <ram:ChargeIndicator>
    <udt:Indicator>true</udt:Indicator>
  </ram:ChargeIndicator>
  <ram:CategoryTradeTax>
    <ram:CategoryCode>M</ram:CategoryCode>
    <ram:RateApplicablePercent>0</ram:RateApplicablePercent>
  </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 XPath checks whether ram:RateApplicablePercent is numerically greater than or equal to zero.

Where the rule applies

The rule applies to ram:RateApplicablePercent of a document-level charge in ram:SpecifiedTradeAllowanceCharge with VAT category M.

Context (rule/@context)
//ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator='true']/ ram:CategoryTradeTax[ram:CategoryCode = 'M']
Test expression (assert/@test)
ram:RateApplicablePercent >= 0