VRBL-INV-IN-1p0-88

Basic Info

Rule The value of the Buyer Place of Supply must be contained in State Code (defined by GST) [VRBL-CL-IN-CountrySubentityCode] (prefixed by 'VRBL:IN:') or be contained in Place of supply code outside India [VRBL-CL-IN-PlaceOfSupply-Outside] (prefixed by 'VRBL:IN:').
Context /ubl:Invoice/cac:AccountingCustomerParty/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:AccountingCustomerPartyExtension/vrbl:PlaceOfSupply
Pattern vrbl-invoice-in-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-IN-Prefix:$VRBL-CL-IN-CountrySubentityCode or $VRBL-IN-Prefix:$VRBL-CL-IN-PlaceOfSupply-Outside

Implementation

not(boolean(.))
or
(
	(
		substring(normalize-space(.), 1, string-length($VRBL-IN-Prefix)) = $VRBL-IN-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(.), $VRBL-IN-Prefix),
				substring($VRBL-CL-IN-CountrySubentityCode, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-IN-CountrySubentityCode,
			concat(
				substring($VRBL-CL-IN-CountrySubentityCode, 1, 1),
				substring-after(normalize-space(.), $VRBL-IN-Prefix),
				substring($VRBL-CL-IN-CountrySubentityCode, 1, 1)
			)
		)
	)
)
or
(
	(
		substring(normalize-space(.), 1, string-length($VRBL-IN-Prefix)) = $VRBL-IN-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(.), $VRBL-IN-Prefix),
				substring($VRBL-CL-IN-PlaceOfSupply-Outside, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-IN-PlaceOfSupply-Outside,
			concat(
				substring($VRBL-CL-IN-PlaceOfSupply-Outside, 1, 1),
				substring-after(normalize-space(.), $VRBL-IN-Prefix),
				substring($VRBL-CL-IN-PlaceOfSupply-Outside, 1, 1)
			)
		)
	)
)