[freeside-commits] branch master updated. 2a557042a62c71b2bcee3d4d2b7e6c79bc52e67a

Mitch Jackson mitch at freeside.biz
Thu Jun 7 19:27:43 PDT 2018


The branch, master has been updated
       via  2a557042a62c71b2bcee3d4d2b7e6c79bc52e67a (commit)
      from  17a3178440ad657665657896fa6ae6d94a8d4e61 (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 2a557042a62c71b2bcee3d4d2b7e6c79bc52e67a
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Thu Jun 7 21:25:10 2018 -0500

    RT# 74877 flat pkg conf opt prorate_defer_change_bill
    
    Enable this package flag to delay invoicing a customer
    for a package change until their next normal bill date

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 07c5a4756..d00f0397b 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2487,6 +2487,12 @@ sub change {
     $keep_dates = 0;
     $hash{'last_bill'} = '';
     $hash{'bill'} = '';
+
+    # Optionally, carry over the next bill date from the changed cust_pkg
+    # so an invoice isn't generated until the customer's usual billing date
+    if ( $self->part_pkg->option('prorate_defer_change_bill', 1) ) {
+      $hash{bill} = $self->bill;
+    }
   }
 
   if ( $keep_dates ) {
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 6fd9c7d08..c06328b1b 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -57,6 +57,12 @@ tie my %contract_years, 'Tie::IxHash', (
                                     'the customer\'s next bill date',
                           'type' => 'checkbox',
                         },
+    'prorate_defer_change_bill' => {
+                          'name' => 'When synchronizing, defer bill for '.
+                                    'package changes until the customer\'s '.
+                                    'next bill date',
+                          'type' => 'checkbox',
+                        },
     'prorate_round_day' => {
                           'name' => 'When synchronizing, round the prorated '.
                                     'period',
@@ -87,7 +93,8 @@ tie my %contract_years, 'Tie::IxHash', (
   },
   'fieldorder' => [ qw( recur_temporality 
                         start_1st
-                        sync_bill_date prorate_defer_bill prorate_round_day
+                        sync_bill_date prorate_defer_bill
+                        prorate_defer_change_bill prorate_round_day
                         suspend_bill unsuspend_adjust_bill
                         bill_recur_on_cancel
                         bill_suspend_as_cancel

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

Summary of changes:
 FS/FS/cust_pkg.pm      | 6 ++++++
 FS/FS/part_pkg/flat.pm | 9 ++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list