line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::EPTRN; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::EPTRN::VERSION = '0.003'; |
3
|
7
|
|
|
7
|
|
55
|
use strict; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
187
|
|
4
|
7
|
|
|
7
|
|
35
|
use warnings; |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
162
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
3014
|
use Finance::AMEX::Transaction::EPTRN::Header; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
229
|
|
7
|
7
|
|
|
7
|
|
2942
|
use Finance::AMEX::Transaction::EPTRN::Summary; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
223
|
|
8
|
7
|
|
|
7
|
|
3313
|
use Finance::AMEX::Transaction::EPTRN::Detail::ChargeSummary; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
180
|
|
9
|
7
|
|
|
7
|
|
3695
|
use Finance::AMEX::Transaction::EPTRN::Detail::RecordSummary; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
183
|
|
10
|
7
|
|
|
7
|
|
3156
|
use Finance::AMEX::Transaction::EPTRN::Detail::Chargeback; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
170
|
|
11
|
7
|
|
|
7
|
|
3088
|
use Finance::AMEX::Transaction::EPTRN::Detail::Adjustment; |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
169
|
|
12
|
7
|
|
|
7
|
|
3289
|
use Finance::AMEX::Transaction::EPTRN::Detail::Other; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
176
|
|
13
|
7
|
|
|
7
|
|
2881
|
use Finance::AMEX::Transaction::EPTRN::Trailer; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
172
|
|
14
|
7
|
|
|
7
|
|
2813
|
use Finance::AMEX::Transaction::EPTRN::Unknown; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
2226
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Transaction/Invoice Level Reconciliation (EPTRN) |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
1
|
|
|
1
|
1
|
3
|
my ($class, %props) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
5
|
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
|
|
|
|
|
3
|
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
|
14
|
my ($self, $line) = @_; |
41
|
|
|
|
|
|
|
|
42
|
6
|
100
|
|
|
|
17
|
return if not defined $line; |
43
|
|
|
|
|
|
|
|
44
|
5
|
|
|
|
|
14
|
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
|
|
|
|
|
9
|
my $indicator = 'UNKNOWN'; |
57
|
|
|
|
|
|
|
|
58
|
5
|
100
|
|
|
|
23
|
if ($header_trailer_indicator eq 'DFHDR') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
59
|
1
|
|
|
|
|
2
|
$indicator = 'HEADER'; |
60
|
|
|
|
|
|
|
} elsif ($header_trailer_indicator eq 'DFTRL') { |
61
|
1
|
|
|
|
|
1
|
$indicator = 'TRAILER'; |
62
|
|
|
|
|
|
|
} elsif ($indicator eq 'UNKNOWN') { |
63
|
3
|
|
|
|
|
12
|
my $summary_detail_indicator = join('-', substr($line, 42, 1), substr($line, 43, 2)); |
64
|
3
|
100
|
0
|
|
|
13
|
if ($summary_detail_indicator eq '1-00') { |
|
|
100
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
65
|
1
|
|
|
|
|
1
|
$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
|
|
|
|
|
2
|
$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
|
|
|
|
20
|
if (exists $self->{_type_map}->{$indicator}) { |
83
|
5
|
|
|
|
|
53
|
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__ |