X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fdelayed_Mixin.pm;h=4228a4a3d22e5cbb2eb4c8de359b0c654f24bfa4;hp=027cfff06b322ef3459d0154c56b7641972be19a;hb=d3e18527e2fa36b7b7fe7b8b0a5906caae3cb8de;hpb=0534412bf84b022fe23f9231cb66424b7f6033df diff --git a/FS/FS/part_pkg/delayed_Mixin.pm b/FS/FS/part_pkg/delayed_Mixin.pm index 027cfff06..4228a4a3d 100644 --- a/FS/FS/part_pkg/delayed_Mixin.pm +++ b/FS/FS/part_pkg/delayed_Mixin.pm @@ -25,7 +25,7 @@ use vars qw(%info); sub calc_setup { my($self, $cust_pkg, $time ) = @_; - unless ( $self->option('delay_setup') ) { + unless ( $self->option('delay_setup', 1) ) { my $d = $cust_pkg->bill || $time; $d += 86400 * $self->option('free_days'); $cust_pkg->bill($d); @@ -37,7 +37,7 @@ sub calc_setup { sub calc_remain { my ($self, $cust_pkg, %options) = @_; - unless ( $self->option('delay_setup') ) { + unless ( $self->option('delay_setup', 1) ) { my $last_bill = $cust_pkg->last_bill || 0; my $next_bill = $cust_pkg->getfield('bill') || 0; my $free_days = $self->option('free_days'); @@ -49,4 +49,6 @@ sub calc_remain { return $self->SUPER::calc_remain($cust_pkg, %options); } +sub can_start_date { ! shift->option('delay_setup', 1) } + 1;