summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/cust_pkg.pm6
-rw-r--r--FS/FS/part_pkg/flat.pm9
2 files changed, 14 insertions, 1 deletions
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