VRBL-INV-RS-1p0-19

Basic Info

Rule When the Seller Group is Serbian, and the Seller Tax Scheme ID is "VAT", and the Invoice Type Code is "380", then the Prepayment 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:InvoicedPrepaymentAmount/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)
		)
	)
)