summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-01-22 17:29:48 -0800
committerMark Wells <mark@freeside.biz>2015-01-22 17:29:48 -0800
commit2073798304acbd9402f73e0dee7507a7a4d22ceb (patch)
treec6cc427365553521fc6bcc2e9397905e69660147 /httemplate
parentc113c2681677d34974e9d63b631904770e25e3c0 (diff)
unsnarl creation of credit/refund reasons, partial fallout from #31702
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/cust_refund.cgi2
-rwxr-xr-xhttemplate/edit/process/cust_refund.cgi9
-rw-r--r--httemplate/view/cust_main/payment_history.html2
3 files changed, 9 insertions, 4 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})?$/
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index fcc4470a0..a8f2f861a 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -97,7 +97,7 @@
'action' => "${p}edit/cust_refund.cgi?popup=1;payby=BILL",
'cust_main' => $cust_main,
'actionlabel' => emt('Enter check refund'),
- 'width' => 392,
+ 'width' => 440,
&>
% }