line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::EPPRC 0.005; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
54
|
use strict; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
362
|
|
4
|
9
|
|
|
9
|
|
45
|
use warnings; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
190
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
3347
|
use Finance::AMEX::Transaction::EPPRC::Header; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
209
|
|
7
|
9
|
|
|
9
|
|
3301
|
use Finance::AMEX::Transaction::EPPRC::Summary; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
202
|
|
8
|
9
|
|
|
9
|
|
4246
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummary; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
192
|
|
9
|
9
|
|
|
9
|
|
3801
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummaryPricing; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
598
|
|
10
|
9
|
|
|
9
|
|
3585
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummary; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
193
|
|
11
|
9
|
|
|
9
|
|
3678
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummaryPricing; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
198
|
|
12
|
9
|
|
|
9
|
|
3561
|
use Finance::AMEX::Transaction::EPPRC::Detail::Chargeback; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
210
|
|
13
|
9
|
|
|
9
|
|
3805
|
use Finance::AMEX::Transaction::EPPRC::Detail::Adjustment; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
204
|
|
14
|
9
|
|
|
9
|
|
3391
|
use Finance::AMEX::Transaction::EPPRC::Detail::Other; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
210
|
|
15
|
9
|
|
|
9
|
|
3258
|
use Finance::AMEX::Transaction::EPPRC::Trailer; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
186
|
|
16
|
9
|
|
|
9
|
|
3152
|
use Finance::AMEX::Transaction::EPPRC::Unknown; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
2783
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# ABSTRACT: Parse AMEX Transaction/Invoice Level Reconciliation (EPPRC) |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new { |
21
|
1
|
|
|
1
|
1
|
4
|
my ($class, %props) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
6
|
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
|
|
|
|
|
3
|
my $self = bless {_type_map => $type_map}, $class; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
4
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
3
|
1
|
8
|
sub file_format {return 'N/A'} |
42
|
3
|
|
|
3
|
1
|
16
|
sub file_version {return 'N/A'} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub line_indicator { |
45
|
1131
|
|
|
1131
|
1
|
1946
|
my ($self, $line) = @_; |
46
|
|
|
|
|
|
|
|
47
|
1131
|
50
|
|
|
|
2126
|
return if not defined $line; |
48
|
|
|
|
|
|
|
|
49
|
1131
|
|
|
|
|
2250
|
my $header_trailer_indicator = substr($line, 0, 5); |
50
|
|
|
|
|
|
|
|
51
|
1131
|
|
|
|
|
3359
|
my $indicator_map = { |
52
|
|
|
|
|
|
|
DFHDR => 'HEADER', |
53
|
|
|
|
|
|
|
DFTRL => 'TRAILER', |
54
|
|
|
|
|
|
|
}; |
55
|
|
|
|
|
|
|
|
56
|
1131
|
100
|
|
|
|
2602
|
if (exists $indicator_map->{$header_trailer_indicator}) { |
57
|
90
|
|
|
|
|
255
|
return $indicator_map->{$header_trailer_indicator}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# if it is not a header or trailer, we need to look deeper |
61
|
1041
|
|
|
|
|
3159
|
my $summary_detail_indicator = join('-', substr($line, 42, 1), substr($line, 43, 2)); |
62
|
|
|
|
|
|
|
|
63
|
1041
|
|
|
|
|
6274
|
my $summary_map = { |
64
|
|
|
|
|
|
|
'1-00' => 'SUMMARY', |
65
|
|
|
|
|
|
|
'2-10' => 'SOC_DETAIL', |
66
|
|
|
|
|
|
|
'2-12' => 'SOC_PRICING', |
67
|
|
|
|
|
|
|
'3-11' => 'ROC_DETAIL', |
68
|
|
|
|
|
|
|
'3-13' => 'ROC_PRICING', |
69
|
|
|
|
|
|
|
'2-20' => 'CHARGEBACK_DETAIL', |
70
|
|
|
|
|
|
|
'2-30' => 'ADJUSTMENT_DETAIL', |
71
|
|
|
|
|
|
|
'2-40' => 'OTHER_DETAIL', |
72
|
|
|
|
|
|
|
'2-41' => 'OTHER_DETAIL', |
73
|
|
|
|
|
|
|
'2-50' => 'OTHER_DETAIL', |
74
|
|
|
|
|
|
|
}; |
75
|
|
|
|
|
|
|
|
76
|
1041
|
50
|
|
|
|
2307
|
if (exists $summary_map->{$summary_detail_indicator}) { |
77
|
1041
|
|
|
|
|
4168
|
return $summary_map->{$summary_detail_indicator}; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# we don't know what it is! |
81
|
0
|
|
|
|
|
0
|
return; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub parse_line { |
85
|
1132
|
|
|
1132
|
1
|
1982
|
my ($self, $line) = @_; |
86
|
|
|
|
|
|
|
|
87
|
1132
|
100
|
|
|
|
2549
|
return if not defined $line; |
88
|
|
|
|
|
|
|
|
89
|
1131
|
|
|
|
|
2271
|
my $indicator = $self->line_indicator($line); |
90
|
|
|
|
|
|
|
|
91
|
1131
|
50
|
33
|
|
|
5500
|
if ($indicator and exists $self->{_type_map}->{$indicator}) { |
92
|
1131
|
|
|
|
|
5069
|
return $self->{_type_map}->{$indicator}->new(line => $line); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
return Finance::AMEX::Transaction::EPPRC::Unknown->new(line => $line); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__END__ |