diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Schema.pm | 8 | ||||
-rw-r--r-- | FS/FS/prospect_main.pm | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 2bfe11a08..6d4fb03d9 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 78e865a7e..079ad2561 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 |