Each Specified Trade Allowance Charge (BG-20)(BG-21) shall contain a VAT category code (BT-95).
A ram:SpecifiedTradeAllowanceCharge contains more than one ram:CategoryTradeTax element.
A document-level allowance or charge may contain no more than one VAT category. The test does not require a VAT category to be present.
A document-level allowance or charge contains multiple VAT categories. No more than one category is allowed for this entry; a category is not required to be present.
- Check the number of
ram:CategoryTradeTaxelements inram:SpecifiedTradeAllowanceCharge. - Keep no more than one such element; it may also be omitted.
- Check the entry through
AddTradeAllowance(...)orAddTradeCharge(...), then regenerate the invoice and check it again.
<ram:SpecifiedTradeAllowanceCharge> <ram:CategoryTradeTax/> <ram:CategoryTradeTax/> </ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeAllowanceCharge> <ram:CategoryTradeTax/> </ram:SpecifiedTradeAllowanceCharge>
TaxCategoryCodes(BT-95)AbstractTradeAllowanceCharge(Document level allowance: BG-20; Document level charge: BG-21)AbstractTradeAllowanceCharge.ChargeIndicator(Document level allowance: BG-20; Document level charge: BG-21)FacturXInvoice.AddTradeAllowance(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode)(BG-20)FacturXInvoice.AddTradeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode)(BG-21)
Technical details
The test counts the ram:CategoryTradeTax elements in the context and allows no more than one.
The rule applies to each document-level ram:SpecifiedTradeAllowanceCharge, whether it is an allowance or a charge.
rule/@context)assert/@test)