BR-FR-MV-08_BT-128

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Message

[BR-FR-MV-08/BT-128] IDligne … , Raison exemption : … - Num fact ligne: … . Lorsque le cadre de facturation (BT-23) est S8, B8, M8 ou S9, B9, M9, chaque ligne (BG-25) doit contenir une raison d'exemption TVA en texte commençant par le numéro de sous-facture en ligne entre #.

Context
(ubl:Invoice/cac:InvoiceLine|cn:CreditNote/cac:CreditNoteLine)[cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID]/cac:InvoiceDocumentReference/cbc:DocumentStatusCode = 'DETAIL']
Test
not(custom:isSpecialContract(/ubl:Invoice|/cn:CreditNote)) or (normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:TaxExemptionReason) != '' and $numfact != '' and starts-with(cac:Item/cac:ClassifiedTaxCategory/cbc:TaxExemptionReason, concat('#', $numfact, '#')))

Checked with France e-invoice (UBL), France e-credit note (UBL), France EXTENDED-CTC-FR (UBL)

Message

BR-FR-MV-08/BT-128 : IDligne … , Raison exemption : … / Num fact ligne: … . Lorsque le cadre de facturation (BT-23) est S8, B8 ou M8, chaque ligne (BG-25) doit contenir une raison d'exemption TVA en texte commençant par le numéro de sous-facture en ligne entre #.

Context
rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'DETAIL']
Test
not(custom:isSpecialContract(/rsm:CrossIndustryInvoice)) or (normalize-space(./ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:ExemptionReason) != '' and $numfact != '' and starts-with(./ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:ExemptionReason, concat('#', $numfact, '#')))

Checked with France e-invoice (CII), France Factur-X EN 16931, France EXTENDED-CTC-FR (CII), France Factur-X EXTENDED, France Factur-X BASIC WL