merging RT 4.0.6
[freeside.git] / FS / FS / prospect_main.pm
index 079ad25..6adc852 100644 (file)
@@ -8,6 +8,7 @@ use FS::Record qw( dbh qsearch ); #qsearchs );
 use FS::agent;
 use FS::cust_location;
 use FS::contact;
+use FS::qual;
 
 $DEBUG = 0;
 
@@ -221,7 +222,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,9 +244,22 @@ Returns the locations (see L<FS::cust_location>) 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<FS::qual>) associated with this prospect.
+
+=cut
+
+sub qual {
+  my $self = shift;
+  qsearch( 'qual', { 'prospectnum' => $self->prospectnum } );
+}
+
+
 =item search HASHREF
 
 (Class method)