- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#0000CC">
- <% my $num_inactive_pkg = $agent->num_inactive_cust_pkg %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_inactive_pkg ) {
-
- <A HREF="<% $cust_pkg_link %>&magic=inactive">
-% }
-inactive
-% if ( $num_inactive_pkg ) {
-</A>
-% }
-
- </TD>
- </TR>
-
- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#00CC00">
- <% my $num_active_pkg = $agent->num_active_cust_pkg %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_active_pkg ) {
-
- <A HREF="<% $cust_pkg_link %>&magic=active">
-% }
-active
-% if ( $num_active_pkg ) {
-</A>
-% }
-
- </TD>
- </TR>
+% #my @pkg_status = FS::cust_pkg->statuses;
+% my @pkg_status = ( 'on hold', 'one-time charge', 'not yet billed',
+% qw( active suspended cancelled ) );
+% my %method = ( 'one-time charge' => 'inactive',
+% 'suspended' => 'susp',
+% 'cancelled' => 'cancel',
+% );
+% my $statuscolor = FS::cust_pkg->statuscolors;
+%
+% foreach my $status ( @pkg_status ) {
+% my $magic = exists($method{$status}) ? $method{$status} : $status;
+% $magic =~ s/ /_/g;
+% my $meth = 'num_'. $magic. '_cust_pkg';
+% ( my $label = $status ) =~ s/ / /g;