Procedura-PosSearchOrders

Parametry:

NázevPopisDatový typ
user_idChar(10)
shop_idChar(10)
station_idChar(10)

Návratové hodnoty:

NázevPopisDatový typ
iidChar(10)
istorecodeChar(10)
iprinternumberChar(10)

Tělo:

begin
  for
    select PD2.id, st.code, op.printernumber
    from
      posdocuments2 PD2
      left join posdocuments PD on pd.id=pd2.Parent_ID
      left join stores st on st.id=pd2.store_id
      left join storecards sc on sc.id=pd2.storecard_id
      left join storecardcategories scc on scc.id=sc.storecardcategory_id
      left join posstations3 op on (op.parent_id=:station_id) and (op.storecardcategory_id=sc.storecardcategory_id)
    where
      (pd2.OrderPrintState=1) and
      (pd2.OrderCreatedBy_ID=:user_id) and
      (pd.Shop_ID=:shop_id)
    into
      :iId, :istorecode,:iprinternumber
  do begin
    if (:iprinternumber is null) then
       iprinternumber = 'LPT1' ;
    suspend;
  end
end;

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