X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=57abc18ab2deaac82f44c1860dc92153d61c95b1;hb=56d10a0d13cc291eb5ee6197c35b10407794f89c;hp=e1d3caafef938e82d4a7aedc194c6339779b91f7;hpb=aa59cc83ffa65da2fce9b5be42f483d9b17d91c0;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e1d3caafe..57abc18ab 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2092,6 +2092,7 @@ Returns a list of fields which have ship_ duplicates. sub addr_fields { qw( last first company + locationname address1 address2 city county state zip country latitude longitude daytime night fax mobile @@ -2149,14 +2150,27 @@ sub cust_contact { =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