Invoice line needs a VAT category

Error BR-FXEXT-CO-04 Factur-X

Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151) if the "Subtype of invoice line item" (BT-X-8) has the value "Normal line item (standard case)" (DETAIL) or is not specified.

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

The normal invoice line either has no tax entry with ram:TypeCode equal to VAT, or that tax entry is missing ram:CategoryCode. The line’s VAT category is therefore not fully stated.

What the rule means

The VAT category code classifies the invoice line for tax purposes. It is required for normal invoice lines when the tax entry has the type VAT.

Affected fields BG-25 BT-151 BT-X-8
Please add the VAT category to the invoice line

The VAT category is missing from the VAT tax entry for this normal invoice line. Add the category code to the relevant tax entry.

What to do
  1. Find ram:ApplicableTradeTax in ram:SpecifiedLineTradeSettlement.
  2. Check whether ram:TypeCode has the value VAT.
  3. Set the category using TradeLineItem.TaxCategoryCode.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLineTradeSettlement>
  <ram:ApplicableTradeTax>
    <ram:TypeCode>VAT</ram:TypeCode>
  </ram:ApplicableTradeTax>
</ram:SpecifiedLineTradeSettlement>
✓ Correct
<ram:SpecifiedLineTradeSettlement>
  <ram:ApplicableTradeTax>
    <ram:TypeCode>VAT</ram:TypeCode>
    <ram:CategoryCode>S</ram:CategoryCode>
  </ram:ApplicableTradeTax>
</ram:SpecifiedLineTradeSettlement>
Check in FactoorSharp
  • AssociatedDocument.LineStatusReasonCode (BT-X-8)
  • LineStatusReasonCodes (BT-X-8)
  • TradeLineItem.TaxCategoryCode (BT-151)
  • TradeLineItem.TaxType (BT-151-0)
  • TaxCategoryCodes (BT-151)
Technical details

The test first requires a tax entry with ram:TypeCode equal to VAT, then requires a ram:CategoryCode under a tax entry whose ram:TypeCode becomes VAT when converted to uppercase. The rule applies only when ram:LineStatusReasonCode is absent or has the value DETAIL.

Where the rule applies

The rule applies to ram:AssociatedDocumentLineDocument when ram:LineStatusReasonCode is absent or has the value DETAIL. In the associated tax information, ram:CategoryCode is checked when ram:TypeCode is VAT.

Context (rule/@context)
//ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument[ not(ram:LineStatusReasonCode) or ram:LineStatusReasonCode = 'DETAIL' ]
Test expression (assert/@test)
(../ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT') and (../ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[upper-case(ram:TypeCode) = 'VAT']/ ram:CategoryCode)