1 package FS::part_event::Condition::pkg_dundate_age;
2 use base qw( FS::part_event::Condition );
7 "Skip until specified # of days before package suspension delay date";
13 'age' => { 'label' => 'Time before suspension delay date',
19 sub eventtable_hashref {
27 my($self, $cust_pkg, %opt) = @_;
29 my $age = $self->option_age_from('age', $opt{'time'} );
31 $cust_pkg->dundate <= $age;
35 my( $class, $table, %opt ) = @_;
36 return 'true' unless $table eq 'cust_pkg';
38 my $age = $class->condition_sql_option_age_from('age', $opt{'time'});
40 "COALESCE($table.dundate,0) <= ". $age;