Message

In an Invoice with a VAT breakdown (BG-23) where the VAT category code (BT-118) is "Intra-community supply" the Actual delivery date (BT-72) or the Invoicing period (BG-14) shall not be blank.

Context
/ubl:Invoice | /cn:CreditNote
Test
(exists(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'K']) and (string-length(cac:Delivery/cbc:ActualDeliveryDate) > 1 or (cac:InvoicePeriod/*))) or (not(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'K']))
Usage
/ ubl:Invoice / cac:InvoicePeriod
/ ubl:Invoice / cac:Delivery / cbc:ActualDeliveryDate
/ ubl:CreditNote / cac:InvoicePeriod
/ ubl:CreditNote / cac:Delivery / cbc:ActualDeliveryDate