X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fprospect_main.pm;h=a6b593d56b42fa3856078a020c1f3dbdbd93104d;hb=84b2a1dfba27bc67cb2ff3004cb3885e5b0d5966;hp=1c47a80c2ab571ef109f1529fee6bc7e315e4888;hpb=c776d3d0b3ebcdddcb42ed3476e4047fd9c90a9b;p=freeside.git diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm index 1c47a80c2..a6b593d56 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -11,6 +11,7 @@ use FS::cust_location; use FS::cust_main; use FS::contact; use FS::qual; +use FS::part_referral; $DEBUG = 0; @@ -323,6 +324,17 @@ sub agent { qsearchs( 'agent', { 'agentnum' => $self->agentnum } ); } +=item part_referral + +Returns the advertising source (see L) for this customer. + +=cut + +sub part_referral { + my $self = shift; + qsearchs( 'part_referral', { 'refnum' => $self->refnum } ); +} + =item convert_cust_main Converts this prospect to a customer. @@ -394,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 ##