1 APPS.Halux.PPS.TBXZaag.impl.LijstHelper %SQLQuery LijnNr:%String,All:%Boolean 0 and Batch->IsActief=1 group by Batch,SubBatch union SELECT BatchID || '||' || isnull(SubBatch,'') as BatchKey, 'L ' || BatchID || ' ' || isnull(SubBatch,'') as BatchOms,'LBX ' || BatchID || ' ' || isnull(SubBatch,'') || ' - nog ' || sum(case Zaagstatus when 'W' then 1 else 0 end) || ' van ' || count(HZUI.ID) as BatchLangeOms FROM APPS_Halux_PPS_Activiteit_impl_common_dto.HoffmannZaagUitvoeringInfo As HZUI WHERE (isnull(SubBatch,'')='' or SubBatch='Herwerk' or :All=1) AND HZUI.BatchID IN ( SELECT B.ID FROM APPS_Halux_common_impl.BatchImpl As B JOIN APPS_Halux_common_impl.BatchImpl_ToeleveringenIndex As BTI on BTI.BatchImpl = B.ID JOIN Flow_Toelev.Hoofding As Toelev on Toelev.ToeleveringsNr = BTI.element_key WHERE B.Status = 'Gestart' AND B.Categorie = 'Legrabox' GROUP BY B.ID ) GROUP BY BatchID,SubBatch union SELECT BatchID || '||' || isnull(SubBatch,'') as BatchKey, 'M ' || BatchID || ' ' || isnull(SubBatch,'') as BatchOms,'MVX ' || BatchID || ' ' || isnull(SubBatch,'') || ' - nog ' || sum(case Zaagstatus when 'W' then 1 else 0 end) || ' van ' || count(HZUI.ID) as BatchLangeOms FROM APPS_Halux_PPS_Activiteit_impl_common_dto.HoffmannZaagUitvoeringInfo As HZUI WHERE (isnull(SubBatch,'')='' or SubBatch='Herwerk' or :All=1) AND HZUI.BatchID IN ( SELECT B.ID FROM APPS_Halux_common_impl.BatchImpl As B JOIN APPS_Halux_common_impl.BatchImpl_ToeleveringenIndex As BTI on BTI.BatchImpl = B.ID JOIN Flow_Toelev.Hoofding As Toelev on Toelev.ToeleveringsNr = BTI.element_key WHERE B.Status = 'Gestart' AND B.Categorie = 'Merivobox' GROUP BY B.ID ) GROUP BY BatchID,SubBatch]]> BatchID:%Integer,SubBatch:APPS.Halux.PPS.TBXZaag.enu.SubBatch %ListOfObjects %SQLQuery BatchID:%Integer,SubBatch:APPS.Halux.PPS.TBXZaag.enu.SubBatch Select ID from APPS_Halux_PPS_TBXZaag.Opdrachten where Batch = :BatchID and isnull(SubBatch,'*')=isnull(:SubBatch,'*')