summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-02-22 10:58:51 +0000
committerivan <ivan>2009-02-22 10:58:51 +0000
commitdabae640f7e8906a26ff5b3d34b511e7c45aa997 (patch)
treeec991ad768bb3d8ffd5d527158ec8981e497fc9a /FS
parent52695730dfe30a1a7eccd92e15745621fd20cb3e (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')
-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 a88492572..01ea5d439 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -152,7 +152,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