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 % if (!$opt{no_services}) {
8 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Services') |h %></TH>
12 % #$FS::cust_pkg::DEBUG = 2;
13 % foreach my $cust_pkg (@$packages) {
14 % # if requested, this can override cust_pkg-group_by_location
15 <& .packagerow, $cust_pkg,
17 ( map { $_ => $opt{$_} } qw(
18 cust_main bgcolor no_links cust_location_cache
19 before_pkg_callback before_svc_callback after_svc_callback
20 cust_pkg-group_by_location
24 'has_cust_payby_auto' => $opt{cust_main}->has_cust_payby_auto,
27 % } else { # there are no packages
32 % my ($cust_pkg, %iopt) = @_;
33 % $iopt{'cust_pkg'} = $cust_pkg;
34 % $iopt{'part_pkg'} = $cust_pkg->part_pkg;
35 <!--pkgnum: <% $cust_pkg->pkgnum %>-->
36 <TR CLASS="row<%$row % 2%>">
37 <& package.html, %iopt &>
38 <& status.html, %iopt &>
39 <TD CLASS="inv" BGCOLOR="<% $iopt{bgcolor} %>" WIDTH="20%" VALIGN="top">
40 <& contact.html, %iopt &>
41 <& location.html, %iopt &>
43 % if (!$iopt{no_services}) {
44 <& services.html, %iopt &>
47 % # insert hidden predecessors to this package, if any
48 % # and a rolldown button to show them
49 % # (we'll make it do something later)
50 % if ( $cust_pkg->get('changed_from_pkg') ) {
51 <TR CLASS="row<% $row % 2 %>">
53 <BUTTON CLASS="rolldown_button"
54 ID="rolldown_<% $cust_pkg->change_pkgnum %>">
57 % # the hidden block here has ID="cust_pkgX" where X is the first pkgnum
59 <& hidden.html, $cust_pkg->get('changed_from_pkg'),
61 'next_pkg' => $cust_pkg,
67 % # show the change target, if there is one
68 % if ( $cust_pkg->change_to_pkg ) {
69 <& .packagerow, $cust_pkg->change_to_pkg, %iopt, 'change_from' => 1 &>
71 % # include supplemental packages if any
72 % $iopt{'supplemental'} = ($iopt{'supplemental'} || 0) + 1;
73 % foreach my $supp_pkg ($cust_pkg->supplemental_pkgs) {
74 <& .packagerow, $supp_pkg, %iopt &>
83 my $conf = new FS::Conf;
85 my $curuser = $FS::CurrentUser::CurrentUser;
87 my $packages = $opt{'packages'};
89 # Sort order is hardcoded for now, can change this if needed.
91 ( $a->getfield('cancel') <=> $b->getfield('cancel') ) or
92 ( $a->getfield('setup') <=> $b->getfield('setup') ) or
93 ( $a->getfield('pkgnum') <=> $b->getfield('pkgnum') )
96 my %change_custnum = map { $_->change_custnum => 1 }
97 grep { $_->change_custnum }
98 grep { $_->getfield('cancel') }
101 my $pkg_attached = ( scalar(keys %change_custnum) == 1
102 && ! grep { ! $_->getfield('cancel') } @$packages
105 my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
109 'invoice-unitprice' => $conf->exists('invoice-unitprice'),
110 'show_pkgnum' => $curuser->option('show_pkgnum'),
111 'part_pkg-term_discounts' => $conf->exists('part_pkg-term_discounts'),
113 #for services.html and status.html
114 'cust_pkg-display_times' => ($conf->exists('cust_pkg-display_times')
115 || $curuser->option('cust_pkg-display_times')),
117 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
118 'pkg_attached' => $pkg_attached,
119 'part_pkg-delay_cancel-days' => $conf->config('part_pkg-delay_cancel-days') || 1,
120 #for status.html pkg-balances
121 'pkg-balances' => $conf->exists('pkg-balances'),
122 'money_char' => ( $conf->config('money_char') || '$' ),
125 'countrydefault' => $countrydefault,
126 'statedefault' => ( scalar($conf->config('statedefault'))
127 || ($countrydefault eq 'US' ? 'CA' : '') ),
128 'cust_pkg-group_by_location'=> $conf->exists('cust_pkg-group_by_location'),
129 'cust_main-require_censustract'=> $conf->exists('cust_main-require_censustract'),
130 'company_address' => [ $conf->config('company_address', $opt{cust_main}->agentnum ) ],
133 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
134 'svc_phone-bulk_provision_simple' => $conf->exists('svc_phone-bulk_provision_simple'),
135 'legacy_link' => $conf->exists('legacy_link'),
136 'manage_link' => scalar($conf->config('svc_broadband-manage_link')),
137 'manage_link_text' => scalar($conf->config('svc_broadband-manage_link_text')),
138 'manage_link_loc' => scalar($conf->config('svc_broadband-manage_link_loc')),
139 'manage_link-new_window' => $conf->exists('svc_broadband-manage_link-new_window'),
140 'cust_pkg-large_pkg_size' => scalar($conf->config('cust_pkg-large_pkg_size')),
141 'cust_pkg-hide_discontinued-part_svc' => $conf->exists('cust_pkg-hide_discontinued-part_svc'),