{
'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',
},
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');
}
}