SELECT tetel.*, (SELECT nev||' ('||telepules||')' FROM partner WHERE kod = tetel.Jellemzo_beszallito) as Jellemzo_beszallito_nev_pre
  , 0.00 as keszlet, 0.00 as szabad, 0.00 as foglalt, 0.00 as rendelt





  FROM tetel

  where (tetel.kod <> 0)




  





   and ( (hasznalatban = 1) or (hasznalatban = 2) or (hasznalatban = 3) )
  and ( ((SELECT SUM(szabad) FROM tetel_raktar WHERE tetel_kod = tetel.kod) > 0) OR (tetel.tetel_tipus in (0,7,8,9)) )
  order by Lang_0000040E ASC
  LIMIT 25
