[2.2] Fix stock report queries Closes #6565