Fixed invalid SQL query in order history module
Spinner icon did not show in "loading data" message
TypeAgent must use HAVING instead of WHERE, because type can be custom select