From dda70549e974d4b559f9d5a117948b931813c7d1 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 31 May 2012 13:02:12 -0700 Subject: [PATCH] fix location selection for prospects, #940 --- FS/FS/prospect_main.pm | 3 ++- httemplate/edit/prospect_main.html | 3 +++ 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 5a4048f51..6adc852f8 100644 --- a/FS/FS/prospect_main.pm +++ b/FS/FS/prospect_main.pm @@ -244,7 +244,8 @@ Returns the locations (see L) 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 c8c8e98e1..d3985410b 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 05712ee6d..d9e3e9e27 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 -- 2.11.0