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 ( !$conf->exists('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,
18 % if ( $loc->latitude && $loc->longitude ) {
21 <% $loc->latitude %>, <% $loc->longitude %>
22 <& /elements/coord-links.html,
25 $opt{'cust_main'}->name_short. ': '. $opt{'part_pkg'}->pkg,
26 $opt{'cust_main'}->agentnum,
30 % if ( $loc->censustract ) {
33 <% $loc->censustract %> (<% $loc->censusyear %> census)
35 % } elsif ( $conf->exists('cust_main-require_censustract') ) {
37 <FONT SIZE=-1 COLOR="#ee3300">
38 <% emt('Census tract unknown') %>
45 % } # all of this is hidden if packages are grouped by location, because
46 % # it's in the top banner
48 % if ( ! $cust_pkg->get('cancel')
49 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
54 % unless ( $opt{no_links} or $opt{'change_from'} ) {
55 ( <%pkg_change_location_link($cust_pkg)%> )
57 % if ( $cust_pkg->locationnum && ! $opt{no_links} ) {
58 ( <%pkg_edit_location_link($cust_pkg->locationnum)%> )
62 % } # if the package is a scheduled future package change without location
63 % # change, then don't show any of this at all. It's all implied by the
64 % # preceding package.
67 my $conf = new FS::Conf;
70 my $cust_pkg = $opt{'cust_pkg'};
71 my $countrydefault = $opt{'countrydefault'} || 'US';
72 my $statedefault = $opt{'statedefault'}
73 || ($countrydefault eq 'US' ? 'CA' : '');
75 my $loc = $cust_pkg->cust_location_or_main;
76 # dubious--they should all have a location now
77 my $default = $cust_pkg->locationnum == $opt{'cust_main'}->ship_locationnum;
79 sub pkg_change_location_link {
81 my $pkgpart = $cust_pkg->pkgpart;
82 include( '/elements/popup_link-cust_pkg.html',
83 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
84 "address1=;address2=;city=;county=;state=$statedefault;".
85 "zip=;country=$countrydefault",
86 'label' => emt('Change location'),
87 'actionlabel' => emt('Change'),
88 'cust_pkg' => $cust_pkg,
94 sub pkg_edit_location_link {
95 my $locationnum = shift;
96 include( '/elements/popup_link.html',
97 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
98 'label' => emt('Edit location'),
99 'actionlabel' => emt('Edit'),