summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-03-15 11:29:50 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-03-15 11:29:50 -0400
commit38f5c59a6a3b92881c0f60bc8dccc9acd0feef41 (patch)
tree42ba5cacaead27b0bf05fadaa0fc5a664c79d9dd /httemplate
parentbb201b08e3f48784cd77979dd4e31e866aa4f15d (diff)
RT# 83044 - fixed cc refund issues
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/edit/process/cust_refund.cgi7
-rw-r--r--httemplate/misc/download-batch.cgi5
-rw-r--r--httemplate/search/elements/cust_pay_batch_top.html2
3 files changed, 7 insertions, 7 deletions
diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi
index 25f6e00a1..f248d54b7 100755
--- a/httemplate/edit/process/cust_refund.cgi
+++ b/httemplate/edit/process/cust_refund.cgi
@@ -55,7 +55,7 @@ if ( $error ) {
'CHEK' => 'electronic check (ACH)',
);
-my( $cust_pay, $cust_payby, $payinfo, $paycvv, $month, $year, $payname );
+my( $cust_pay, $cust_payby, $payinfo, $paycvv, $month, $year, $payname, $paycardtype );
my $paymask = '';
## get cust pay info if paynum exists
@@ -89,6 +89,7 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
} elsif ( $cgi->param('paynum') > 0) {
$payinfo = $cust_pay->payinfo;
+ $paycardtype = $cust_pay->paycardtype;
$payname = $cust_pay->payname;
} else {
@@ -235,6 +236,10 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
$_, scalar($cgi->param($_))
} fields('cust_refund');
+ $hash{'payinfo'} = $payinfo;
+ $hash{'paymask'} = $paymask;
+ $hash{'paycardtype'} = $paycardtype;
+
## unapply payment before creating refund.
while ( $cust_pay && $cust_pay->unapplied < $refund ) {
my @cust_bill_pay = $cust_pay->cust_bill_pay;
diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi
index e4882d1e8..6ff649808 100644
--- a/httemplate/misc/download-batch.cgi
+++ b/httemplate/misc/download-batch.cgi
@@ -28,11 +28,6 @@ my $pay_batch = qsearchs({ 'select' => "*, $credit_transactions",
});
die "Batch not found: '$batchnum'" if !$pay_batch;
-if ($pay_batch->{Hash}->{arecredits}) {
- my $export_format = "FS::pay_batch::".$opt{'format'};
- die "You are trying to download a credit (batch refund) batch and The format ".$opt{'format'}." can not handle refunds.\n" unless $export_format->can('can_handle_credits');
-}
-
my $exporttext = $pay_batch->export_batch(%opt);
unless ($exporttext) {
http_header('Content-Type' => 'text/html' );
diff --git a/httemplate/search/elements/cust_pay_batch_top.html b/httemplate/search/elements/cust_pay_batch_top.html
index 90fc9e449..d29e487b2 100644
--- a/httemplate/search/elements/cust_pay_batch_top.html
+++ b/httemplate/search/elements/cust_pay_batch_top.html
@@ -146,7 +146,7 @@ tie my %upload_formats, 'Tie::IxHash', (
delete $upload_formats{'td_eft1464'};
$upload_formats{'PAP'} = '264 byte results for TD Canada Trust PAP Batch';
-if ($pay_batch->type eq "CREDIT") {
+if ($pay_batch->type eq "CREDIT" && $pay_batch->payby eq "CHEK") {
foreach my $key (keys %download_formats) {
delete $download_formats{$key} unless FS::pay_batch->can_handle_electronic_refunds($key);
## remove default format if unable to handle electronic refunds