X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpay_batch%2FRBC.pm;h=7c165a315464934be42397fa0f91850effd081dc;hp=22521e0e104ee95ce0f9d44e20e4824e639ec4ef;hb=b48c02a92562395c84dbfe8c47db5c4ba14891a0;hpb=765aac1902113738afd1bcaee8eb25b44ee92e63 diff --git a/FS/FS/pay_batch/RBC.pm b/FS/FS/pay_batch/RBC.pm index 22521e0e1..7c165a315 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