+push @search, "cust_bill_event._date >= $beginning",
+ "cust_bill_event._date <= $ending";
+
+if ( $cgi->param('failed') ) {
+ push @search, "statustext != ''",
+ "statustext IS NOT NULL",
+ "statustext != 'N/A'";
+}
+
+if ( $cgi->param('part_bill_event.payby') =~ /^(\w+)$/ ) {
+ push @search, "part_bill_event.payby = '$1'";
+}