svc_acct events for usage limits, #13202
[freeside.git] / FS / FS / part_event / Action / pkg_suspend.pm
index e12616c..23ab13e 100644 (file)
@@ -6,7 +6,8 @@ use base qw( FS::part_event::Action );
 sub description { 'Suspend this package'; }
 
 sub eventtable_hashref {
-  { 'cust_pkg' => 1 };
+  { 'cust_pkg' => 1,
+    'svc_acct' => 1, };
 }
 
 sub option_fields {
@@ -21,7 +22,8 @@ sub option_fields {
 sub default_weight { 20; }
 
 sub do_action {
-  my( $self, $cust_pkg, $cust_event ) = @_;
+  my( $self, $object, $cust_event ) = @_;
+  my $cust_pkg = $self->cust_pkg($object);
 
   my $error = $cust_pkg->suspend( 'reason' => $self->option('reasonnum') );
   die $error if $error;