diff options
author | levinse <levinse> | 2011-01-23 22:53:20 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-01-23 22:53:20 +0000 |
commit | 8a57e5095e0139e23ce211d5af947d74c450631b (patch) | |
tree | 37854577561b72302db7ffe0986bed377ce7201c | |
parent | 8ea647590487b7d61117e4f58087140413bc7104 (diff) |
fix annoying warnings caused by prev commits for RT11237
-rw-r--r-- | FS/FS/cust_main/Billing_Realtime.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index dc896fa64..5d1a20abc 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -322,7 +322,9 @@ sub realtime_bop { ### my $cc_surcharge = 0; - my $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage'); + my $cc_surcharge_pct = 0; + $cc_surcharge_pct = $conf->config('credit-card-surcharge-percentage') + if $conf->config('credit-card-surcharge-percentage'); # always add cc surcharge if called from event if($options{'cc_surcharge_from_event'} && $cc_surcharge_pct > 0) { @@ -335,11 +337,10 @@ sub realtime_bop { # amount as post-surcharge $cc_surcharge = $options{'amount'} - ($options{'amount'} / ( 1 + $cc_surcharge_pct/100 )); } - if ( $cc_surcharge > 0) { - $cc_surcharge = sprintf("%.2f",$cc_surcharge); - $options{'cc_surcharge'} = $cc_surcharge; - } - + + $cc_surcharge = sprintf("%.2f",$cc_surcharge) if $cc_surcharge > 0; + $options{'cc_surcharge'} = $cc_surcharge; + if ( $DEBUG ) { warn "$me realtime_bop (new): $options{method} $options{amount}\n"; |