diff options
author | Mark Wells <mark@freeside.biz> | 2015-01-22 17:29:48 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-01-22 17:29:48 -0800 |
commit | 2073798304acbd9402f73e0dee7507a7a4d22ceb (patch) | |
tree | c6cc427365553521fc6bcc2e9397905e69660147 /httemplate/edit | |
parent | c113c2681677d34974e9d63b631904770e25e3c0 (diff) |
unsnarl creation of credit/refund reasons, partial fallout from #31702
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/cust_refund.cgi | 2 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_refund.cgi | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi index 9f7ac8dee..f9095fd7a 100755 --- a/httemplate/edit/cust_refund.cgi +++ b/httemplate/edit/cust_refund.cgi @@ -109,7 +109,7 @@ <& /elements/tr-select-reason.html, 'field' => 'reasonnum', 'reason_class' => 'F', - 'control_button' => "document.getElementById('confirm_refund_button')", + 'control_button' => "confirm_refund_button", 'cgi' => $cgi, &> diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi index bde40727a..599c8b8e2 100755 --- a/httemplate/edit/process/cust_refund.cgi +++ b/httemplate/edit/process/cust_refund.cgi @@ -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})?$/ |