VRBL-INV-TR-1p2-53

Basic Info

Rule If the Invoice Type Code is VRBL:TR:IHRACKAYITLI and exemption reason code VRBL:TR:702 is used, every Invoice Line must contain a 12-character Invoice Line Shipment Goods Item Required Customs ID and an 11-character buyer line code.
Context /ubl:Invoice/cac:InvoiceLine
Pattern vrbl-invoice-tr-1p2
Severity fatal

Implementation

not(
	../cbc:InvoiceTypeCode = concat($VRBL-TR-Prefix, 'IHRACKAYITLI')
	and ../cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:TaxExemptionReasonCode = concat($VRBL-TR-Prefix, '702')
)
or boolean(cac:Delivery/cac:Shipment[
	cac:GoodsItem/cbc:RequiredCustomsID[string-length(normalize-space(.)) = 12]
	and cac:TransportHandlingUnit/cac:CustomsDeclaration/cac:IssuerParty/cac:PartyIdentification/cbc:ID[
		@schemeID = concat($VRBL-TR-Prefix, 'ALICIDIBSATIRKOD')
		and string-length(normalize-space(.)) = 11
	]
])