diff options
author | ivan <ivan> | 2009-08-05 23:34:38 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-08-05 23:34:38 +0000 |
commit | a228d1534e9a140e437c844d33f511ea7c951b90 (patch) | |
tree | db7d85b040207f3331ee066ff51b0dff7ae043b3 | |
parent | 0b43a6f7a36bb1b84bd195d05f5f2fdcb5140a0f (diff) |
fix cancellation errors with updated flat_introrate, RT#5865
-rw-r--r-- | FS/FS/part_pkg/flat.pm | 6 | ||||
-rw-r--r-- | FS/FS/part_pkg/flat_delayed.pm | 2 | ||||
-rw-r--r-- | FS/FS/part_pkg/prorate_delayed.pm | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 98b050165..d6432fcb8 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -176,7 +176,7 @@ sub calc_remain { #my $last_bill = $cust_pkg->last_bill || 0; my $last_bill = $cust_pkg->get('last_bill') || 0; #->last_bill falls back to setup - return 0 if ! $self->base_recur + return 0 if ! $self->base_recur($cust_pkg) || ! $self->option('unused_credit', 1) || ! $last_bill || ! $next_bill @@ -194,7 +194,7 @@ sub calc_remain { my $freq_sec = $1 * $sec{$2||'m'}; return 0 unless $freq_sec; - sprintf("%.2f", $self->base_recur * ( $next_bill - $time ) / $freq_sec ); + sprintf("%.2f", $self->base_recur($cust_pkg) * ( $next_bill - $time ) / $freq_sec ); } @@ -216,7 +216,7 @@ sub usage_valuehash { sub reset_usage { my($self, $cust_pkg, %opt) = @_; warn " resetting usage counters" if $opt{debug} > 1; - my %values = $self->usage_valuehash; + my %values = $self->usage_valuehash; if ($self->option('usage_rollover', 1)) { $cust_pkg->recharge(\%values); }else{ diff --git a/FS/FS/part_pkg/flat_delayed.pm b/FS/FS/part_pkg/flat_delayed.pm index 8ac168280..7e9d65ca5 100644 --- a/FS/FS/part_pkg/flat_delayed.pm +++ b/FS/FS/part_pkg/flat_delayed.pm @@ -57,7 +57,7 @@ sub calc_remain { return 0 if $last_bill + (86400 * $free_days) == $next_bill && $last_bill == $cust_pkg->setup; - return 0 if ! $self->base_recur + return 0 if ! $self->base_recur($cust_pkg) || ! $self->option('unused_credit', 1) || ! $last_bill || ! $next_bill; diff --git a/FS/FS/part_pkg/prorate_delayed.pm b/FS/FS/part_pkg/prorate_delayed.pm index ee664327e..d2f437a4f 100644 --- a/FS/FS/part_pkg/prorate_delayed.pm +++ b/FS/FS/part_pkg/prorate_delayed.pm @@ -50,7 +50,7 @@ sub calc_remain { return 0 if $last_bill + (86400 * $free_days) == $next_bill && $last_bill == $cust_pkg->setup; - return 0 if ! $self->base_recur + return 0 if ! $self->base_recur($cust_pkg) || ! $self->option('unused_credit', 1) || ! $last_bill || ! $next_bill; |