From: ivan Date: Fri, 27 Oct 2006 19:10:21 +0000 (+0000) Subject: add unsuspend-always_adjust_next_bill_date config option for qis X-Git-Tag: TRIXBOX_2_6~886 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=9d81f007db468520103bbdb0d4bc922b2266fe57 add unsuspend-always_adjust_next_bill_date config option for qis --- 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'} = '';