-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'";
-}
-
-#here is the agent virtualization
-push @search, $curuser->agentnums_sql( 'table' => 'cust_main' );
-
-my $where = 'WHERE '. join(' AND ', @search );