1 package FS::part_event::Condition::has_pkg_class_cancelled;
2 use base qw( FS::part_event::Condition );
7 'Customer has canceled package with class';
10 sub eventtable_hashref {
20 'pkgclass' => { 'label' => 'Package Class',
21 'type' => 'select-pkg_class',
24 'age' => { 'label' => 'Cacnellation in last',
31 my( $self, $object, %opt ) = @_;
33 my $cust_main = $self->cust_main($object);
35 my $age = $self->option_age_from('age', $opt{'time'} );
38 my $hashref = $self->option('pkgclass') || {};
39 grep { $hashref->{ $_->part_pkg->classnum } && $_->get('cancel') > $age }
40 $cust_main->cancelled_pkgs;