This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / FS / FS / pay_batch / td_eftack264.pm
1 package FS::pay_batch::td_eftack264;
2
3 use strict;
4 use vars qw(@ISA %import_info %export_info $name);
5 use Date::Format 'time2str';
6 use FS::Conf;
7 use FS::Record qw(qsearch);
8
9 =head1 NAME
10
11 td_eftack264 - TD Commercial Banking EFT 264 byte acknowledgement file
12
13 =cut
14
15 $name = 'td_eftack264';
16
17 %import_info = (
18   'filetype'    => 'fixed',
19   'formatre'    => 
20   '^(.)(.{9})(.{10})(.{4})(.{3})(.{10})(.{6})(.{9})(.{12}).{25}(.{15})(.{30})(.{30})(.{10})(.{19})(.{9})(.{12}).{15}.{22}(..)(.{11})$',
21   'fields' => [ qw(
22     recordtype
23     count
24     origid
25     fcn
26     cpacode
27     paid
28     duedate
29     bank
30     payinfo
31     shortname
32     custname
33     longname
34     origid2
35     paybatchnum
36     retbranch
37     retacct
38     usdcode
39     invfield
40     ) ],
41   'hook' => sub {
42     my $hash = shift;
43     $hash->{'_date'} = time;
44     $hash->{'paid'} = sprintf('%.2f', $hash->{'paid'} / 100);
45     $hash->{'payinfo'} =~ s/^(\S+).*/$1/; # remove trailing spaces
46     $hash->{'payinfo'} = $hash->{'payinfo'} . '@' . $hash->{'bank'};
47   },
48   'approved'    => sub { 0 },
49   'declined'    => sub { 1 },
50   'skip_condition' => sub {
51     my $hash = shift;
52     $hash->{'recordtype'} ne 'D'; # Debit Detail record
53   },
54   'close_condition' => sub { 0 },
55 );
56
57 %export_info = ( filetype => 'NONE' );
58 1;
59