diff options
author | Mark Wells <mark@freeside.biz> | 2012-05-31 13:02:12 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-05-31 13:02:12 -0700 |
commit | dda70549e974d4b559f9d5a117948b931813c7d1 (patch) | |
tree | d501b26fa6c56ef33f312411eae7e711310de992 | |
parent | 4daa22e234bec170832b893cc8d038e9d2aca6ea (diff) |
fix location selection for prospects, #940
-rw-r--r-- | FS/FS/prospect_main.pm | 3 | ||||
-rw-r--r-- | httemplate/edit/prospect_main.html | 3 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/prospect_main.pm b/FS/FS/prospect_main.pm index 5a4048f..6adc852 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -244,7 +244,8 @@ 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 diff --git a/httemplate/edit/prospect_main.html b/httemplate/edit/prospect_main.html index c8c8e98..d398541 100644 --- a/httemplate/edit/prospect_main.html +++ b/httemplate/edit/prospect_main.html @@ -36,6 +36,9 @@ 'empty_label' => 'No address', 'disable_empty' => $conf->exists('prospect_main-location_required'), 'alt_format' => $conf->exists('prospect_main-alt_address_format'), + 'include_opt_callback' => sub { + 'prospect_main' => shift + }, }, ], 'new_callback' => $new_callback, diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index 05712ee..d9e3e9e 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -287,7 +287,7 @@ my $location_sort = sub { or lc($a->address2) cmp lc($b->address2) }; -my @cust_location = (); +my @cust_location; push @cust_location, $cust_main->cust_location if $cust_main; push @cust_location, $prospect_main->cust_location if $prospect_main; push @cust_location, $cust_location |