filter by customer class on all financial reports, #20573
[freeside.git] / httemplate / search / cust_bill_pay.html
index 22e9a67..79de749 100644 (file)
@@ -99,6 +99,13 @@ if ( $cgi->param('refnum') && $cgi->param('refnum') =~ /^(\d+)$/ ) {
   $title = $part_referral->referral. " $title";
 }
 
+if ( $cgi->param('cust_classnum') ) {
+  my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+  push @search, 'cust_main.classnum IN('.join(',',@classnums).')'
+    if @classnums;
+}
+
+
 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
 push @search, "cust_bill._date >= $beginning ",
               "cust_bill._date <= $ending";