From e13421f071b4a7b872e6d40205ca736125cb294d Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 30 May 2009 02:31:39 +0000 Subject: [PATCH] require svc_acct-usage_threshold to be set explicitly, don't default to 80% --- FS/FS/Conf.pm | 2 +- 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'); } } -- 2.11.0