X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-cust_location.html;h=f06ea0ffe01e695644771ce070595c43d242edb3;hb=e574b96088606fe1624223d977e8091b9eab0600;hp=f26649763a1bc7fb71a1e7f51c6b5312dab03009;hpb=9e570867c27b5336f4fa701c84b70fd65791f87c;p=freeside.git diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index f26649763..f06ea0ffe 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -187,6 +187,7 @@ my $statedefault = $conf->config('statedefault') my %opt = @_; my $cgi = $opt{'cgi'}; +my $cust_pkg = $opt{'cust_pkg'}; my $cust_main = $opt{'cust_main'}; my $prospect_main = $opt{'prospect_main'}; @@ -213,6 +214,10 @@ if ( $locationnum && $locationnum != -1 ) { $cust_location = new FS::cust_location; if ( $locationnum == -1 ) { $cust_location->$_( $cgi->param($_) ) foreach @location_fields; + } elsif ( $cust_pkg && $cust_pkg->locationnum ) { + my $pkg_location = $cust_pkg->cust_location; + $cust_location->$_( $pkg_location->$_ ) foreach @location_fields; + $opt{'empty_label'} ||= 'package address: '.$pkg_location->line; } elsif ( $cust_main ) { $cust_location->$_( $cust_main->get($prefix.$_) ) foreach @location_fields; }