line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::EPPRC; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::EPPRC::VERSION = '0.003'; |
3
|
7
|
|
|
7
|
|
46
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
225
|
|
4
|
7
|
|
|
7
|
|
37
|
use warnings; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
159
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
2988
|
use Finance::AMEX::Transaction::EPPRC::Header; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
180
|
|
7
|
7
|
|
|
7
|
|
2984
|
use Finance::AMEX::Transaction::EPPRC::Summary; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
167
|
|
8
|
7
|
|
|
7
|
|
3355
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummary; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
174
|
|
9
|
7
|
|
|
7
|
|
3601
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummaryPricing; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
173
|
|
10
|
7
|
|
|
7
|
|
3326
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummary; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
169
|
|
11
|
7
|
|
|
7
|
|
3266
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummaryPricing; |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
195
|
|
12
|
7
|
|
|
7
|
|
3216
|
use Finance::AMEX::Transaction::EPPRC::Detail::Chargeback; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
183
|
|
13
|
7
|
|
|
7
|
|
3386
|
use Finance::AMEX::Transaction::EPPRC::Detail::Adjustment; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
185
|
|
14
|
7
|
|
|
7
|
|
3063
|
use Finance::AMEX::Transaction::EPPRC::Detail::Other; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
187
|
|
15
|
7
|
|
|
7
|
|
2943
|
use Finance::AMEX::Transaction::EPPRC::Trailer; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
176
|
|
16
|
7
|
|
|
7
|
|
2782
|
use Finance::AMEX::Transaction::EPPRC::Unknown; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
2268
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Transaction/Invoice Level Reconciliation (EPPRC) |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
1
|
5
|
my ($class, %props) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
11
|
my $type_map = { |
24
|
|
|
|
|
|
|
HEADER => 'Finance::AMEX::Transaction::EPPRC::Header', |
25
|
|
|
|
|
|
|
SUMMARY => 'Finance::AMEX::Transaction::EPPRC::Summary', |
26
|
|
|
|
|
|
|
SOC_DETAIL => 'Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummary', |
27
|
|
|
|
|
|
|
SOC_PRICING => 'Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummaryPricing', |
28
|
|
|
|
|
|
|
ROC_DETAIL => 'Finance::AMEX::Transaction::EPPRC::Detail::RecordSummary', |
29
|
|
|
|
|
|
|
ROC_PRICING => 'Finance::AMEX::Transaction::EPPRC::Detail::RecordSummaryPricing', |
30
|
|
|
|
|
|
|
CHARGEBACK_DETAIL => 'Finance::AMEX::Transaction::EPPRC::Detail::Chargeback', |
31
|
|
|
|
|
|
|
ADJUSTMENT_DETAIL => 'Finance::AMEX::Transaction::EPPRC::Detail::Adjustment', |
32
|
|
|
|
|
|
|
OTHER_DETAIL => 'Finance::AMEX::Transaction::EPPRC::Detail::Other', |
33
|
|
|
|
|
|
|
TRAILER => 'Finance::AMEX::Transaction::EPPRC::Trailer', |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
5
|
my $self = bless { |
37
|
|
|
|
|
|
|
_type_map => $type_map, |
38
|
|
|
|
|
|
|
}, $class; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
3
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub parse_line { |
44
|
1132
|
|
|
1132
|
1
|
2436
|
my ($self, $line) = @_; |
45
|
|
|
|
|
|
|
|
46
|
1132
|
100
|
|
|
|
3242
|
return if not defined $line; |
47
|
|
|
|
|
|
|
|
48
|
1131
|
|
|
|
|
2779
|
my $header_trailer_indicator = substr($line, 0, 5); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# DFHDR = header |
51
|
|
|
|
|
|
|
# DFTRL = trailer |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# 1-00 = Summary |
54
|
|
|
|
|
|
|
# 2-10 = SOC detail |
55
|
|
|
|
|
|
|
# 2-12 = SOC pricing |
56
|
|
|
|
|
|
|
# 3-11 = ROC detail |
57
|
|
|
|
|
|
|
# 3-13 = ROC pricing |
58
|
|
|
|
|
|
|
# 2-20 = Chargeback detail |
59
|
|
|
|
|
|
|
# 2-30 = Adjustment detail |
60
|
|
|
|
|
|
|
# 2-40, 2-41, 2-50 = Other Fees and Revenues detail |
61
|
|
|
|
|
|
|
|
62
|
1131
|
|
|
|
|
2004
|
my $indicator = 'UNKNOWN'; |
63
|
|
|
|
|
|
|
|
64
|
1131
|
100
|
|
|
|
4652
|
if ($header_trailer_indicator eq 'DFHDR') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
65
|
45
|
|
|
|
|
91
|
$indicator = 'HEADER'; |
66
|
|
|
|
|
|
|
} elsif ($header_trailer_indicator eq 'DFTRL') { |
67
|
45
|
|
|
|
|
129
|
$indicator = 'TRAILER'; |
68
|
|
|
|
|
|
|
} elsif ($indicator eq 'UNKNOWN') { |
69
|
1041
|
|
|
|
|
3237
|
my $summary_detail_indicator = join('-', substr($line, 42, 1), substr($line, 43, 2)); |
70
|
1041
|
100
|
33
|
|
|
4812
|
if ($summary_detail_indicator eq '1-00') { |
|
|
100
|
33
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
71
|
60
|
|
|
|
|
137
|
$indicator = 'SUMMARY'; |
72
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-10') { |
73
|
65
|
|
|
|
|
169
|
$indicator = 'SOC_DETAIL'; |
74
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-12') { |
75
|
18
|
|
|
|
|
49
|
$indicator = 'SOC_PRICING'; |
76
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-11') { |
77
|
541
|
|
|
|
|
1184
|
$indicator = 'ROC_DETAIL'; |
78
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-13') { |
79
|
333
|
|
|
|
|
714
|
$indicator = 'ROC_PRICING'; |
80
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-20') { |
81
|
0
|
|
|
|
|
0
|
$indicator = 'CHARGEBACK_DETAIL'; |
82
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-30') { |
83
|
9
|
|
|
|
|
20
|
$indicator = 'ADJUSTMENT_DETAIL'; |
84
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-40' or $summary_detail_indicator eq '2-41' or $summary_detail_indicator eq '2-50') { |
85
|
15
|
|
|
|
|
43
|
$indicator = 'OTHER_DETAIL'; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
1131
|
50
|
|
|
|
3342
|
if (exists $self->{_type_map}->{$indicator}) { |
89
|
1131
|
|
|
|
|
5424
|
return $self->{_type_map}->{$indicator}->new(line => $line); |
90
|
|
|
|
|
|
|
} |
91
|
0
|
|
|
|
|
|
return Finance::AMEX::Transaction::EPPRC::Unknown->new(line => $line); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |