diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /FS/FS/pay_batch/td_eft1464.pm | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'FS/FS/pay_batch/td_eft1464.pm')
-rw-r--r-- | FS/FS/pay_batch/td_eft1464.pm | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/FS/FS/pay_batch/td_eft1464.pm b/FS/FS/pay_batch/td_eft1464.pm deleted file mode 100644 index 7f58ab5..0000000 --- a/FS/FS/pay_batch/td_eft1464.pm +++ /dev/null @@ -1,156 +0,0 @@ -package FS::pay_batch::td_eft1464; - -use strict; -use vars qw(@ISA %import_info %export_info $name); -use Date::Format 'time2str'; -use FS::Conf; -use FS::Record qw(qsearch); - -=head1 NAME - -td_eft1464 - TD Commercial Banking EFT1464 format - -=head1 CONFIGURATION - -The Freeside option 'batchconfig-td_eft1464' must be set -with the following values on separate lines: - -=over 4 - -=item Originator ID - -=item TD Datacenter Location - -00400 - Vancouver -00410 - Montreal -00420 - Toronto -00430 - Halifax -00470 - Winnipeg -00490 - Calgary - -=item Short Name - -=item Long Name - -=item Returned Payment Branch (5 digits) - -=item Returned Payment Account - -=item Transaction Type Code - defaults to "437" (Internet access) - -=back - -=cut - -my $conf; -my %opt; -my $i; - -$name = 'td_eft1464'; -# TD Bank EFT 1464 Byte format - -%import_info = ( filetype => 'NONE' ); -# just to suppress warning; importing this format is a fatal error - -%export_info = ( - init => sub { - $conf = shift; - @opt{ - 'origid', - 'datacenter', - 'shortname', - 'longname', - 'retbranch', - 'retacct', - 'cpacode', - } = $conf->config("batchconfig-td_eft1464"); - $opt{'origid'} = sprintf('%-10s', $opt{'origid'}); - $opt{'shortname'} = sprintf('%-15s', $opt{'shortname'}); - $opt{'longname'} = sprintf('%-30s', $opt{'longname'}); - $opt{'retbranch'} = '0004'.sprintf('%5s',$opt{'retbranch'}); - $opt{'retacct'} = sprintf('%-11s', $opt{'retacct'}). ' '; - $i = 1; - }, - header => sub { - my $pay_batch = shift; - my @cust_pay_batch = @{(shift)}; - my $time = $pay_batch->download || time; - my $now = sprintf("%03u%03u", - (localtime(time))[5] % 100,#year since 1900 - (localtime(time))[7]+1);#day of year - - # Request settlement the next day - my $duedate = time+86400; - $opt{'due'} = sprintf("%03u%03u", - (localtime($duedate))[5] % 100, - (localtime($duedate))[7]+1); - - $opt{'fcn'} = - sprintf('%04u', ($pay_batch->batchnum % 9999)+1), # file creation number - join('', - 'A', #record type - sprintf('%09u', 1), #record number - $opt{'origid'}, - $opt{'fcn'}, - $now, - $opt{'datacenter'}, - ' ' x 1429, #filler - "\r" - ); - }, - row => sub { - my ($cust_pay_batch, $pay_batch) = @_; - my ($account, $aba) = split('@', $cust_pay_batch->payinfo); - $i++; - # The 1464 byte format supports up to 5 payments per line, - # but we're only going to send 1. - my $control = join('', - 'D', # for 'debit' - sprintf("%09u", $i), #record number - $opt{'origid'}, - $opt{'fcn'}, - ); - my $payment = join('', - $opt{'cpacode'} || 437, # CPA code, defaults to "Internet access" - sprintf('%010.0f', $cust_pay_batch->amount*100), - $opt{'due'}, #due date...? XXX - sprintf('%09u', $aba), - sprintf('%-12s', $account), - ' ' x 22, - '0' x 3, - $opt{'shortname'}, - sprintf('%-30s', - join(' ', - $cust_pay_batch->first, $cust_pay_batch->last) - ), - $opt{'longname'}, - $opt{'origid'}, - sprintf('%-19s', $cust_pay_batch->paybatchnum), # originator reference num - $opt{'retbranch'}, - $opt{'retacct'}, - ' ' x 15, - ' ' x 22, - ' ' x 2, - '0' x 11, - ); - return sprintf('%-1464s',$control . $payment) . "\r"; - }, - footer => sub { - my ($pay_batch, $batchcount, $batchtotal) = @_; - join('', - 'Z', - sprintf('%09u', $batchcount + 2), - $opt{'origid'}, - $opt{'fcn'}, - sprintf('%014.0f', $batchtotal*100), # total of debit txns - sprintf('%08u', $batchcount), # number of debit txns - '0' x 14, # total of credit txns - '0' x 8, # total of credit txns - ' ' x 1396, - "\r" - ) - }, -); - -1; - |