- if ( $param->{'agentnum'} && $param->{'agentnum'} =~ /^(\d+)$/ ) {
- push @search, "cust_main.agentnum = $1";
- #my $agent = qsearchs('agent', { 'agentnum' => $1 } );
- #die "unknown agentnum $1" unless $agent;
+ #eventpart
+ my @eventpart = ref($param->{'eventpart'})
+ ? @{ $param->{'eventpart'} }
+ : split(',', $param->{'eventpart'});
+ @eventpart = grep /^(\d+)$/, @eventpart;
+ if ( @eventpart ) {
+ push @search, 'eventpart IN ('. join(',', @eventpart). ')';