summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2011-03-21 00:55:12 +0000
committerivan <ivan>2011-03-21 00:55:12 +0000
commit8d534e61d74e561a15f0863a835cda4af639a9ea (patch)
treeca0f3939c9e663a41d7ca64d1e3d95411aa68057 /FS/FS
parent88fdb01339ae2b598b29c8033f31a50d46e44cad (diff)
residential prospects, RT#7111
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Schema.pm8
-rw-r--r--FS/FS/prospect_main.pm9
2 files changed, 12 insertions, 5 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 2bfe11a..6d4fb03 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -982,12 +982,14 @@ sub tables_hashref {
'columns' => [
'prospectnum', 'serial', '', '', '', '',
'agentnum', 'int', '', '', '', '',
- 'company', 'varchar', '', $char_d, '', '',
- #'disabled', 'char', 'NULL', 1, '', '',
+ 'company', 'varchar', 'NULL', $char_d, '', '',
+ 'add_date', @date_type, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ 'custnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'prospectnum',
'unique' => [],
- 'index' => [ [ 'company' ], [ 'agentnum' ], ],
+ 'index' => [ [ 'company' ], [ 'agentnum' ], [ 'disabled' ] ],
},
#eventually use for billing & ship from cust_main too
diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm
index 78e865a..079ad25 100644
--- a/FS/FS/prospect_main.pm
+++ b/FS/FS/prospect_main.pm
@@ -203,7 +203,7 @@ sub check {
my $error =
$self->ut_numbern('prospectnum')
|| $self->ut_foreign_key('agentnum', 'agent', 'agentnum' )
- || $self->ut_text('company')
+ || $self->ut_textn('company')
;
return $error if $error;
@@ -216,7 +216,12 @@ sub check {
sub name {
my $self = shift;
- $self->company; #at least until this is nullable
+ return $self->company if $self->company;
+
+ my $contact = ($self->contact)[0]; #first contact? good enough for now
+ return $contact->line if $contact;
+
+ $self->prospectnum;
}
=item contact