fix bug in flat_commission price plan, thanks to Troy Hammonds
authorivan <ivan>
Wed, 13 Apr 2005 03:38:34 +0000 (03:38 +0000)
committerivan <ivan>
Wed, 13 Apr 2005 03:38:34 +0000 (03:38 +0000)
CREDITS
FS/FS/part_pkg/flat_comission_cust.pm

diff --git a/CREDITS b/CREDITS
index 048fbf5..e2ebcd2 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -134,8 +134,8 @@ probably overlooked.
 Rebecca Cardennis <http://www.shinza.org/> created the great new logo first
 released with 1.4.2beta1 and 1.5.0pre6.
 
-Troy Hammonds <troyh@netsignia.net> sent in RADIUS session history viewing
-code and other things I'm probably forgetting.
+Troy Hammonds <troyh@netsignia.net> sent in RADIUS session history viewing,
+many bugfixes and other things I'm probably forgetting.
 
 Contains the "Javascript Remote Scripting (JSRS)" client library
 <http://www.ashleyit.com/rs/main.htm> by Brent Ashley <brent@ashleyit.com>
index 27a93ff..9f2e6ca 100644 (file)
@@ -38,13 +38,16 @@ sub calc_recur {
 
   my $amount = $self->option('comission_amount');
   my $num_active = scalar(
-    $cust_pkg->cust_main->referral_cust_pkgcust_main_ncancelled(
+    $cust_pkg->cust_main->referral_cust_main_ncancelled(
       $self->option('comission_depth')
     )
   );
 
-  my $error = $cust_pkg->cust_main->credit( $amount*$num_active, "commission" );
-  die $error if $error;
+  if ( $amount && $num_active ) {
+    my $error =
+      $cust_pkg->cust_main->credit( $amount*$num_active, "commission" );
+    die $error if $error;
+  }
 
   $self->option('recur_fee');
 }