Select SD2.ID from StoreDocuments2 SD2 left join StoreDocuments SD on (SD2.parent_id = SD.ID) where SD.DocumentType = '28' and SD2.storecard_id = :StoreCard_ID and SD2.store_id = :Store_id and SD2.ClosingOrder <> 0 order by SD2.ClosingOrder Desc, SD2.ClosingIndex Desc
Generated by ABRA Software a.s. 27.10.2021 16:34:10