This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / FS / FS / pay_batch / td_eftret80.pm
1 package FS::pay_batch::td_eftret80;
2
3 use strict;
4 use vars qw(@ISA %import_info %export_info $name);
5
6 =head1 NAME
7
8 td_eftret80 - TD Commercial Banking EFT 80 byte returned item file
9
10 =cut
11
12 $name = 'td_eftret80';
13
14 %import_info = (
15   'filetype'    => 'fixed',
16   'formatre'    => '^(.)(.{20})(..)(.)(.{6})(.{19})(.{9})(.{12})(.{10})$',
17   'fields' => [ qw(
18     recordtype
19     custname
20     reason
21     verified
22     duedate
23     paybatchnum
24     bank
25     payinfo
26     amount
27     ) ],
28   'hook' => sub {
29     my $hash = shift;
30     $hash->{'_date'} = time;
31     $hash->{'paid'} = sprintf('%.2f', $hash->{'paid'} / 100);
32     $hash->{'payinfo'} =~ s/^(\S+).*/$1/; # these often have trailing spaces
33     $hash->{'payinfo'} = $hash->{'payinfo'} . '@' . $hash->{'bank'};
34   },
35   'approved' => sub { 0 },
36   'declined' => sub { 1 },
37   'skip_condition' => sub {
38       my $hash = shift;
39       $hash->{'recordtype'} ne 'D'; #Detail record
40   },
41   'close_condition' => sub { 0 }, # never close just from this
42 );
43
44 %export_info = ( filetype => 'NONE' );
45 1;
46