replace FS::CGI::header function with header-popup component, related to #71249
[freeside.git] / httemplate / edit / process / cust_refund.cgi
index ce72c92..5a4b327 100755 (executable)
@@ -5,14 +5,14 @@
 %
 %  if ( $link eq 'popup' ) {
 %
-<% header('Refund entered') %>
+<& /elements/header-popup.html, 'Refund entered' &>
     <SCRIPT TYPE="text/javascript">
-      window.top.location.reload();
+      topreload();
     </SCRIPT>
 
     </BODY></HTML>
 %  } else {
-<% $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum;show=payment_history") %>
+<% $cgi->redirect(popurl(3). "view/cust_main.cgi?custnum=$custnum;show=payment_history") %>
 %  }
 %}
 <%init>
@@ -47,12 +47,11 @@ if ( $error ) {
   my $refund = "$1$2";
   $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
   my $paynum = $1;
-  my $reason = $cgi->param('reason');
   my $paydate = $cgi->param('exp_year'). '-'. $cgi->param('exp_month'). '-01';
   $options{'paydate'} = $paydate if $paydate =~ /^\d{2,4}-\d{1,2}-01$/;
   $error = $cust_main->realtime_refund_bop( $bop, 'amount' => $refund,
                                                   'paynum' => $paynum,
-                                                  'reason' => $reason,
+                                                  'reasonnum' => scalar($cgi->param('reasonnum')),
                                                   %options );
 } else {
   my %hash = map {