select SUM(PO2.Amount) from PaymentOrders2 PO2 join PaymentOrders3 PO3 on PO3.Parent_ID = PO2.ID where PO2.BDocument_ID is null and PO2.IsNotOk = 'N' and :PDocument_ID = PO3.PDocument_id and :PDocumentType = PO3.PDocumentType
Generated by ABRA Software a.s. 27.10.2021 16:34:10