summaryrefslogtreecommitdiff
path: root/httemplate/misc/cust_main-unsuspend.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-09-16 21:38:07 -0700
committerMark Wells <mark@freeside.biz>2014-09-16 21:38:15 -0700
commit7a486dea647f735a9a1d0381443218ad6affe6e1 (patch)
tree33fffd4cfdf1288767ba61da6ee58c358daaa76a /httemplate/misc/cust_main-unsuspend.cgi
parent43da86c4a7fab275a941650abb11173f4f2930aa (diff)
improve unsuspend behavior for packages on hold, #28508
Diffstat (limited to 'httemplate/misc/cust_main-unsuspend.cgi')
-rwxr-xr-xhttemplate/misc/cust_main-unsuspend.cgi10
1 files changed, 9 insertions, 1 deletions
diff --git a/httemplate/misc/cust_main-unsuspend.cgi b/httemplate/misc/cust_main-unsuspend.cgi
index eb4a2c8f8..e8ac8d31e 100755
--- a/httemplate/misc/cust_main-unsuspend.cgi
+++ b/httemplate/misc/cust_main-unsuspend.cgi
@@ -34,6 +34,10 @@ if($cgi->param('now_or_later')) {
if($resume) {
#warn "setting resume dates on custnum#$custnum\n";
my @pkgs = $cust_main->suspended_pkgs;
+ if (!$cgi->param('release_hold')) {
+ # then avoid packages that are on hold
+ @pkgs = grep { $_->get('setup') } @pkgs;
+ }
@errors = grep {$_} map { $_->unsuspend(
'date' => $resume,
) } @pkgs;
@@ -42,9 +46,13 @@ if($cgi->param('now_or_later')) {
@errors = ("error parsing adjourn date: ".$cgi->param('adjourn'));
}
}
-else {
+else { # unsuspending now
warn "unsuspending $cust_main";
@errors = $cust_main->unsuspend;
+
+ if ( $cgi->param('release_hold') ) {
+ push @errors, $cust_main->release_hold;
+ }
}
my $error = join(' / ', @errors) if scalar(@errors);