SELECT COUNT(1) FROM StoreDocuments2 SD2 WHERE SD2.Parent_ID = :OBJID AND exists (select 1 from StoreDocuments2 RefundedSD2 where RefundedSD2.RDocumentRow_ID = SD2.ID)
Generated by ABRA Software a.s. 27.10.2021 16:34:11