summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg
diff options
context:
space:
mode:
authorivan <ivan>2009-02-22 10:58:50 +0000
committerivan <ivan>2009-02-22 10:58:50 +0000
commit65efe8eb9ee8bb02deb776da0897e25d821b4f65 (patch)
tree77b2f8821ec0d01c38e8f18f0b1687592c4b2bd7 /FS/FS/part_pkg
parenteedf55aee4f0c0263b1924ee07a2182a1be46991 (diff)
don't do a credit for unused time for packages that don't have a last bill date. really. RT#4881
Diffstat (limited to 'FS/FS/part_pkg')
-rw-r--r--FS/FS/part_pkg/flat.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 7a78d0ba4..3ac44c4e2 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -161,7 +161,10 @@ sub calc_remain {
}
my $next_bill = $cust_pkg->getfield('bill') || 0;
- my $last_bill = $cust_pkg->last_bill || 0;
+
+ #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
|| ! $self->option('unused_credit', 1)
|| ! $last_bill