diff options
author | ivan <ivan> | 2009-05-30 02:31:39 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-05-30 02:31:39 +0000 |
commit | e13421f071b4a7b872e6d40205ca736125cb294d (patch) | |
tree | 23902a567bda2e8ab6857a2b1494fdcd11e30a68 | |
parent | be5ca902476e66c87bbcb6c77aaf02ffc4cd7c08 (diff) |
require svc_acct-usage_threshold to be set explicitly, don't default to 80%
-rw-r--r-- | FS/FS/Conf.pm | 2 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index cf7e49fe5..0664c1444 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2014,7 +2014,7 @@ worry that config_items is freeside-specific and icky. { 'key' => 'svc_acct-usage_threshold', 'section' => 'billing', - 'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder. Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd. Defaults to 80.', + 'description' => 'The threshold (expressed as percentage) of acct.seconds or acct.up|down|totalbytes at which a warning message is sent to a service holder. Typically used in conjunction with prepaid packages and freeside-sqlradius-radacctd.', 'type' => 'text', }, diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 1a42e6517..e5be29473 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -539,12 +539,13 @@ sub insert { my %values = $part_pkg->usage_valuehash; my $multiplier = $conf->exists('svc_acct-usage_threshold') ? 1 - $conf->config('svc_acct-usage_threshold')/100 - : 0.20; + : 0.20; #doesn't matter foreach ( keys %values ) { next if $self->getfield($_); $self->setfield( $_, $values{$_} ); - $self->setfield( $_. '_threshold', int( $values{$_} * $multiplier ) ); + $self->setfield( $_. '_threshold', int( $values{$_} * $multiplier ) ) + if $conf->exists('svc_acct-usage_threshold'); } } |