Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).
The allowance is missing the VAT category code ram:CategoryCode within a ram:CategoryTradeTax whose tax type is VAT.
The VAT category code assigns the allowance to the applicable VAT category. This classification is relevant to the invoice’s VAT breakdown.
The allowance is missing its VAT category code. Add it to the allowance’s VAT details.
- Add
ram:CategoryCodeunderram:CategoryTradeTaxfor the allowance. - Check the value set through
TaxCategoryCodesand the call toAddTradeAllowance(...). - Regenerate the invoice and validate it again.
<ram:SpecifiedTradeAllowanceCharge> <ram:ChargeIndicator> <udt:Indicator>false</udt:Indicator> </ram:ChargeIndicator> <ram:CategoryTradeTax> <ram:TypeCode>VAT</ram:TypeCode> </ram:CategoryTradeTax> </ram:SpecifiedTradeAllowanceCharge>
<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>
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.
The rule applies to a document-level allowance in ram:SpecifiedTradeAllowanceCharge and its VAT details in ram:CategoryTradeTax.
rule/@context)assert/@test)