RT# 75357 - Prospects can now be disabled
authorChristopher Burger <burgerc@freeside.biz>
Thu, 4 Apr 2019 14:59:48 +0000 (10:59 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Mon, 8 Apr 2019 12:20:31 +0000 (08:20 -0400)
FS/FS/prospect_main.pm
httemplate/edit/prospect_main.html

index c54c569..5d909a3 100644 (file)
@@ -462,7 +462,7 @@ sub search {
   # here is the agent virtualization
   push @where, $FS::CurrentUser::CurrentUser->agentnums_sql;
 
-  my $extra_sql = scalar(@where) ? ' WHERE '. join(' AND ', @where) : '';
+  my $extra_sql = scalar(@where) ? ' WHERE prospect_main.custnum IS NULL AND '. join(' AND ', @where) : '';
 
   my $count_query = "SELECT COUNT(*) FROM prospect_main $extra_sql";
   
index 6adb471..b812dc3 100644 (file)
@@ -3,6 +3,7 @@
      'table'           => 'prospect_main',
      'html_table_class'=> 'fsinnerbox',
      'labels'          => { 'prospectnum' => 'Prospect',
+                            'disabled'    => 'Disabled',
                             'agentnum'    => 'Agent',
                             'refnum'      => 'Advertising source',
                             'company'     => 'Company',
          'options'  => [ 'Residential', 'Commercial', ],
          'onchange' => 'rescom_changed',
        },
+       { 'field'    => 'disabled',
+         'type'     => 'checkbox',
+         'value'    => 'Y',
+       },
        { 'field'       => 'agentnum',
          'type'        => 'select-agent',
          'empty_label' => 'Select agent',