ALTER FUNCTION "dba"."if_tal_ravo"(in a_konto char(7),in a_talnr integer,in a_ravonr integer)
returns integer
begin
  declare li_talnr integer;
  declare ls_ravo char(16);
  set li_talnr=a_talnr;
  select ravolist.ravo into ls_ravo from ravolist where ravolist.ravonr=a_ravonr;
  if "left"(a_konto,3) in ('150','151','154','155','156','157') and "left"(a_konto,6) not in ('155920','156920') then
      if "left"(ls_ravo,2) <> '01' then
        set li_talnr=0
      end if
  end if;
  return li_talnr
end