line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::EPTRN; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::EPTRN::VERSION = '0.004'; |
3
|
8
|
|
|
8
|
|
57
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
233
|
|
4
|
8
|
|
|
8
|
|
41
|
use warnings; |
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
201
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
3850
|
use Finance::AMEX::Transaction::EPTRN::Header; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
231
|
|
7
|
8
|
|
|
8
|
|
3956
|
use Finance::AMEX::Transaction::EPTRN::Summary; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
301
|
|
8
|
8
|
|
|
8
|
|
4382
|
use Finance::AMEX::Transaction::EPTRN::Detail::ChargeSummary; |
|
8
|
|
|
|
|
21
|
|
|
8
|
|
|
|
|
220
|
|
9
|
8
|
|
|
8
|
|
4271
|
use Finance::AMEX::Transaction::EPTRN::Detail::RecordSummary; |
|
8
|
|
|
|
|
27
|
|
|
8
|
|
|
|
|
296
|
|
10
|
8
|
|
|
8
|
|
4240
|
use Finance::AMEX::Transaction::EPTRN::Detail::Chargeback; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
222
|
|
11
|
8
|
|
|
8
|
|
4286
|
use Finance::AMEX::Transaction::EPTRN::Detail::Adjustment; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
226
|
|
12
|
8
|
|
|
8
|
|
4191
|
use Finance::AMEX::Transaction::EPTRN::Detail::Other; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
218
|
|
13
|
8
|
|
|
8
|
|
3764
|
use Finance::AMEX::Transaction::EPTRN::Trailer; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
206
|
|
14
|
8
|
|
|
8
|
|
3624
|
use Finance::AMEX::Transaction::EPTRN::Unknown; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
2764
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Transaction/Invoice Level Reconciliation (EPTRN) |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
1
|
|
|
1
|
1
|
6
|
my ($class, %props) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
8
|
my $type_map = { |
22
|
|
|
|
|
|
|
HEADER => 'Finance::AMEX::Transaction::EPTRN::Header', |
23
|
|
|
|
|
|
|
SUMMARY => 'Finance::AMEX::Transaction::EPTRN::Summary', |
24
|
|
|
|
|
|
|
SOC_DETAIL => 'Finance::AMEX::Transaction::EPTRN::Detail::ChargeSummary', |
25
|
|
|
|
|
|
|
ROC_DETAIL => 'Finance::AMEX::Transaction::EPTRN::Detail::RecordSummary', |
26
|
|
|
|
|
|
|
CHARGEBACK_DETAIL => 'Finance::AMEX::Transaction::EPTRN::Detail::Chargeback', |
27
|
|
|
|
|
|
|
ADJUSTMENT_DETAIL => 'Finance::AMEX::Transaction::EPTRN::Detail::Adjustment', |
28
|
|
|
|
|
|
|
OTHER_DETAIL => 'Finance::AMEX::Transaction::EPTRN::Detail::Other', |
29
|
|
|
|
|
|
|
TRAILER => 'Finance::AMEX::Transaction::EPTRN::Trailer', |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
5
|
my $self = bless { |
33
|
|
|
|
|
|
|
_type_map => $type_map, |
34
|
|
|
|
|
|
|
}, $class; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
4
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub parse_line { |
40
|
6
|
|
|
6
|
1
|
21
|
my ($self, $line) = @_; |
41
|
|
|
|
|
|
|
|
42
|
6
|
100
|
|
|
|
30
|
return if not defined $line; |
43
|
|
|
|
|
|
|
|
44
|
5
|
|
|
|
|
18
|
my $header_trailer_indicator = substr($line, 0, 5); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# DFHDR = header |
47
|
|
|
|
|
|
|
# DFTRL = trailer |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# 1-00 = Summary |
50
|
|
|
|
|
|
|
# 2-10 = SOC detail |
51
|
|
|
|
|
|
|
# 3-11 = ROC detail |
52
|
|
|
|
|
|
|
# 2-20 = Chargeback detail |
53
|
|
|
|
|
|
|
# 2-30 = Adjustment detail |
54
|
|
|
|
|
|
|
# 2-40, 2-41, 2-50 = Other Fees and Revenues detail |
55
|
|
|
|
|
|
|
|
56
|
5
|
|
|
|
|
16
|
my $indicator = 'UNKNOWN'; |
57
|
|
|
|
|
|
|
|
58
|
5
|
100
|
|
|
|
35
|
if ($header_trailer_indicator eq 'DFHDR') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
59
|
1
|
|
|
|
|
2
|
$indicator = 'HEADER'; |
60
|
|
|
|
|
|
|
} elsif ($header_trailer_indicator eq 'DFTRL') { |
61
|
1
|
|
|
|
|
3
|
$indicator = 'TRAILER'; |
62
|
|
|
|
|
|
|
} elsif ($indicator eq 'UNKNOWN') { |
63
|
3
|
|
|
|
|
19
|
my $summary_detail_indicator = join('-', substr($line, 42, 1), substr($line, 43, 2)); |
64
|
3
|
100
|
0
|
|
|
19
|
if ($summary_detail_indicator eq '1-00') { |
|
|
100
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
65
|
1
|
|
|
|
|
5
|
$indicator = 'SUMMARY'; |
66
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-10') { |
67
|
1
|
|
|
|
|
3
|
$indicator = 'SOC_DETAIL'; |
68
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-12') { |
69
|
0
|
|
|
|
|
0
|
$indicator = 'SOC_PRICING'; |
70
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-11') { |
71
|
1
|
|
|
|
|
3
|
$indicator = 'ROC_DETAIL'; |
72
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-13') { |
73
|
0
|
|
|
|
|
0
|
$indicator = 'ROC_PRICING'; |
74
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-20') { |
75
|
0
|
|
|
|
|
0
|
$indicator = 'CHARGEBACK_DETAIL'; |
76
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-30') { |
77
|
0
|
|
|
|
|
0
|
$indicator = 'ADJUSTMENT_DETAIL'; |
78
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-40' or $summary_detail_indicator eq '2-41' or $summary_detail_indicator eq '2-50') { |
79
|
0
|
|
|
|
|
0
|
$indicator = 'OTHER_DETAIL'; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
} |
82
|
5
|
50
|
|
|
|
30
|
if (exists $self->{_type_map}->{$indicator}) { |
83
|
5
|
|
|
|
|
88
|
return $self->{_type_map}->{$indicator}->new(line => $line); |
84
|
|
|
|
|
|
|
} |
85
|
0
|
|
|
|
|
|
return Finance::AMEX::Transaction::EPTRN::Unknown->new(line => $line); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |