hide start date on package order for specific package definitions, RT#13783
[freeside.git] / FS / FS / part_pkg / delayed_Mixin.pm
index 027cfff..4228a4a 100644 (file)
@@ -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;