correct invoice package address display and reduce false laziness
[freeside.git] / httemplate / view / cust_main / packages / location.html
1 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
2
3 % unless ( $cust_pkg->locationnum ) {
4   <I><FONT SIZE=-1>(default service address)</FONT><BR>
5 % }
6
7   <% $loc->location_label( 'join_string' => '<BR>',
8                            'escape_function' => \&encode_entities,
9                          )
10   %>
11
12   </I>
13
14 % if ( ! $cust_pkg->get('cancel')
15 %      && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
16 %    )
17 % {
18   <FONT SIZE=-1>
19     (&nbsp;<%pkg_change_location_link($cust_pkg)%>&nbsp;)
20   </FONT>
21 % } 
22
23 </TD>
24 <%init>
25
26 my %opt = @_;
27
28 my $bgcolor        = $opt{'bgcolor'};
29 my $cust_pkg       = $opt{'cust_pkg'};
30 my $countrydefault = $opt{'countrydefault'} || 'US';
31 my $statedefault   = $opt{'statedefault'}
32                      || ($countrydefault eq 'US' ? 'CA' : '');
33
34 my $loc = $cust_pkg->cust_location_or_main;
35
36 sub pkg_change_location_link {
37   my $cust_pkg = shift;
38   my $pkgpart = $cust_pkg->pkgpart;
39   include( '/elements/popup_link-cust_pkg.html',
40     'action'      => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
41                      "address1=;address2=;city=;county=;state=$statedefault;".
42                      "zip=;country=$countrydefault",
43     'label'       => 'Change&nbsp;location',
44     'actionlabel' => 'Change',
45     'cust_pkg'    => $cust_pkg,
46   );
47 }
48
49 </%init>