select
A.DocQueue_ID
FROM StoreDocuments A
WHERE
A.Period_ID = :Period_ID
and A.ID in (select B.Parent_ID from StoreDocuments2 B where B.RowType = 3 AND B.Store_ID = :Store_ID)
group by A.DocQueue_IDGenerated by ABRA Software a.s. 27.10.2021 16:34:11