Was creating a redundant invoice for each user

This is not a good fix. Should be grouping by project and timesheet
instead of calling uniq