1 package FS::part_event::Action::suspend_unless_pkgpart;
4 use base qw( FS::part_event::Action );
6 sub description { 'Suspend packages except'; }
8 #i should be deprecated in favor of using the unless_pkgpart condition
12 'unless_pkgpart' => { 'label' => 'Suspend packages except:',
13 'type' => 'select-part_pkg',
16 'reasonnum' => { 'label' => 'Reason',
17 'type' => 'select-reason',
18 'reason_class' => 'S',
23 sub default_weight { 10; }
26 my( $self, $cust_object ) = @_;
28 my $cust_main = $self->cust_main($cust_object);
30 my @err = $cust_main->suspend_unless_pkgpart( {
31 'pkgparts' => [ split(/\s*,\s*/, $self->option('unless_pkgpart') ) ],
32 'reason' => $self->option('reasonnum'),
35 die join(' / ', @err) if scalar(@err);