sales by ad source report: filter by ad source, #17971
[freeside.git] / httemplate / search / cust_bill_pkg_referral.html
index 3cb434c..77b4860 100644 (file)
@@ -146,6 +146,16 @@ if ( @status_where ) {
     ') IN (' . join(',', @status_where) .')';
 }
 
+my @refnum;
+foreach my $refnum ($cgi->param('refnum')) {
+  if ( $refnum =~ /^\d+$/ ) {
+    push @refnum, $refnum;
+  }
+}
+if ( @refnum ) {
+  push @where, 'cust_main.refnum IN ('.join(',', @refnum).')';
+}
+
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   push @where, "cust_main.agentnum = $1";
 }