SELECT 1
FROM StoreDocuments SD
WHERE
SD.ID =:OBJID AND EXISTS(
SELECT SD2.ID FROM StoreDocuments2 SD2
WHERE
(SD2.Parent_ID = SD.ID) AND
(SD2.ProvideRowType = 'RO' OR SD2.DeliveredQuantity > 0)
)Generated by ABRA Software a.s. 27.10.2021 16:34:11