X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=2a460b0c913a280f72b1f60c0a84b287bb4ea014;hb=c2146ae32fdef80049abfa13098db2d45f3ebdd5;hp=131f850e9a59f36e6a9e2c997ff080fc5d7be9bd;hpb=e4ae5122522f2d45c68a38eaef337a82029f2fc1;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 131f850e9..2a460b0c9 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -4,6 +4,7 @@ use strict; use vars qw(@ISA %info); #use FS::Record qw(qsearch); use FS::part_pkg; +use Date::Manip; @ISA = qw(FS::part_pkg); @@ -48,7 +49,7 @@ sub calc_remain { my $next_bill = $cust_pkg->getfield('bill') || 0; my $last_bill = $cust_pkg->last_bill || 0; return 0 if ! $self->base_recur - || ! $self->option('unused_credit') + || ! $self->option('unused_credit', 1) || ! $last_bill || ! $next_bill;