X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fprospect_main.pm;h=76faf0f2c00cc3cd03a1839d007302dff72f1485;hb=e2a9dcac3b97254fc0a64ce3e2bf1ce582ce8162;hp=9472996935b5a82aefee9bfd2bc7b7a06d0a23f7;hpb=6452a4779e14c03a9f48bcbc68eef25c0391e93e;p=freeside.git diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm index 947299693..76faf0f2c 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -270,8 +270,11 @@ sub name { my $self = shift; return $self->company if $self->company; - my $contact = ($self->prospect_contact)[0]->contact; #first contact? good enough for now - return $contact->line if $contact; + my $prospect_contact = ($self->prospect_contact)[0]; #first contact? good enough for now + my $contact = $prospect_contact->contact if $prospect_contact; + return $contact->line if $prospect_contact && $contact; + + #address? 'Prospect #'. $self->prospectnum; } @@ -403,15 +406,18 @@ sub search { my @where = (); my $orderby; - ## - # parse agent - ## - + #agent if ( $params->{'agentnum'} =~ /^(\d+)$/ and $1 ) { push @where, "prospect_main.agentnum = $1"; } + #refnum + if ( $params->{'refnum'} =~ /^(\d+)$/ and $1 ) { + push @where, + "prospect_main.refnum = $1"; + } + ## # setup queries, subs, etc. for the search ##