summaryrefslogtreecommitdiff
path: root/FS/FS/pay_batch/td_eftack264.pm
diff options
context:
space:
mode:
authormark <mark>2010-11-30 23:44:28 +0000
committermark <mark>2010-11-30 23:44:28 +0000
commitb638e75f063e231edaf3f3859d27f3981c12c999 (patch)
tree13fe66fd830ab702d6341822d05908a85bb3c072 /FS/FS/pay_batch/td_eftack264.pm
parentc11efee177c39d3984d7b3769b50ed54c095c44f (diff)
TD EFT batch import formats, RT#10545
Diffstat (limited to 'FS/FS/pay_batch/td_eftack264.pm')
-rw-r--r--FS/FS/pay_batch/td_eftack264.pm59
1 files changed, 59 insertions, 0 deletions
diff --git a/FS/FS/pay_batch/td_eftack264.pm b/FS/FS/pay_batch/td_eftack264.pm
new file mode 100644
index 0000000..9ab16ef
--- /dev/null
+++ b/FS/FS/pay_batch/td_eftack264.pm
@@ -0,0 +1,59 @@
+package FS::pay_batch::td_eftack264;
+
+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_eftack264 - TD Commercial Banking EFT 264 byte acknowledgement file
+
+=cut
+
+$name = 'td_eftack264';
+
+%import_info = (
+ 'filetype' => 'fixed',
+ 'formatre' =>
+ '^(.)(.{9})(.{10})(.{4})(.{3})(.{10})(.{6})(.{9})(.{12}).{25}(.{15})(.{30})(.{30})(.{10})(.{19})(.{9})(.{12}).{15}.{22}(..)(.{11})$',
+ 'fields' => [ qw(
+ recordtype
+ count
+ origid
+ fcn
+ cpacode
+ paid
+ duedate
+ bank
+ payinfo
+ shortname
+ custname
+ longname
+ origid2
+ paybatchnum
+ retbranch
+ retacct
+ usdcode
+ invfield
+ ) ],
+ 'hook' => sub {
+ my $hash = shift;
+ $hash->{'_date'} = time;
+ $hash->{'paid'} = sprintf('%.2f', $hash->{'paid'} / 100);
+ $hash->{'payinfo'} =~ s/^(\S+).*/$1/; # remove trailing spaces
+ $hash->{'payinfo'} = $hash->{'payinfo'} . '@' . $hash->{'bank'};
+ },
+ 'approved' => sub { 0 },
+ 'declined' => sub { 1 },
+ 'skip_condition' => sub {
+ my $hash = shift;
+ $hash->{'recordtype'} ne 'D'; # Debit Detail record
+ },
+ 'close_condition' => sub { 0 },
+);
+
+%export_info = ( filetype => 'NONE' );
+1;
+