use FS::type_pkgs;
use FS::part_pkg_option;
-@ISA = qw( FS::Record );
+@ISA = qw( FS::Record ); # FS::option_Common ); # this can use option_Common
+ # when all the plandata bs is
+ # gone
$DEBUG = 0;
my $error = $self->ut_number('freq');
return $error if $error;
} else {
- $self->freq =~ /^(\d+[dw]?)$/
+ $self->freq =~ /^(\d+[hdw]?)$/
or return "Illegal or empty freq: ". $self->freq;
$self->freq($1);
}
return 'Unknown plan '. $self->plan
unless exists($plans{$self->plan});
+ my $conf = new FS::Conf;
+ return 'Taxclass is required'
+ if ! $self->taxclass && $conf->exists('require_taxclasses');
+
'';
}
tie %freq, 'Tie::IxHash',
'0' => '(no recurring fee)',
+ '1h' => 'hourly',
'1d' => 'daily',
'1w' => 'weekly',
'2w' => 'biweekly (every 2 weeks)',
$freq{$freq};
} else {
my $interval = 'month';
- if ( $freq =~ /^(\d+)([dw])$/ ) {
- my %interval = ( 'd'=>'day', 'w'=>'week' );
+ if ( $freq =~ /^(\d+)([hdw])$/ ) {
+ my %interval = ( 'h' => 'hour', 'd'=>'day', 'w'=>'week' );
$interval = $interval{$2};
}
if ( $1 == 1 ) {
if $DEBUG;
return $self;
}
+ return $self if ref($self) =~ /::$plan$/; #already blessed into plan subclass
my $class = ref($self). "::$plan";
warn "reblessing $self into $class" if $DEBUG;
eval "use $class;";
setup and recur semantics are not yet defined (and are implemented in
FS::cust_bill. hmm.).
+plandata should go
+
=head1 SEE ALSO
L<FS::Record>, L<FS::cust_pkg>, L<FS::type_pkgs>, L<FS::pkg_svc>, L<Safe>.