X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=84426b4acab3fc3981d273b47c90db7bf4ce1b24;hp=9b893eacdbfa524bca544ae1ae38a715a34ec109;hb=7a486dea647f735a9a1d0381443218ad6affe6e1;hpb=43da86c4a7fab275a941650abb11173f4f2930aa diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 9b893eacd..84426b4ac 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2171,14 +2171,27 @@ sub cust_payby { =item unsuspend Unsuspends all unflagged suspended packages (see L -and L) for this customer. Always returns a list: an empty list -on success or a list of errors. +and L) for this customer, except those on hold. + +Returns a list: an empty list on success or a list of errors. =cut sub unsuspend { my $self = shift; - grep { $_->unsuspend } $self->suspended_pkgs; + grep { ($_->get('setup')) && $_->unsuspend } $self->suspended_pkgs; +} + +=item release_hold + +Unsuspends all suspended packages in the on-hold state (those without setup +dates) for this customer. + +=cut + +sub release_hold { + my $self = shift; + grep { (!$_->setup) && $_->unsuspend } $self->suspended_pkgs; } =item suspend