Třídová akce

Kód:
8
Tělo:
select
  (DQ.Code || '-' || CAST(a.OrdNumber AS VARCHAR(10)) ||'/' ||  P.Code) as DisplayName,
  FO.Name as FirmOfficeName,
  A.DocDate$Date as DocDate$Date,
  A.Duedate$Date as DueDate$Date,
  A.LocalAmount,
  A.LocalPaidAmount,
  DQ.Code,
  A.ID as ID
from IssuedDInvoices A
join DocQueues DQ on DQ.ID = A.Docqueue_Id and DQ.Documenttype = '10'
join Periods P on P.ID = A.Period_Id
join FirmOffices FO on FO.ID = A.FirmOffice_Id
where
(((A.LocalAmount>=0) and (A.LocalAmount > A.LocalPaidAmount))
or
((A.LocalAmount <0) and (A.LocalAmount < A.LocalPaidAmount)))
and (A.Firm_ID IN (SELECT x.ID FROM Firms x WHERE x.ID = :FirmOID OR x.Firm_ID = :FirmOID)) 

Generated by ABRA Software a.s. 27.10.2021 16:34:09