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,
22 $opt{'cust_main'}->agentnum,
27 % unless ( $cust_pkg->locationnum ) {
31 % if ( ! $cust_pkg->get('cancel')
32 % && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
37 ( <%pkg_change_location_link($cust_pkg)%> )
38 % if ( $cust_pkg->locationnum ) {
39 ( <%edit_location_link($cust_pkg->locationnum)%> )
47 my $conf = new FS::Conf;
50 my $bgcolor = $opt{'bgcolor'};
51 my $cust_pkg = $opt{'cust_pkg'};
52 my $countrydefault = $opt{'countrydefault'} || 'US';
53 my $statedefault = $opt{'statedefault'}
54 || ($countrydefault eq 'US' ? 'CA' : '');
56 my $loc = $cust_pkg->cust_location_or_main;
58 sub pkg_change_location_link {
60 my $pkgpart = $cust_pkg->pkgpart;
61 include( '/elements/popup_link-cust_pkg.html',
62 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
63 "address1=;address2=;city=;county=;state=$statedefault;".
64 "zip=;country=$countrydefault",
65 'label' => emt('Change location'),
66 'actionlabel' => emt('Change'),
67 'cust_pkg' => $cust_pkg,
71 sub edit_location_link {
72 my $locationnum = shift;
73 include( '/elements/popup_link.html',
74 'action' => $p. "edit/cust_location.cgi?locationnum=$locationnum",
75 'label' => emt('Edit location'),
76 'actionlabel' => emt('Edit'),