X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fprospect_main.pm;h=b5d51d33395b2e8e998e8bb0f357e2818162ee35;hb=a65d16767bcaa1077be0f41568a4349c9db18990;hp=079ad25619a6c77587b76acff6546569f4eec83f;hpb=8d534e61d74e561a15f0863a835cda4af639a9ea;p=freeside.git diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm index 079ad2561..b5d51d333 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -1,13 +1,14 @@ package FS::prospect_main; use strict; -use base qw( FS::o2m_Common FS::Record ); +use base qw( FS::Quotable_Mixin FS::o2m_Common FS::Record ); use vars qw( $DEBUG ); use Scalar::Util qw( blessed ); -use FS::Record qw( dbh qsearch ); #qsearchs ); +use FS::Record qw( dbh qsearch qsearchs ); use FS::agent; use FS::cust_location; use FS::contact; +use FS::qual; $DEBUG = 0; @@ -212,6 +213,9 @@ sub check { =item name +Returns a name for this prospect, as a string (company name for commercial +prospects, contact name for residential prospects). + =cut sub name { @@ -221,7 +225,7 @@ sub name { my $contact = ($self->contact)[0]; #first contact? good enough for now return $contact->line if $contact; - $self->prospectnum; + 'Prospect #'. $self->prospectnum; } =item contact @@ -243,7 +247,30 @@ Returns the locations (see L) associated with this prospect. sub cust_location { my $self = shift; - qsearch( 'cust_location', { 'prospectnum' => $self->prospectnum } ); + qsearch( 'cust_location', { 'prospectnum' => $self->prospectnum, + 'custnum' => '' } ); +} + +=item qual + +Returns the qualifications (see L) associated with this prospect. + +=cut + +sub qual { + my $self = shift; + qsearch( 'qual', { 'prospectnum' => $self->prospectnum } ); +} + +=item agent + +Returns the agent (see L) for this customer. + +=cut + +sub agent { + my $self = shift; + qsearchs( 'agent', { 'agentnum' => $self->agentnum } ); } =item search HASHREF