summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_refund.cgi1
-rwxr-xr-xhttemplate/edit/process/cust_refund.cgi9
2 files changed, 8 insertions, 2 deletions
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi
index 425c17738..8955c7cee 100755
--- a/httemplate/edit/cust_refund.cgi
+++ b/httemplate/edit/cust_refund.cgi
@@ -49,6 +49,7 @@ if ( $cust_pay ) {
my $payby = $cust_pay->payby;
my $payinfo = $cust_pay->payinfo;
$payby =~ s/^BILL$/Check/ if $payinfo;
+ $payby =~ s/^CHEK$/Electronic check/;
$payinfo = $cust_pay->payinfo_masked if $payby eq 'CARD';
print '<BR>Payment'. ntable("#cccccc", 2).
diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi
index fc1635781..7055d8ea6 100755
--- a/httemplate/edit/process/cust_refund.cgi
+++ b/httemplate/edit/process/cust_refund.cgi
@@ -6,14 +6,19 @@ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
or die "unknown custnum $custnum";
my $error = '';
-if ( $cgi->param('payby') eq 'CARD' ) {
+if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) {
+ my %payby2bop = (
+ 'CARD' => 'CC',
+ 'CHEK' => 'ECHECK',
+ );
+ my $bop = $payby2bop{$1};
$cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/
or die "illegal refund amount ". $cgi->param('refund');
my $refund = "$1$2";
$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
my $paynum = $1;
my $reason = $cgi->param('reason');
- $error = $cust_main->realtime_refund_bop( 'CC', 'amount' => $refund,
+ $error = $cust_main->realtime_refund_bop( $bop, 'amount' => $refund,
'paynum' => $paynum,
'reason' => $reason, );
} else {