[freeside-commits] branch master updated. a6d62e3bc88e63d71fc972303210aec5464b2219

Ivan ivan at 420.am
Thu Oct 24 21:58:43 PDT 2013


The branch, master has been updated
       via  a6d62e3bc88e63d71fc972303210aec5464b2219 (commit)
      from  ca00186e5e6b7eee73140546cde55758f81ed4de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a6d62e3bc88e63d71fc972303210aec5464b2219
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Oct 24 21:58:40 2013 -0700

    fix next-bill-ignore-time, RT#24318, RT#24476, RT#12570

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 0a364f5..b8a71d4 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -373,6 +373,11 @@ sub bill {
   my $time = $options{'time'} || time;
   my $invoice_time = $options{'invoice_time'} || $time;
 
+  my $cmp_time = ( $conf->exists('next-bill-ignore-time')
+                     ? day_end( $time )
+                     : $time
+                 );
+
   $options{'not_pkgpart'} ||= {};
   $options{'not_pkgpart'} = { map { $_ => 1 }
                                   split(/\s*,\s*/, $options{'not_pkgpart'})
@@ -480,7 +485,7 @@ sub bill {
       my $next_bill = $cust_pkg->getfield('bill') || 0;
       my $error;
       # let this run once if this is the last bill upon cancellation
-      while ( $next_bill <= $time or $options{cancel} ) {
+      while ( $next_bill <= $cmp_time or $options{cancel} ) {
         $error =
           $self->_make_lines( 'part_pkg'            => $part_pkg,
                               'cust_pkg'            => $cust_pkg,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Billing.pm |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list