1 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>" WIDTH="20%">
3 % unless ( $cust_pkg->locationnum ) {
4 <I><FONT SIZE=-1>(<% mt('default service address') |h %>)</FONT><BR>
7 <% $loc->location_label( 'join_string' => '<BR>',
8 'double_space' => ' ',
9 'escape_function' => \&encode_entities,
10 'countrydefault' => $countrydefault,
14 % if ( $loc->latitude && $loc->longitude ) {
17 <% $loc->latitude %>, <% $loc->longitude %>
18 <& /elements/coord-links.html,
21 $opt{'cust_main'}->name_short. ': '. $opt{'part_pkg'}->pkg
26 % unless ( $cust_pkg->locationnum ) {
30 % if ( ! $cust_pkg->get('cancel')
31 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
36 ( <%pkg_change_location_link($cust_pkg)%> )
37 % if ( $cust_pkg->locationnum ) {
38 ( <%edit_location_link($cust_pkg->locationnum)%> )
46 my $conf = new FS::Conf;
49 my $bgcolor = $opt{'bgcolor'};
50 my $cust_pkg = $opt{'cust_pkg'};
51 my $countrydefault = $opt{'countrydefault'} || 'US';
52 my $statedefault = $opt{'statedefault'}
53 || ($countrydefault eq 'US' ? 'CA' : '');
55 my $loc = $cust_pkg->cust_location_or_main;
57 sub pkg_change_location_link {
59 my $pkgpart = $cust_pkg->pkgpart;
60 include( '/elements/popup_link-cust_pkg.html',
61 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
62 "address1=;address2=;city=;county=;state=$statedefault;".
63 "zip=;country=$countrydefault",
64 'label' => emt('Change location'),
65 'actionlabel' => emt('Change'),
66 'cust_pkg' => $cust_pkg,
70 sub edit_location_link {
71 my $locationnum = shift;
72 include( '/elements/popup_link.html',
73 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
74 'label' => emt('Edit location'),
75 'actionlabel' => emt('Edit'),