summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2006-10-27 19:10:21 +0000
committerivan <ivan>2006-10-27 19:10:21 +0000
commit9d81f007db468520103bbdb0d4bc922b2266fe57 (patch)
treedf4f35c379e78250e3ec73fc7b640d9669705e64
parent576c6b48428aa95e0fd80db011fe73c0b728c88b (diff)
add unsuspend-always_adjust_next_bill_date config option for qis
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_pkg.pm5
2 files changed, 11 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 1d7490f76..edb1ca33e 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1000,6 +1000,13 @@ httemplate/docs/config.html
},
{
+ 'key' => 'unsuspend-always_adjust_next_bill_date',
+ 'section' => 'billing',
+ 'description' => 'Global override that causes unsuspensions to always adjust the next bill date under any circumstances. This is now controlled on a per-package bases - probably best not to use this option unless you are a legacy installation that requires this behaviour.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'usernamemin',
'section' => 'username',
'description' => 'Minimum username length (default 2)',
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 4166f090e..ec47538cd 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -643,8 +643,11 @@ sub unsuspend {
my %hash = $self->hash;
my $inactive = time - $hash{'susp'};
+ my $conf = new FS::Conf;
+
$hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive
- if $opt{'adjust_next_bill'}
+ if ( $opt{'adjust_next_bill'}
+ || $conf->config('unsuspend-always_adjust_next_bill_date') )
&& $inactive > 0 && ( $hash{'bill'} || $hash{'setup'} );
$hash{'susp'} = '';