Třídová akce

Kód:
21
Tělo:
select
  max(A.store_id) as Store_ID,
  max(ST.code) as Store_Code,
  max(ST.name) as Store_Name,
  max(PD.docdate$date) as DocDate,
  max(PD.Period_ID) as Period_ID,
  max(PE.Code) as Period_Code,
  max(PE.Name) as Period_Name
from
  POSDocuments2  A
  left join POSDocuments PD on PD.id = A.parent_id
  left join stores ST on ST.id = A.store_id
  left join Periods PE on PE.ID = PD.Period_ID
where
  A.id like :SiteMask and
  A.OrderFinished = 'N' and
  ((A.orderkind = 2) and ((A.quantity<>0) or (A.orderwastequantity<>0))) and
  pd.opened='N'
group by
  A.store_id,
  PD.docdate$date

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