Rapprocher la base imposable de la catégorie M

Erreur BR-FXEXT-AG-08b Factur-X

[BR-FXEXT-AG-08b] - Dans une ventilation de la TVA (BG-23) où le code de catégorie de TVA (BT-118) est égal à « M » (« Impôt sur la production, les services et l'importation à Ceuta et Melilla (IPSI) »), la valeur absolue de (Montant taxable de la catégorie de TVA (BT-116) - ∑ Montants nets des lignes de facture (BT-131) + Σ Montants des remises au niveau du document (BT-92) - Σ Montants des charges ou frais au niveau du document (BT-99) - Σ Montants des frais de service logistique (BT-x-272)) <= 0,01 * ((Nombre des montants nets des lignes de facture (BT-131) + Nombre des montants des remises au niveau du document (BT-92) + Nombre des montants des charges ou frais au niveau du document (BT-99) + Nombre des montants des frais de service logistique (BT-X-272)), où le code de catégorie de TVA (BT-151, BT-95, BT-102, BT-X-273) est « Impôt sur la production, les services et l'importation à Ceuta et Melilla (IPSI) » (M), mais uniquement pour les lignes pour lesquelles le « Sous-type de la ligne de facture » (BT-X-8) a la valeur « DETAIL » ou n'est pas spécifié, ou la même règle, mais en tenant également compte des motifs d'exonération en texte (BT-120) et en code (BT-121) dans BG-23 et des motifs d'exonération sur chaque ligne (BT-X-96 / BT-X-97), sur les remises au niveau du document (BT-173 / BT-174), sur les charges ou frais au niveau du document (BT-175 / BT-176) et sur les frais de service logistique (BT-X-591 / BT-X-592). L'une des deux règles doit être respectée, étant entendu qu'en définitive seule la deuxième devra être respectée.

Règle obligatoire : tant qu'elle n'est pas respectée, la facture est invalide et sera rejetée par les validateurs.
Ce qui ne va pas

Le montant ram:BasisAmount ne correspond pas aux lignes de facture, remises, majorations et montants logistiques associés dans la tolérance d’arrondi autorisée. Le test accepte soit un rapprochement tenant compte de motifs d’exonération identiques, soit un rapprochement sans ce filtre ; dans les deux cas, seules les lignes de facture avec DETAIL ou sans ram:LineStatusReasonCode sont prises en compte.

Ce que signifie la règle

La base imposable de catégorie M doit pouvoir être justifiée par les lignes de facture, remises, majorations et services logistiques associés. Le test prévoit deux modes de calcul acceptés, dont l’un rapproche également les motifs d’exonération.

Veuillez rapprocher la base imposable de la catégorie `M`

La base imposable de la ventilation de TVA M ne correspond pas suffisamment aux lignes de facture et aux montants associés au niveau du document. Le rapprochement peut tenir compte des motifs d’exonération ou regrouper les montants par catégorie et par taux.

Que faire ?
  1. Comparez ram:BasisAmount aux montants ram:LineTotalAmount, aux remises, aux majorations et à ram:AppliedAmount correspondants.
  2. Vérifiez TaxCategoryCodes, TradeLineItem.LineTotalAmount et AbstractTradeAllowanceCharge.ActualAmount.
  3. Vérifiez que AssociatedDocument.LineStatusReasonCode ou LineStatusReasonCodes vaut DETAIL ou est absent ; rapprochez la catégorie et le taux et, le cas échéant, les motifs d’exonération.
  4. Générez de nouveau la facture et vérifiez-la à nouveau.
À vérifier dans 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)
Bon à savoir

Le rapprochement peut tenir compte du code et du texte du motif d’exonération, ou regrouper par catégorie et taux sans exiger que ces motifs correspondent.

Détails techniques

Vérifie une égalité de montants avec une tolérance d’arrondi de 0,01 par montant pris en compte. La condition XPath est une alternative : une branche filtre selon le code et le texte du motif d’exonération, l’autre regroupe par catégorie et taux.

Où la règle s'applique

La règle s’applique à la ventilation de TVA ram:ApplicableTradeTax de catégorie M dans ram:ApplicableHeaderTradeSettlement.

