fix small problems with earlier commit: add back earlier commits reverted by this...
[freeside.git] / FS / FS / Cron / bill.pm
index 1576edc..efcbfb3 100644 (file)
@@ -95,13 +95,22 @@ END
 
   }
   
-  my($cust_main,%saw);
-  foreach $cust_main ( @cust_main ) {
+  foreach my $cust_main ( @cust_main ) {
 
     if ( $opt{'m'} ) {
 
-      die "XXX multi-process mode not yet completed";
       #add job to queue that calls bill_and_collect with options
+        my $queue = new FS::queue {
+          'job'    => 'FS::cust_main::queued_bill',
+          'secure' => 'Y',
+        };
+        my $error = $queue->insert(
+        'custnum'      => $cust_main->custnum,
+        'time'         => $time,
+        'invoice_time' => $invoice_time,
+        'check_freq'   => $check_freq,
+        'resetup'      => $opt{'s'} ? $opt{'s'} : 0,
+      );
 
     } else {