diff options
-rw-r--r-- | CREDITS | 4 | ||||
-rw-r--r-- | FS/FS/part_pkg/flat_comission_cust.pm | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -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> diff --git a/FS/FS/part_pkg/flat_comission_cust.pm b/FS/FS/part_pkg/flat_comission_cust.pm index 27a93ff79..9f2e6ca0b 100644 --- a/FS/FS/part_pkg/flat_comission_cust.pm +++ b/FS/FS/part_pkg/flat_comission_cust.pm @@ -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'); } |