- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#7e0079">
- <% my $num_prospect = $agent->num_prospect_cust_main %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_prospect ) {
-
- <A HREF="<% $cust_main_link %>&prospect=1">
-% }
-prospects
-% if ($num_prospect ) {
-</A>
-% }
-
- <TD>
- </TR>
-
- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#0000CC">
- <% my $num_inactive = $agent->num_inactive_cust_main %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_inactive ) {
-
- <A HREF="<% $cust_main_link %>&inactive=1">
-% }
-inactive
-% if ( $num_inactive ) {
-</A>
-% }
-
- </TD>
- </TR>
-
- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#009999">
- <% my $num_ordered = $agent->num_ordered_cust_main %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_ordered ) {
-
- <A HREF="<% $cust_main_link %>&ordered=1">
-% }
-ordered
-% if ($num_ordered ) {
-</A>
-% }
-
- <TD>
- </TR>
-
- <TR>
- <TH ALIGN="right" WIDTH="40%">
- <FONT COLOR="#00CC00">
- <% my $num_active = $agent->num_active_cust_main %>
- </FONT>
- </TH>
-
- <TD>
-% if ( $num_active ) {
+% my @cust_status =
+% qw( prospect inactive ordered active suspended cancelled );
+% my %method = ( 'suspended' => 'susp',
+% 'cancelled' => 'cancel'
+% );
+% my %PL = ( 'prospect' => 'prospects', );
+% my %link = ( 'cancelled' => 'showcancelledcustomers=1&cancelled' );
+% my $statuscolor = FS::cust_main->statuscolors;
+%
+% foreach my $status ( @cust_status ) {
+% my $meth = exists($method{$status}) ? $method{$status} : $status;
+% $meth = 'num_'. $meth. '_cust_main';
+% my $link = exists($link{$status}) ? $link{$status} : $status;