add customer status to receivables report selection, hopefully help enet, RT#5187
authorivan <ivan>
Fri, 17 Apr 2009 01:17:40 +0000 (01:17 +0000)
committerivan <ivan>
Fri, 17 Apr 2009 01:17:40 +0000 (01:17 +0000)
httemplate/search/report_receivables.cgi
httemplate/search/report_receivables.html

index 58d87fa..c5ca453 100755 (executable)
@@ -116,6 +116,15 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   push @where, "agentnum = $agentnum";
 }
 
+#status (false laziness w/cust_main::search_sql
+
+#prospect active inactive suspended cancelled
+if ( grep { $cgi->param('status') eq $_ } FS::cust_main->statuses() ) {
+  my $method = $cgi->param('status'). '_sql';
+  #push @where, $class->$method();
+  push @where, FS::cust_main->$method();
+}
+
 #here is the agent virtualization
 push @where, $FS::CurrentUser::CurrentUser->agentnums_sql;
 
index 19b1ee7..1ebe08c 100755 (executable)
   </TR>
 
   <% include( '/elements/tr-select-agent.html', 'disable_empty'=>0 ) %>
+
+  <% include( '/elements/tr-select-cust_main-status.html',
+                'label' => 'Customer Status'
+            )
+  %>
   
   <TR>
     <TD ALIGN="right">Customers</TD>