Select '76', RightSide_ID from Relations where REL_DEF = 1019 AND LeftSide_ID = :OBJID
union Select '73', RightSide_ID from Relations where REL_DEF = 1020 AND LeftSide_ID = :OBJID
union Select '20', RightSide_ID from Relations where REL_DEF = 1021 AND LeftSide_ID = :OBJID
union Select 'CO', RightSide_ID from Relations where REL_DEF = 1022 AND LeftSide_ID = :OBJID
/* DDZLP */
UNION
SELECT '65', A.ID
FROM VATReceivedDCreditNotes A
WHERE A.Source_ID = :OBJID
/* FP */
UNION
SELECT DISTINCT '04',A.Parent_ID
FROM ReceivedInvoices2 A
WHERE A.VATDeposit_ID = :OBJID
Generated by ABRA Software a.s. 27.10.2021 16:34:12