summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2010-10-12 19:06:44 +0000
committermark <mark>2010-10-12 19:06:44 +0000
commitb87b8ca36fe928ce89d31de7e7d4bebddd1ff6a2 (patch)
tree51df614a19b610d55ee4a13f3ad3eb8f59d806ae
parentb8bb8d0c831d45598ed4a2ae421efc9e732a888e (diff)
per-package option to adjust bill date on unsuspend, RT#8434
-rw-r--r--FS/FS/cust_pkg.pm14
-rw-r--r--FS/FS/part_pkg/flat.pm7
2 files changed, 16 insertions, 5 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 19c97307a..82fdce135 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1011,10 +1011,16 @@ sub unsuspend {
my $conf = new FS::Conf;
- $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive
- if ( $opt{'adjust_next_bill'}
- || $conf->exists('unsuspend-always_adjust_next_bill_date') )
- && $inactive > 0 && ( $hash{'bill'} || $hash{'setup'} );
+ if ( $inactive > 0 &&
+ ( $hash{'bill'} || $hash{'setup'} ) &&
+ ( $opt{'adjust_next_bill'} ||
+ $conf->exists('unsuspend-always_adjust_next_bill_date') ||
+ $self->part_pkg->option('unsuspend_adjust_bill', 1) )
+ ) {
+
+ $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive;
+
+ }
$hash{'susp'} = '';
$hash{'adjourn'} = '' if $hash{'adjourn'} < time;
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index be17fd803..3929cb99d 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -116,6 +116,11 @@ tie my %temporalities, 'Tie::IxHash',
'start_1st' => { 'name' => 'Auto-add a start date to the 1st, ignoring the current month.',
'type' => 'checkbox',
},
+ 'unsuspend_adjust_bill' =>
+ { 'name' => 'Adjust next bill date forward when '.
+ 'unsuspending',
+ 'type' => 'checkbox',
+ },
%usage_fields,
%usage_recharge_fields,
@@ -126,7 +131,7 @@ tie my %temporalities, 'Tie::IxHash',
},
'fieldorder' => [ qw( setup_fee recur_fee
recur_temporality unused_credit
- expire_months start_1st
+ expire_months start_1st unsuspend_adjust_bill
),
@usage_fieldorder, @usage_recharge_fieldorder,
qw( externalid ),