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 % # include supplemental packages if any
40 % $iopt{'supplemental'} = ($iopt{'supplemental'} || 0) + 1;
41 % foreach my $supp_pkg ($cust_pkg->supplemental_pkgs) {
42 <& .packagerow, $supp_pkg, %iopt &>
51 my $conf = new FS::Conf;
53 my $curuser = $FS::CurrentUser::CurrentUser;
55 my $packages = $opt{'packages'};
57 # Sort order is hardcoded for now, can change this if needed.
59 ( $a->getfield('cancel') <=> $b->getfield('cancel') ) or
60 ( $a->getfield('setup') <=> $b->getfield('setup') ) or
61 ( $a->getfield('pkgnum') <=> $b->getfield('pkgnum') )
64 my %change_custnum = map { $_->change_custnum => 1 }
65 grep { $_->change_custnum }
66 grep { $_->getfield('cancel') }
69 my $pkg_attached = ( scalar(keys %change_custnum) == 1
70 && ! grep { ! $_->getfield('cancel') } @$packages
73 my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
76 #for services.html and status.html
77 'cust_pkg-display_times' => ($conf->exists('cust_pkg-display_times')
78 || $curuser->option('cust_pkg-display_times')),
80 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
81 'pkg_attached' => $pkg_attached,
82 #for status.html pkg-balances
83 'pkg-balances' => $conf->exists('pkg-balances'),
84 'money_char' => ( $conf->config('money_char') || '$' ),
87 'countrydefault' => $countrydefault,
88 'statedefault' => ( scalar($conf->config('statedefault'))
89 || ($countrydefault eq 'US' ? 'CA' : '') ),
91 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
92 'legacy_link' => $conf->exists('legacy_link'),
93 'manage_link' => scalar($conf->config('svc_broadband-manage_link')),
94 'manage_link_text' => scalar($conf->config('svc_broadband-manage_link_text')),
95 'manage_link_loc' => scalar($conf->config('svc_broadband-manage_link_loc')),
96 'manage_link-new_window' => $conf->exists('svc_broadband-manage_link-new_window'),
97 'cust_pkg-large_pkg_size' => scalar($conf->config('cust_pkg-large_pkg_size')),