Der XPath gruppiert Rechnungspositionen, Abschläge, Zuschläge und Logistik-Servicegebühren nach Steuersatz sowie Befreiungsgrund und -code. Er vergleicht deren saldierten Betrag mit ram:BasisAmount; die Toleranz beträgt 0,01 multipliziert mit der Anzahl der berücksichtigten Beträge.
Wo die Regel greift
Die Regel gilt für die Umsatzsteueraufschlüsselung ram:ApplicableTradeTax auf Ebene der Abrechnung, wenn ram:CategoryCode den Wert Z und ram:TypeCode den Wert VAT hat.
Originalmeldung aus dem Schematron
- In a VAT breakdown (BG-23) where VAT category code (BT-118) is equal to “Z” ("Zero Rated"), 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 "Zero Rated" (Z).
Kontext (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='Z'][upper-case(ram:TypeCode) = 'VAT']
Prüfausdruck (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 = 'Z'
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),
$allowancesAmountBT92 in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/
ram:SpecifiedTradeAllowanceCharge[
ram:ChargeIndicator/udt:Indicator=false()
and ram:CategoryTradeTax/ram:CategoryCode='Z'
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),
$chargesAmountBT99 in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/
ram:SpecifiedTradeAllowanceCharge[
ram:ChargeIndicator/udt:Indicator=true()
and ram:CategoryTradeTax/ram:CategoryCode='Z'
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),
$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 = 'Z'
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
])),
$nbAllowancesOrCharges in xs:decimal(count(/rsm:CrossIndustryInvoice/
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/
ram:SpecifiedTradeAllowanceCharge[
ram:CategoryTradeTax/ram:CategoryCode='Z'
and ram:CategoryTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate
and normalize-space(ram:CategoryTradeTax/ram:ExemptionReasonCode) = $exempReasonCode
and normalize-space(ram:CategoryTradeTax/ram:ExemptionReason) = $exempReasonText
])),
$logisticChargeAmount in xs:decimal(round(sum(/rsm:CrossIndustryInvoice/
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/
ram:SpecifiedLogisticsServiceCharge[
ram:AppliedTradeTax/ram:CategoryCode='Z'
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),
$nblogisticCharge in xs:decimal(count(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/
ram:ApplicableHeaderTradeSettlement/ram:SpecifiedLogisticsServiceCharge[
ram:AppliedTradeTax/ram:CategoryCode='Z'
and ram:AppliedTradeTax/xs:decimal(ram:RateApplicablePercent)=$rate
and normalize-space(ram:AppliedTradeTax/ram:ExemptionReasonCode) = $exempReasonCode
and normalize-space(ram:AppliedTradeTax/ram:ExemptionReason) = $exempReasonText
]))
return abs($basisAmount - $calculatedAmountBT131 + $allowancesAmountBT92 - $chargesAmountBT99 - $logisticChargeAmount) le 0.01 * ($nbLineItems + $nbAllowancesOrCharges + $nblogisticCharge)
)