summaryrefslogtreecommitdiff
path: root/FS/FS/pay_batch
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-03-10 19:12:20 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-03-11 09:14:22 -0400
commit6f08493827f30fe18fd99c32bbb1625b064017ec (patch)
tree4019237f1655cdf5f41fa38dc34e780c5265b700 /FS/FS/pay_batch
parent59b1fe7b375932fc13c920eb6f02b8da61d4c8fe (diff)
RT# 82988 - Fixed so only formats that can handle electronic refunds can download those files
Diffstat (limited to 'FS/FS/pay_batch')
-rw-r--r--FS/FS/pay_batch/RBC.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/FS/FS/pay_batch/RBC.pm b/FS/FS/pay_batch/RBC.pm
index 22521e0..7c165a3 100644
--- a/FS/FS/pay_batch/RBC.pm
+++ b/FS/FS/pay_batch/RBC.pm
@@ -154,7 +154,8 @@ $name = 'RBC';
my $pay_batch = shift;
my $mode = $testmode ? 'TEST' : 'PROD';
my $filenum = $testmode ? 'TEST' : sprintf("%04u", $pay_batch->batchnum);
- '$$AAPASTD0152['.$mode.'[NL$$'."\n".
+ my $qualifier = $pay_batch->type eq 'CREDIT' ? 'D' : 'A';
+ '$$AAP'.$qualifier.'STD0152['.$mode.'[NL$$'."\n".
'000001'.
'A'.
'HDR'.
@@ -219,13 +220,15 @@ $name = 'RBC';
},
footer => sub {
my ($pay_batch, $batchcount, $batchtotal) = @_;
+
+ my $batch_info = '0' x 20 . sprintf("%06u", $batchcount) . sprintf("%014.0f", $batchtotal*100);
+ $batch_info = sprintf("%06u", $batchcount) . sprintf("%014.0f", $batchtotal*100) . '0' x 20 if ($pay_batch->type eq 'CREDIT');
+
sprintf("%06u", $i + 1).
'Z'.
'TRL'.
sprintf("%10s", $client_num).
- '0' x 20 .
- sprintf("%06u", $batchcount).
- sprintf("%014.0f", $batchtotal*100).
+ $batch_info.
'00' .
'000000' . # total number of customer information records
' ' x 84