VRBL-INV-RS-1p0-22

Basic Info

Rule When the Seller is Serbian, and the Seller Tax Scheme Code is "VAT", and the Invoice Type Code is "380", then the Reduced Tax Subtotal Tax ID must be one of the following values: S, AE, Z, E, R, O, OE, SS, N.
Context /ubl:Invoice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:InvoiceExtension/vrbl:ReducedTotals/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory
Pattern vrbl-invoice-rs-1p0
Severity fatal

Implementation

not(
	$RSSupplierCountry = 'RS'
	and
	translate(normalize-space(cac:TaxScheme/cbc:ID), 'vat', 'VAT') = 'VAT'
	and
	$InvoiceTypeCode = '380'
)
or
(
	not(
		contains(
			normalize-space(cbc:ID),
			substring($VRBL-CL-Modified-TaxCategory, 1, 1)
		)
	)
	and
	contains(
		$VRBL-CL-Modified-TaxCategory,
		concat(
			substring($VRBL-CL-Modified-TaxCategory, 1, 1),
			normalize-space(cbc:ID),
			substring($VRBL-CL-Modified-TaxCategory, 1, 1)
		)
	)
)