summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-12-14 13:40:17 -0800
committerMark Wells <mark@freeside.biz>2015-12-14 13:40:17 -0800
commitb3db3e68f602f3ca395a6bc272a4de6fef2d0895 (patch)
treedbce2110be4a1c3114119910114e8c654180188b /httemplate/edit
parentf6c324e36edfbab5243c8b714ce34f04ad5bca91 (diff)
backport refund reasons, #39398
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_refund.cgi13
-rwxr-xr-xhttemplate/edit/process/cust_refund.cgi9
2 files changed, 15 insertions, 7 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi
index 3c189afe6..bfcbfe725 100755
--- a/httemplate/edit/cust_refund.cgi
+++ b/httemplate/edit/cust_refund.cgi
@@ -106,14 +106,17 @@
<INPUT TYPE="hidden" NAME="payinfo" VALUE="">
% }
- <TR>
- <TD ALIGN="right">Reason</TD>
- <TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="<% $reason %>"></TD>
- </TR>
+<& /elements/tr-select-reason.html,
+ 'field' => 'reasonnum',
+ 'reason_class' => 'F',
+ 'control_button' => "confirm_refund_button",
+ 'cgi' => $cgi,
+&>
+
</TABLE>
<BR>
-<INPUT TYPE="submit" NAME="submit" VALUE="Post refund">
+<INPUT TYPE="submit" ID="confirm_refund_button" VALUE="<% mt('Post refund') |h %>" DISABLED>
</FORM>
diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi
index 0fee6ed30..6ad468b6c 100755
--- a/httemplate/edit/process/cust_refund.cgi
+++ b/httemplate/edit/process/cust_refund.cgi
@@ -33,8 +33,13 @@ my $payby = $cgi->param('payby');
die "access denied"
unless $FS::CurrentUser::CurrentUser->refund_access_right($payby);
-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})?$/