VAT breakdown for category L

Error BR-FXEXT-AF-01 Factur-X

An Invoice that contains an Invoice line (BG-25) where the "Subtype of invoice line item" (BT-X-8) has the value "DETAIL" or is not specified, a Document level allowance (BG-20) or a Document level charge or tax (BG-21) or a Logistics Service Charge ( BG-X-42) where the VAT category code (BT-151, BT-95, BT-102, or BT-X-273) is “L” ("Canary Islands tax") shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with “L” ("Canary Islands tax").

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

A relevant invoice line with a missing or DETAIL value in ram:LineStatusReasonCode, an allowance, a charge, or a logistics service uses VAT category L, but the VAT breakdown does not contain both ram:ApplicableTradeTax/ram:CategoryCode with value L and at least one matching VAT detail with value L on an invoice line, category, or applied tax.

What the rule means

The code L identifies the tax category for the Canary Islands. This category must be represented in the invoice VAT breakdown and in at least one associated VAT detail.

Please include category `L` in the VAT breakdown

VAT category L is used in the tax details, but its required representation in the VAT breakdown is incomplete. Complete the related details so that the category is represented consistently.

What to do
  1. Check VAT category L on the affected invoice lines and tax details.
  2. Check AssociatedDocument.LineStatusReasonCode if an invoice line should not be included.
  3. Complete the VAT breakdown with FacturXInvoice.AddApplicableTradeTax(...) and use category L there.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLineTradeSettlement>
  <ram:ApplicableTradeTax>
    <ram:CategoryCode>L</ram:CategoryCode>
  </ram:ApplicableTradeTax>
</ram:SpecifiedLineTradeSettlement>
✓ Correct
<ram:ApplicableHeaderTradeSettlement>
  <ram:ApplicableTradeTax>
    <ram:CategoryCode>L</ram:CategoryCode>
  </ram:ApplicableTradeTax>
</ram:ApplicableHeaderTradeSettlement>
<ram:SpecifiedLineTradeSettlement>
  <ram:ApplicableTradeTax>
    <ram:CategoryCode>L</ram:CategoryCode>
  </ram:ApplicableTradeTax>
</ram:SpecifiedLineTradeSettlement>
Check in FactoorSharp
  • TaxCategoryCodes (BT-151; BT-95; BT-102; BT-118)
  • AssociatedDocument.LineStatusReasonCode (BT-X-8)
  • FacturXInvoice.AddApplicableTradeTax(basisAmount, percent, taxAmount, typeCode, categoryCode, allowanceChargeBasisAmount, exemptionReasonCode, exemptionReason, lineTotalBasisAmount) (BG-23)
  • FacturXInvoice.AnyApplicableTradeTaxes() (BG-23)
  • FacturXInvoice.GetApplicableTradeTaxes() (BG-23)
Technical details

The test allows category L to be absent from all checked areas, or requires L in ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax and in at least one checked line or tax area.

Where the rule applies

The rule applies to the invoice VAT breakdown and to VAT details on invoice lines, allowances, charges, and logistics services.

Context (rule/@context)
/rsm:CrossIndustryInvoice
Test expression (assert/@test)
( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='L'])=0 and count(//ram:SpecifiedLineTradeSettlement[ not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL' ]/ram:ApplicableTradeTax[ram:CategoryCode='L'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='L'])=0 and count(//ram:AppliedTradeTax[ram:CategoryCode='L'])=0 ) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='L'])>=1 and ( exists(//ram:SpecifiedLineTradeSettlement[ not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL' ]/ram:ApplicableTradeTax[ram:CategoryCode='L']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='L']) or exists(//ram:AppliedTradeTax[ram:CategoryCode='L']) ) )