X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_refund.cgi;h=52fede8ecf28cff23d11c9fc989848810934a4d6;hb=8d953e7c2f94dc007d94da74650d27c5a74cc792;hp=bde40727a96bba85b25436effb5003320a3c395c;hpb=0af38652da3b3be7da2d35b048285ef6f2194e1a;p=freeside.git diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index bde40727a..52fede8ec 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -31,7 +31,7 @@ my $link = $cgi->param('popup') ? 'popup' : ''; my $payby = $cgi->param('payby'); my @rights = (); -push @rights, 'Post refund' if $payby =~ /^(BILL|CASH|MCRD)$/; +push @rights, 'Post refund' if $payby =~ /^(BILL|CASH|MCRD|MCHK)$/; push @rights, 'Post check refund' if $payby eq 'BILL'; push @rights, 'Post cash refund ' if $payby eq 'CASH'; push @rights, 'Refund payment' if $payby =~ /^(CARD|CHEK)$/; @@ -41,8 +41,13 @@ push @rights, 'Refund Echeck payment' if $payby eq 'CHEK'; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right(\@rights); -my $error = ''; -if ( $payby =~ /^(CARD|CHEK)$/ ) { +$cgi->param('reasonnum') =~ /^(-?\d+)$/ or die "Illegal reasonnum"; +my ($reasonnum, $error) = $m->comp('/misc/process/elements/reason'); +$cgi->param('reasonnum', $reasonnum) unless $error; + +if ( $error ) { + # do nothing +} elsif ( $payby =~ /^(CARD|CHEK)$/ ) { my %options = (); my $bop = $FS::payby::payby2bop{$1}; $cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/