X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCron%2Fbill.pm;h=6334056939387644076315bd9b481a06fb83e68d;hb=8a5bf08dfcc3e44ac3c5e8015ccce494d991025e;hp=7de2ff2f6c6f6a72252c20a4dcdd2851e62c82e0;hpb=53febc36fce75482bc3f154374eeb458d5e3b3e2;p=freeside.git diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm index 7de2ff2f6..633405693 100644 --- a/FS/FS/Cron/bill.pm +++ b/FS/FS/Cron/bill.pm @@ -115,36 +115,34 @@ END ### foreach my $custnum ( @custnums ) { + + my %args = ( + 'time' => $time, + 'invoice_time' => $invoice_time, + 'actual_time' => $^T, #when freeside-bill was started + #(not, when using -m, freeside-queued) + 'check_freq' => $check_freq, + 'resetup' => ( $opt{'s'} ? $opt{'s'} : 0 ), + ); if ( $opt{'m'} ) { #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' => $custnum, - 'time' => $time, - 'invoice_time' => $invoice_time, - 'check_freq' => $check_freq, - 'resetup' => $opt{'s'} ? $opt{'s'} : 0, - ); + my $queue = new FS::queue { + 'job' => 'FS::cust_main::queued_bill', + 'secure' => 'Y', + }; + my $error = $queue->insert( 'custnum'=>$custnum, %args ); } else { my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } ); - - $cust_main->bill_and_collect( - 'time' => $time, - 'invoice_time' => $invoice_time, - 'check_freq' => $check_freq, - 'resetup' => $opt{'s'}, - 'debug' => $debug, - ); + $cust_main->bill_and_collect( %args, 'debug' => $debug ); } } } + +1;