option to keep track of unrateable CDRs, #15502
[freeside.git] / FS / FS / part_pkg / delayed_Mixin.pm
index 027cfff..d28480d 100644 (file)
@@ -1,5 +1,4 @@
 package FS::part_pkg::delayed_Mixin;
-use base qw( FS::part_pkg );
 
 use strict;
 use vars qw(%info);
@@ -25,7 +24,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 +36,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 +48,6 @@ sub calc_remain {
   return $self->SUPER::calc_remain($cust_pkg, %options);
 }
 
+sub can_start_date { ! shift->option('delay_setup', 1) }
+
 1;