Message d'origine du Schematron
[BR-FXEXT-AG-08b] - In a VAT breakdown (BG-23) where VAT category code (BT-118) is equal to “M” ("Ceuta and Mellita tax"), 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 "Ceuta and Mellita tax" (M), but only for lines where the "Subtype of invoice item" (BT-X-8) has the value "DETAIL" or is not specified or the same rule but also taking into account the exemption reasons in Text (BT-120) and Code (BT-121) in BG-23 and the exemption reasons on each line (BT-X-96 / BT-X-97), on Document level Allowances (BT-173 / BT-174) and on Document Level Charges (BT-175 / BT-176) and on Service logistic charges (BT-X-591 / BT-X-592). One of the two rules must be followed, bearing in mind that ultimately only the second one will have to be followed.
Contexte (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='M'][upper-case(ram:TypeCode) = 'VAT']
Expression de contrôle (assert/@test)
( for $rate in xs:decimal(ram:RateApplicablePercent), $exempReasonText in normalize-space(ram:ExemptionReason), $exempReasonCode in normalize-space(ram:ExemptionReasonCode), $basisAmount in xs:decimal(ram:BasisAmount), $calculatedAmountBT131 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 = 'M' and ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate and normalize-space(ram:ApplicableTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:ApplicableTradeTax/ram:ExemptionReason) = $exempReasonText ]/ram:SpecifiedTradeSettlementLineMonetarySummation/xs:decimal(ram:LineTotalAmount)) * 100) div 100), $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 = 'M' and ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate ]/ram:SpecifiedTradeSettlementLineMonetarySummation/xs:decimal(ram:LineTotalAmount)) * 100) div 100), $allowancesAmountBT92 in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:ChargeIndicator/udt:Indicator=false() and ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate and normalize-space(ram:CategoryTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:CategoryTradeTax/ram:ExemptionReason) = $exempReasonText ]/xs:decimal(ram:ActualAmount)) * 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='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate ]/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='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate 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='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate ]/xs:decimal(ram:ActualAmount)) * 100) div 100), $nbLineItems 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 = 'M' and ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate and normalize-space(ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ ram:ExemptionReason) = $exempReasonText ])), $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 = 'M' and ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/xs:decimal(ram:RateApplicablePercent) =$rate ])), $nbAllowancesOrCharges in xs:decimal(count(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate and normalize-space(ram:CategoryTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:CategoryTradeTax/ram:ExemptionReason) = $exempReasonText ])), $nbAllowancesOrChargesini in xs:decimal(count(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeAllowanceCharge[ ram:CategoryTradeTax/ram:CategoryCode='M' and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate ])), $logisticChargeAmount in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedLogisticsServiceCharge[ ram:AppliedTradeTax/ram:CategoryCode='M' and ram:AppliedTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate and normalize-space(ram:AppliedTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:AppliedTradeTax/ram:ExemptionReason) = $exempReasonText ]/xs:decimal(ram:AppliedAmount)) * 100) div 100), $logisticChargeAmountini in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/ rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedLogisticsServiceCharge[ ram:AppliedTradeTax/ram:CategoryCode='M' and ram:AppliedTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate ]/xs:decimal(ram:AppliedAmount)) * 100) div 100), $nblogisticCharge in xs:decimal(count(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:SpecifiedLogisticsServiceCharge[ ram:AppliedTradeTax/ram:CategoryCode='M' and ram:AppliedTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate and normalize-space(ram:AppliedTradeTax/ram:ExemptionReasonCode) = $exempReasonCode and normalize-space(ram:AppliedTradeTax/ram:ExemptionReason) = $exempReasonText ])), $nblogisticChargeini in xs:decimal(count(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ ram:ApplicableHeaderTradeSettlement/ram:SpecifiedLogisticsServiceCharge[ ram:AppliedTradeTax/ram:CategoryCode='M' and ram:AppliedTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate ])) return (abs($basisAmount - $calculatedAmountBT131 + $allowancesAmountBT92 - $chargesAmountBT99 - $logisticChargeAmount) le 0.01 * ($nbLineItems + $nbAllowancesOrCharges + $nblogisticCharge)) or (abs($basisAmount - $calculatedAmountBT131ini + $allowancesAmountBT92ini - $chargesAmountBT99ini - $logisticChargeAmountini) le 0.01 * ($nbLineItemsini + $nbAllowancesOrChargesini + $nblogisticChargeini)) )