3 % #my $width = $show_location ? 'WIDTH="25%"' : 'WIDTH="33%"';
4 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Package') |h %></TH>
5 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Status') |h %></TH>
6 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Contact/Location') |h %></TH>
7 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Services') |h %></TH>
10 % #$FS::cust_pkg::DEBUG = 2;
11 % foreach my $cust_pkg (@$packages) {
12 <& .packagerow, $cust_pkg,
13 ( map { $_ => $opt{$_} } qw(
15 no_links before_pkg_callback before_svc_callback after_svc_callback
20 % } else { # there are no packages
25 % my ($cust_pkg, %iopt) = @_;
26 % $iopt{'cust_pkg'} = $cust_pkg;
27 % $iopt{'part_pkg'} = $cust_pkg->part_pkg;
28 <!--pkgnum: <% $cust_pkg->pkgnum %>-->
29 <TR CLASS="row<%$row % 2%>">
30 <& package.html, %iopt &>
31 <& status.html, %iopt &>
32 <TD CLASS="inv" BGCOLOR="<% $iopt{bgcolor} %>" WIDTH="20%" VALIGN="top">
33 <& contact.html, %iopt &><BR>
34 <& location.html, %iopt &>
36 <& services.html, %iopt &>
39 % # show the change target, if there is one
40 % if ( $cust_pkg->change_to_pkg ) {
41 <& .packagerow, $cust_pkg->change_to_pkg, %iopt, 'change_from' => 1 &>
43 % # include supplemental packages if any
44 % $iopt{'supplemental'} = ($iopt{'supplemental'} || 0) + 1;
45 % foreach my $supp_pkg ($cust_pkg->supplemental_pkgs) {
46 <& .packagerow, $supp_pkg, %iopt &>
55 my $conf = new FS::Conf;
57 my $curuser = $FS::CurrentUser::CurrentUser;
59 my $packages = $opt{'packages'};
61 # Sort order is hardcoded for now, can change this if needed.
63 ( $a->getfield('cancel') <=> $b->getfield('cancel') ) or
64 ( $a->getfield('setup') <=> $b->getfield('setup') ) or
65 ( $a->getfield('pkgnum') <=> $b->getfield('pkgnum') )
68 my %change_custnum = map { $_->change_custnum => 1 }
69 grep { $_->change_custnum }
70 grep { $_->getfield('cancel') }
73 my $pkg_attached = ( scalar(keys %change_custnum) == 1
74 && ! grep { ! $_->getfield('cancel') } @$packages
77 my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
80 #for services.html and status.html
81 'cust_pkg-display_times' => ($conf->exists('cust_pkg-display_times')
82 || $curuser->option('cust_pkg-display_times')),
84 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
85 'pkg_attached' => $pkg_attached,
86 #for status.html pkg-balances
87 'pkg-balances' => $conf->exists('pkg-balances'),
88 'money_char' => ( $conf->config('money_char') || '$' ),
91 'countrydefault' => $countrydefault,
92 'statedefault' => ( scalar($conf->config('statedefault'))
93 || ($countrydefault eq 'US' ? 'CA' : '') ),
95 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
96 'legacy_link' => $conf->exists('legacy_link'),
97 'manage_link' => scalar($conf->config('svc_broadband-manage_link')),
98 'manage_link_text' => scalar($conf->config('svc_broadband-manage_link_text')),
99 'manage_link_loc' => scalar($conf->config('svc_broadband-manage_link_loc')),
100 'manage_link-new_window' => $conf->exists('svc_broadband-manage_link-new_window'),
101 'cust_pkg-large_pkg_size' => scalar($conf->config('cust_pkg-large_pkg_size')),