use FS::cust_main;
use FS::contact;
use FS::qual;
+use FS::part_referral;
$DEBUG = 0;
qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
}
+=item part_referral
+
+Returns the advertising source (see L<FS::part_referral>) 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.
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
##