[freeside-commits] freeside/FS/FS/Cron bill.pm,1.12,1.13

Ivan,,, ivan at wavetail.420.am
Mon Apr 28 12:17:02 PDT 2008


Update of /home/cvs/cvsroot/freeside/FS/FS/Cron
In directory wavetail.420.am:/tmp/cvs-serv6625/Cron

Modified Files:
	bill.pm 
Log Message:
fix 1.9 queued billing from doing weird things with expirations and adjournments because freeside-queued $^T != freeside-daily $^T

Index: bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Cron/bill.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- bill.pm	14 Oct 2007 20:07:56 -0000	1.12
+++ bill.pm	28 Apr 2008 19:17:00 -0000	1.13
@@ -115,33 +115,29 @@
   ###
   
   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 );
 
     }
 



More information about the freeside-commits mailing list