fix multiple-agent virtualization properly for these reports
[freeside.git] / httemplate / search / report_receivables.cgi
index ac94e1a..c1a239f 100755 (executable)
@@ -92,6 +92,9 @@ END
     $where .= " AND agentnum = '$agentnum' ";
   }
 
+  #here is the agent virtualization
+  $where .= ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql;
+
   my $count_sql = "select count(*) from cust_main $where";
 
   my $sql_query = {