-function get_sql_for_work_orders($outstanding_only, $stock_id, $location = ALL_TEXT, $order = '', $overdue = false)
+function get_sql_for_work_orders($outstanding_only, $stock_id, $location = ALL_TEXT, $order_no='', $order_ref = '', $overdue = false)