vertical-align: top;
border-width: 0;
border-style: solid;
- border-color: #bbbbff;
}
table.package {
border: none;
.row1 { background-color: #ffffff; }
</STYLE>
-% my $s = 0;
+
+% unless ( $opt{no_links} ) {
+
+% my $s = 0;
% if ( $curuser->access_right('Qualify service') ) {
<% $s++ ? ' | ' : '' %>
<& one_time_charge_link.html, $cust_main &>
% }
+% if ( $curuser->access_right('Bulk move customer services') ) {
+ <% $s++ ? ' | ' : '' %>
+
+ <& /elements/popup_link-cust_main.html,
+ 'label' => emt('Move services between packages'),
+ 'action' => "${p}edit/bulk-cust_svc-pkgnum.html",
+ 'cust_main' => $cust_main,
+ 'actionlabel' => emt('Move services'),
+ 'width' => 968, #763,
+ 'height' => 575,
+ &>
+
+% }
+
% if ( $curuser->access_right('Bulk change customer packages') ) {
<% $s++ ? ' | ' : '' %>
- <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>"><% mt('Bulk order and cancel packages') |h %></A> (<% mt('preserves services') |h %>)
+ <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>"><% mt('Bulk order and cancel packages') |h %></A>
% }
<BR><BR>
+% } # unless $opt{no_links}
+
<TABLE>
<TR>
<TD ALIGN="left" VALIGN="top">
-% if ( @$packages ) {
-
-<% mt('Current packages') |h %>
-% }
% if ( $cust_main->num_cancelled_pkgs ) {
% if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
% || ( $conf->exists('hidecancelledpackages')
% }
</TD>
+
+% unless ( $opt{no_links} ) {
+
<TD ALIGN="right">
<A HREF="<%$p%>search/report_cust_pkg.html?custnum=<% $cust_main->custnum %>"><% mt('Package reports') |h %></A>
% if ( $curuser->access_right('Qualify service') ) {
<% mt('Usage reports:') |h %>
<A HREF="<%$p%>search/report_cdr.html?custnum=<% $cust_main->custnum %>"><% mt('CDRs') |h %></A>
</TD>
+
+% } # unless $opt{no_links}
+
</TR>
<TR>
<& locations.html,
'cust_main' => $cust_main,
'packages' => $packages,
+ %opt,
&>
% }
% else {
<& packages/section.html,
'cust_main' => $cust_main,
'packages' => $packages,
+ %opt,
&>
</TABLE>
% }
} );
my $num_old_packages = scalar(@packages);
+ my %change_to_from; # target pkgnum => current cust_pkg, for future changes
+
foreach my $cust_pkg ( @packages ) {
my %hash = $cust_pkg->hash;
my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); }
grep { /^part_pkg_/ } keys %hash;
$cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg;
+ if ( $cust_pkg->change_to_pkgnum ) {
+ $change_to_from{$cust_pkg->change_to_pkgnum} = $cust_pkg;
+ }
+ }
+
+ if ( keys %change_to_from ) {
+ my @not_future_packages;
+ foreach my $cust_pkg (@packages) {
+ if ( exists( $change_to_from{$cust_pkg->pkgnum} ) ) {
+ my $change_from = $change_to_from{ $cust_pkg->pkgnum };
+ $cust_pkg->set('change_from_pkg', $change_from);
+ $change_from->set('change_to_pkg', $cust_pkg);
+ } else {
+ push @not_future_packages, $cust_pkg;
+ }
+ }
+ @packages = @not_future_packages;
}
unless ( $cgi->param('showoldpackages') ) {
# don't include supplemental packages in this list; they'll be found from
# their main packages
+ # (as will change-target packages)
@packages = grep !$_->main_pkgnum, @packages;
( \@packages, $num_old_packages );