-my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
-push @search, "cust_event._date >= $beginning",
- "cust_event._date <= $ending";
-
-if ( $cgi->param('failed') ) {
- push @search, "statustext != ''",
- "statustext IS NOT NULL",
- "statustext != 'N/A'";
-}
-
-#if ( $cgi->param('part_event.payby') =~ /^(\w+)$/ ) {
-# push @search, "part_event.payby = '$1'";
-#}
-
-if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
- push @search, "cust_main.custnum = '$1'";
-}
-if ( $cgi->param('invnum') =~ /^(\d+)$/ ) {
- push @search, "part_event.eventtable = 'cust_bill'",
- "tablenum = '$1'";
-}
-if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
- push @search, "part_event.eventtable = 'cust_pkg'",
- "tablenum = '$1'";
+#lists
+my @lists = qw( payby eventpart );
+foreach my $param (@lists) {
+ $search{$param} = [ $cgi->param($param) ];