1 % if ( $cust_pkg->change_from_pkg
2 % and $cust_pkg->change_from_pkg->locationnum == $cust_pkg->locationnum)
4 % # don't show the location
6 % if ( !$opt{'cust_pkg-group_by_location'} ) {
8 <DIV STYLE="font-style: italic; font-size: small">
11 <% $loc->location_label( 'join_string' => '<BR>',
12 'double_space' => ' ',
13 'escape_function' => \&encode_entities,
14 'countrydefault' => $countrydefault,
15 'cust_main' => $opt{'cust_main'},
19 % if ( $loc->latitude && $loc->longitude ) {
22 <% $loc->latitude %>, <% $loc->longitude %>
23 <& /elements/coord-links.html, {
24 'latitude' => $loc->latitude,
25 'longitude' => $loc->longitude,
26 'name' => $opt{'cust_main'}->name_short.
27 ': '. $opt{'part_pkg'}->pkg,
28 'company_address' => $opt{'company_address'},
33 % if ( $loc->country eq 'US' ) {
34 % if ( $loc->censustract ) {
37 <% $loc->censustract %> (<% $loc->censusyear %> census)
39 % } elsif ( $opt{'cust_main-require_censustract'} ) {
41 <FONT SIZE=-1 COLOR="#ee3300">
42 <% emt('Census tract unknown') %>
50 % } # all of this is hidden if packages are grouped by location, because
51 % # it's in the top banner
53 % if ( ! $cust_pkg->get('cancel')
54 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
59 % unless ( $opt{no_links} or $opt{'change_from'} ) {
60 ( <%pkg_change_location_link($cust_pkg)%> )
62 % if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
63 ( <%pkg_edit_location_link($cust_pkg->locationnum)%> )
67 % } # if the package is a scheduled future package change without location
68 % # change, then don't show any of this at all. It's all implied by the
69 % # preceding package.
74 my $cust_pkg = $opt{'cust_pkg'};
75 my $countrydefault = $opt{'countrydefault'} || 'US';
76 my $statedefault = $opt{'statedefault'}
77 || ($countrydefault eq 'US' ? 'CA' : '');
79 my $loc = $cust_pkg->cust_location_or_main('_cache'=>$opt{cust_location_cache});
80 # dubious--they should all have a location now
81 my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
83 sub pkg_change_location_link {
85 my $pkgpart = $cust_pkg->pkgpart;
86 include( '/elements/popup_link-cust_pkg.html',
87 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
88 "address1=;address2=;city=;county=;state=$statedefault;".
89 "zip=;country=$countrydefault",
90 'label' => emt('Change location'),
91 'actionlabel' => emt('Change'),
92 'cust_pkg' => $cust_pkg,
98 sub pkg_edit_location_link {
99 my $locationnum = shift;
100 include( '/elements/popup_link.html',
101 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
102 'label' => emt('Edit location'),
103 'actionlabel' => emt('Edit'),