add cust_main.archived field, skip billing if Y, RT#4412
[freeside.git] / FS / FS / Cron / bill.pm
index 6334056..772a9ef 100644 (file)
@@ -28,6 +28,8 @@ sub bill {
 
   my @search = ();
 
+  push @search, "cust_main.archived != 'Y' "; #disable?
+
   push @search, "cust_main.payby    = '". $opt{'p'}. "'"
     if $opt{'p'};
   push @search, "cust_main.agentnum =  ". $opt{'a'}
@@ -129,8 +131,9 @@ END
 
       #add job to queue that calls bill_and_collect with options
       my $queue = new FS::queue {
-        'job'    => 'FS::cust_main::queued_bill',
-        'secure' => 'Y',
+        'job'      => 'FS::cust_main::queued_bill',
+        'secure'   => 'Y',
+        'priority' => 99, #don't get in the way of provisioning jobs
       };
       my $error = $queue->insert( 'custnum'=>$custnum, %args );