summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2006-12-02 22:04:10 +0000
committerivan <ivan>2006-12-02 22:04:10 +0000
commit9bc4fb7136e898f4504fbd15cecdcbf80174730e (patch)
treed91b1085afd7f0373cd13659d36c7051448d24f9
parent2c8748ac26281934a1b75671c6a5d0125145660a (diff)
fix for commission price plan
-rw-r--r--FS/FS/part_pkg/flat_comission.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/FS/FS/part_pkg/flat_comission.pm b/FS/FS/part_pkg/flat_comission.pm
index 442415e08..bc02f9658 100644
--- a/FS/FS/part_pkg/flat_comission.pm
+++ b/FS/FS/part_pkg/flat_comission.pm
@@ -41,8 +41,14 @@ sub calc_recur {
$cust_pkg->cust_main->referral_cust_pkg( $self->option('comission_depth') )
);
- my $error = $cust_pkg->cust_main->credit( $amount*$num_active, "commission" );
- die $error if $error;
+ my $commission = sprintf('%.2f', $amount*$num_active);
+
+ if ( $commission > 0 ) {
+
+ my $error = $cust_pkg->cust_main->credit( $commission, "commission" );
+ die $error if $error;
+
+ }
$self->option('recur_fee');
}