release held packages when automatically unsuspending, RT#83847
[freeside.git] / FS / FS / cust_main_Mixin.pm
index 88b1bd0..95a5342 100644 (file)
@@ -650,7 +650,7 @@ or a list of search fields in the base64 encoded  cgi param search.
 sub process_customer_agent_transfer_search_result {
   my $job = shift;
 
-  my $param = shift;
+  my $param = thaw(decode_base64(shift));
   warn Dumper($param) if $DEBUG;
 
   $param->{'job'} = $job;
@@ -814,6 +814,8 @@ sub unsuspend_balance {
     my @errors = $cust_main->unsuspend(
                   'reason_type' => $conf->config('unsuspend_reason_type')
                 );
+
+    push @errors, $cust_main->release_hold if $conf->exists('unsuspend-unhold');
     # side-fx with nested transactions?  upstack rolls back?
     warn "WARNING:Errors unsuspending customer ". $cust_main->custnum. ": ".
          join(' / ', @errors)