[freeside-commits] freeside/FS/FS Conf.pm, 1.180.2.45, 1.180.2.46 svc_acct.pm, 1.217.2.25, 1.217.2.26

Ivan,,, ivan at wavetail.420.am
Fri May 29 19:31:40 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv8714

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	Conf.pm svc_acct.pm 
Log Message:
require svc_acct-usage_threshold to be set explicitly, don't default to 80%

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.180.2.45
retrieving revision 1.180.2.46
diff -u -d -r1.180.2.45 -r1.180.2.46
--- Conf.pm	20 May 2009 15:27:45 -0000	1.180.2.45
+++ Conf.pm	30 May 2009 02:31:38 -0000	1.180.2.46
@@ -1946,7 +1946,7 @@
   {
     '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',
   },
 

Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.217.2.25
retrieving revision 1.217.2.26
diff -u -d -r1.217.2.25 -r1.217.2.26
--- svc_acct.pm	4 May 2009 01:17:26 -0000	1.217.2.25
+++ svc_acct.pm	30 May 2009 02:31:38 -0000	1.217.2.26
@@ -558,12 +558,13 @@
       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');
       }
 
     }



More information about the freeside-commits mailing list