VRBL-DES-TR-1p2-7

Basic Info

Rule If the document subtype is VRBL:TR:IDISIRSALIYE, the despatch supplier must contain a shipment number in the format SE-0000000 or ES-0000000.
Context /ubl:DespatchAdvice/cac:DespatchSupplierParty/cac:Party
Pattern vrbl-despatchadvice-tr-1p2
Severity fatal

Implementation

not(/ubl:DespatchAdvice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:DespatchAdviceExtension/vrbl:DocumentSubtypeCode = concat($VRBL-TR-Prefix, 'IDISIRSALIYE')) or count(cac:PartyIdentification/cbc:ID[@schemeID = concat($VRBL-TR-Prefix, 'SEVKIYATNO') and (starts-with(normalize-space(.), 'SE-') or starts-with(normalize-space(.), 'ES-')) and string-length(normalize-space(.)) = 10 and translate(substring(normalize-space(.), 4), $Numerics, '') = '']) > 0