add customer status to advanced package report, RT#24631
authorIvan Kohler <ivan@freeside.biz>
Fri, 11 Oct 2013 06:13:09 +0000 (23:13 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 11 Oct 2013 06:13:09 +0000 (23:13 -0700)
FS/FS/cust_pkg.pm
httemplate/search/cust_pkg.cgi
httemplate/search/report_cust_pkg.html

index 0cb1b50..066b987 100644 (file)
@@ -4179,6 +4179,14 @@ sub search {
   }
 
   ##
+  # parse cust_status
+  ##
+
+  if ( $params->{'cust_status'} =~ /^([a-z]+)$/ ) {
+    push @where, FS::cust_main->cust_status_sql . " = '$1' ";
+  }
+
+  ##
   # parse customer sales person
   ##
 
index 32b5a69..995779a 100755 (executable)
@@ -156,8 +156,8 @@ my %search_hash = ();
 $search_hash{'query'} = $cgi->keywords;
 
 #scalars
-for (qw( agentnum cust_main_salesnum salesnum custnum magic status custom
-         cust_fields pkgbatch
+for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status
+         custom cust_fields pkgbatch
     )) 
 {
   $search_hash{$_} = $cgi->param($_) if length($cgi->param($_));
index 0a17344..b8c32c6 100755 (executable)
     </TR>
 
 % unless ( $custnum ) {
-    <% include( '/elements/tr-select-agent.html',
+
+    <& /elements/tr-select-agent.html,
                    'curr_value'    => scalar( $cgi->param('agentnum') ),
                    'disable_empty' => 0,
                    'onchange'      => 'agent_changed(this)',
-               )
-    %>
+    &>
+
+    <& /elements/tr-select-cust_main-status.html,
+         'label' => 'Customer status',
+         'field' => 'cust_status',
+    &>
 
     <SCRIPT TYPE="text/javascript">
 
@@ -55,6 +60,7 @@
     &>
 
     <% include( '/elements/tr-select-cust_pkg-status.html',
+                  'label'    => 'Package status',
                   'onchange' => 'status_changed(this);',
               )
     %>