select * from ( select DISTINCT CR.id, cr.docdate$date as docdate, PA.pdocument_id, cr.varsymbol, PA.documenttype, PA.pdocumenttype from poscashreceived CR join payments PA on CR.ID=PA.document_id where CR.accdate$date=:DocDate and CR.receipttype='N' and PA.documenttype='CR' UNION select DISTINCT CP.id, cp.docdate$date as docdate, PA.pdocument_id, cp.varsymbol, pa.documenttype, pa.pdocumenttype from poscashpaid CP join payments PA on CP.ID=PA.document_id where CP.accdate$date=:DocDate and CP.paidtype='F' and PA.documenttype='CP') px order by px.docdate
Generated by ABRA Software a.s. 27.10.2021 16:34:30