getorders function processing