add "Ordered" status to customer number/link on agent browse, RT#27442
authorIvan Kohler <ivan@freeside.biz>
Thu, 6 Feb 2014 08:05:07 +0000 (00:05 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 6 Feb 2014 08:05:07 +0000 (00:05 -0800)
FS/FS/agent.pm
httemplate/browse/agent.cgi
httemplate/search/cust_main.cgi

index b476847..0fdc5f5 100644 (file)
@@ -419,6 +419,28 @@ sub cust_main_sql {
   );
 }
 
+=item num_ordered_cust_main
+
+Returns the number of ordered customers for this agent (customers with packages
+ordered, but not yet billed).
+
+=cut
+
+sub num_ordered_cust_main {
+  shift->num_sql(FS::cust_main->ordered_sql);
+}
+
+=item active_cust_main
+
+Returns the active customers for this agent, as cust_main objects.
+
+=cut
+
+sub active_cust_main {
+  shift->cust_main_sql(FS::cust_main->active_sql);
+}
+
+
 =item num_active_cust_main
 
 Returns the number of active customers for this agent (customers with active
index 6f28641..2552432 100755 (executable)
@@ -182,6 +182,26 @@ inactive
 
             <TR>
               <TH ALIGN="right" WIDTH="40%">
+                <FONT COLOR="#009999">
+                  <% my $num_ordered = $agent->num_ordered_cust_main %>&nbsp;
+                </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 %>&nbsp;
                 </FONT>
@@ -266,6 +286,11 @@ inactive
               </TD>
             </TR>
 
+            <!--ordered-->
+            <TR>
+              <TD>&nbsp;</TD>
+            </TR>
+
             <TR>
               <TH ALIGN="right" WIDTH="40%">
                 <FONT COLOR="#00CC00">
index ee1dd85..0b0dd4f 100755 (executable)
@@ -393,6 +393,7 @@ if ( $cgi->param('browse')
 
   push @qual, FS::cust_main->cancel_sql   if $cgi->param('cancelled');
   push @qual, FS::cust_main->prospect_sql if $cgi->param('prospect');
+  push @qual, FS::cust_main->ordered_sql  if $cgi->param('ordered');
   push @qual, FS::cust_main->active_sql   if $cgi->param('active');
   push @qual, FS::cust_main->inactive_sql if $cgi->param('inactive');
   push @qual, FS::cust_main->susp_sql     if $cgi->param('suspended');