select PD.ID from POSDocuments PD join POSReceipts PR on PD.POSReceipt_ID = PR.ID where PD.Shop_ID = :Shop_ID and PD.Opened = 'N' and PD.IsPayChange = 'N' and (PD.SELLINGSTAND_ID is not null) and (PD.POSSummaredDocument_ID is null) and PR.Stoped = 'N' order by PD.OrdNumber
Generated by ABRA Software a.s. 27.10.2021 16:34:30