diff options
Diffstat (limited to 'httemplate/elements/tr-select-cust_location.html')
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index da16dfe1c..bc3915441 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -118,7 +118,7 @@ Example: </SCRIPT> <TR> - <TH ALIGN="right">Service location</TH> + <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %></<%$th%>> <TD COLSPAN=7> <SELECT NAME="locationnum" onChange="locationnum_changed(this);"> <OPTION VALUE="">(default service address) @@ -139,6 +139,7 @@ Example: #'onchange' ? probably not 'disabled' => ( $locationnum == -1 ? '' : 'DISABLED' ), 'no_asterisks' => 1, + 'no_bold' => $opt{'no_bold'}, ) %> @@ -156,6 +157,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 $prefix = length($cust_main->ship_last) ? 'ship_' : ''; @@ -170,9 +172,15 @@ 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; } else { $cust_location->$_( $cust_main->get($prefix.$_) ) foreach @location_fields; } } +my $th = $opt{'no_bold'} ? 'TD' : 'TH'; + </%init> |