Reconcile the taxable amount for category O

Warning BR-FXEXT-O-08ini Factur-X

[BR-FXEXT-O-08ini] - In a VAT breakdown (BG-23) where VAT category code (BT-118) is equal to “O” ("Not subject to VAT"), Absolute Value of (VAT category taxable amount (BT-116) - ∑ Invoice line net amounts (BT-131) + Σ Document level allowance amounts (BT-92) - Σ Document level charge amounts (BT-99) - Σ Logistics Service fee amounts (BT-x-272)) <= 0,01 * ((Number of line net amounts (BT-131) + Number of Document level allowance amounts (BT-92) + Number of Document level charge amounts (BT-99) + Number of Logistics Service fee amounts (BT-X-272)), where the VAT category code (BT-151, BT-95, BT-102, BT-X-273) is "Not subject to VAT" (O), but only for lines where the "Subtype of invoice item" (BT-X-8) has the value "DETAIL" or is not specified.

Recommendation: The invoice remains valid but should be corrected so that it can be processed automatically.
What is wrong

The amount ram:BasisAmount differs from the sum of the related invoice-line, allowance, charge, and logistics amounts by more than permitted. The reconciliation uses amounts in category O; invoice lines with a ram:LineStatusReasonCode other than DETAIL are excluded.

What the rule means

The taxable amount for amounts not subject to VAT must be derived from the amounts in category O. The rule allows a rounding difference of 0.01 per included amount.

Please reconcile the taxable amount for category `O`

The taxable amount in the O VAT breakdown does not sufficiently match the related amounts in category O. Check the invoice lines and the document-level allowances, charges, and logistics amounts.

What to do
  1. Compare ram:BasisAmount with the invoice-line amounts, allowances, charges, and logistics amounts in category O.
  2. Check TaxCategoryCodes, TradeLineItem.LineTotalAmount, and AbstractTradeAllowanceCharge.ActualAmount.
  3. Check that AssociatedDocument.LineStatusReasonCode or LineStatusReasonCodes is DETAIL or absent.
  4. Generate the invoice again and validate it again.
Check in FactoorSharp
  • TaxCategoryCodes (BT-151; BT-95; BT-102; BT-118)
  • AbstractTradeAllowanceCharge.ActualAmount (Document level allowance: BT-92; Document level charge: BT-99)
  • AssociatedDocument.LineStatusReasonCode (BT-X-8)
  • LineStatusReasonCodes (BT-X-8)
  • TradeLineItem.LineTotalAmount (BT-131)
Technical details

Sums category O amounts without filtering by exemption reasons and compares the result with ram:BasisAmount. The allowed difference is 0.01 per included amount.

Where the rule applies

The rule applies to the category O VAT breakdown ram:ApplicableTradeTax in ram:ApplicableHeaderTradeSettlement.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='O'][upper-case(ram:TypeCode) = 'VAT']
Test expression (assert/@test)
( for $exempReasonText in normalize-space(ram:ExemptionReason), $exempReasonCode in normalize-space(ram:ExemptionReasonCode), $basisAmount in xs:decimal(ram:BasisAmount), $calculatedAmountBT131ini in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL' ]/ram:SpecifiedLineTradeSettlement[ram:ApplicableTradeTax/ram:CategoryCode = 'O']/ ram:SpecifiedTradeSettlementLineMonetarySummation/xs:decimal(ram:LineTotalAmount)) * 100) div 100), $allowancesAmountBT92ini in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:ChargeIndicator/udt:Indicator=false() and ram:CategoryTradeTax/ram:CategoryCode='O' ]/xs:decimal(ram:ActualAmount)) * 100) div 100), $chargesAmountBT99 in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:ChargeIndicator/udt:Indicator=true() and ram:CategoryTradeTax/ram:CategoryCode='S' and normalize-space(ram:CategoryTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:CategoryTradeTax/ram:ExemptionReason) = $exempReasonText ]/xs:decimal(ram:ActualAmount)) * 100) div 100), $chargesAmountBT99ini in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:ChargeIndicator/udt:Indicator=true() and ram:CategoryTradeTax/ram:CategoryCode='O' ]/xs:decimal(ram:ActualAmount)) * 100) div 100), $nbLineItemsini in xs:decimal(count(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:IncludedSupplyChainTradeLineItem[ ( not(ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode) or ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL' ) and ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = 'O' ])), $nbAllowancesOrChargesini in xs:decimal(count(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ram:CategoryTradeTax/ram:CategoryCode='O'])), $logisticChargeAmountini in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedLogisticsServiceCharge[ram:AppliedTradeTax/ram:CategoryCode='O']/ xs:decimal(ram:AppliedAmount)) * 100) div 100), $nblogisticChargeini in xs:decimal(count(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:SpecifiedLogisticsServiceCharge[ram:AppliedTradeTax/ ram:CategoryCode='O'])) return abs($basisAmount - $calculatedAmountBT131ini + $allowancesAmountBT92ini - $chargesAmountBT99ini - $logisticChargeAmountini) le 0.01 * ($nbLineItemsini + $nbAllowancesOrChargesini + $nblogisticChargeini) )