[freeside-commits] freeside/FS/FS qual.pm,1.4,1.5
Erik Levinson
levinse at wavetail.420.am
Sun Dec 5 22:36:03 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15417/FS/FS
Modified Files:
qual.pm
Log Message:
-tr-select-cust_location.html and elements/location.html: optionally support alternate address format and
optional address
-nearly finished qualifications, RT7111
Index: qual.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/qual.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- qual.pm 1 Dec 2010 05:56:09 -0000 1.4
+++ qual.pm 6 Dec 2010 06:36:01 -0000 1.5
@@ -143,8 +143,31 @@
'';
}
-sub status_long {
+sub cust_or_prospect {
+ my $self = shift;
+ if ( $self->locationnum ) {
+ my $l = qsearchs( 'cust_location',
+ { 'locationnum' => $self->locationnum });
+ return qsearchs('cust_main',{ 'custnum' => $l->custnum })
+ if $l->custnum;
+ return qsearchs('prospect_main',{ 'prospectnum' => $l->prospectnum })
+ if $l->prospectnum;
+ }
+ return qsearchs('cust_main', { 'custnum' => $self->custnum })
+ if $self->custnum;
+ return qsearchs('prospect_main', { 'prospectnum' => $self->prospectnum })
+ if $self->prospectnum;
+}
+sub status_long {
+ my $self = shift;
+ my $s = {
+ 'Q' => 'Qualified',
+ 'D' => 'Does not Qualify',
+ 'N' => 'New',
+ };
+ return $s->{$self->status} if defined $s->{$self->status};
+ return 'Unknown';
}
=back
More information about the freeside-commits
mailing list