improvements to stock reporting status map report

http://manage.dimagi.com/default.asp?149773
I refactored this query to just return the form IDs. I think it should also reduce the number of queries since fetching the report for each transaction was running a separate query.

Added `distinct` to get rid of any duplicate form_ids (if any)