X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fprospect_main.pm;h=a963feeb9f7d7f45e05a1a4341fe28c52174a507;hb=9bca6157d6ae81eaacb4eee93757d700240a6de7;hp=079ad25619a6c77587b76acff6546569f4eec83f;hpb=8d534e61d74e561a15f0863a835cda4af639a9ea;p=freeside.git diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm index 079ad2561..a963feeb9 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -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; @@ -207,6 +208,12 @@ sub check { ; return $error if $error; + my $company = $self->company; + $company =~ s/^\s+//; + $company =~ s/\s+$//; + $company =~ s/\s+/ /g; + $self->company($company); + $self->SUPER::check; } @@ -221,7 +228,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 @@ -246,6 +253,18 @@ sub cust_location { qsearch( 'cust_location', { 'prospectnum' => $self->prospectnum } ); } +=item qual + +Returns the qualifications (see L) associated with this prospect. + +=cut + +sub qual { + my $self = shift; + qsearch( 'qual', { 'prospectnum' => $self->prospectnum } ); +} + + =item search HASHREF (Class method)