line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::AMEX::Transaction::EPPRC; |
2
|
|
|
|
|
|
|
$Finance::AMEX::Transaction::EPPRC::VERSION = '0.004'; |
3
|
8
|
|
|
8
|
|
55
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
246
|
|
4
|
8
|
|
|
8
|
|
41
|
use warnings; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
208
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
3872
|
use Finance::AMEX::Transaction::EPPRC::Header; |
|
8
|
|
|
|
|
23
|
|
|
8
|
|
|
|
|
226
|
|
7
|
8
|
|
|
8
|
|
3914
|
use Finance::AMEX::Transaction::EPPRC::Summary; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
216
|
|
8
|
8
|
|
|
8
|
|
4492
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummary; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
221
|
|
9
|
8
|
|
|
8
|
|
4823
|
use Finance::AMEX::Transaction::EPPRC::Detail::ChargeSummaryPricing; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
231
|
|
10
|
8
|
|
|
8
|
|
4421
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummary; |
|
8
|
|
|
|
|
29
|
|
|
8
|
|
|
|
|
236
|
|
11
|
8
|
|
|
8
|
|
4373
|
use Finance::AMEX::Transaction::EPPRC::Detail::RecordSummaryPricing; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
240
|
|
12
|
8
|
|
|
8
|
|
4390
|
use Finance::AMEX::Transaction::EPPRC::Detail::Chargeback; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
241
|
|
13
|
8
|
|
|
8
|
|
4500
|
use Finance::AMEX::Transaction::EPPRC::Detail::Adjustment; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
248
|
|
14
|
8
|
|
|
8
|
|
4048
|
use Finance::AMEX::Transaction::EPPRC::Detail::Other; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
222
|
|
15
|
8
|
|
|
8
|
|
3803
|
use Finance::AMEX::Transaction::EPPRC::Trailer; |
|
8
|
|
|
|
|
25
|
|
|
8
|
|
|
|
|
209
|
|
16
|
8
|
|
|
8
|
|
3651
|
use Finance::AMEX::Transaction::EPPRC::Unknown; |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
2844
|
|
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
|
|
|
|
|
10
|
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
|
|
|
|
|
4
|
my $self = bless { |
37
|
|
|
|
|
|
|
_type_map => $type_map, |
38
|
|
|
|
|
|
|
}, $class; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
5
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub parse_line { |
44
|
1132
|
|
|
1132
|
1
|
2897
|
my ($self, $line) = @_; |
45
|
|
|
|
|
|
|
|
46
|
1132
|
100
|
|
|
|
3603
|
return if not defined $line; |
47
|
|
|
|
|
|
|
|
48
|
1131
|
|
|
|
|
3421
|
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
|
|
|
|
|
2885
|
my $indicator = 'UNKNOWN'; |
63
|
|
|
|
|
|
|
|
64
|
1131
|
100
|
|
|
|
5943
|
if ($header_trailer_indicator eq 'DFHDR') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
65
|
45
|
|
|
|
|
99
|
$indicator = 'HEADER'; |
66
|
|
|
|
|
|
|
} elsif ($header_trailer_indicator eq 'DFTRL') { |
67
|
45
|
|
|
|
|
149
|
$indicator = 'TRAILER'; |
68
|
|
|
|
|
|
|
} elsif ($indicator eq 'UNKNOWN') { |
69
|
1041
|
|
|
|
|
4878
|
my $summary_detail_indicator = join('-', substr($line, 42, 1), substr($line, 43, 2)); |
70
|
1041
|
100
|
33
|
|
|
7103
|
if ($summary_detail_indicator eq '1-00') { |
|
|
100
|
33
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
71
|
60
|
|
|
|
|
166
|
$indicator = 'SUMMARY'; |
72
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-10') { |
73
|
65
|
|
|
|
|
193
|
$indicator = 'SOC_DETAIL'; |
74
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '2-12') { |
75
|
18
|
|
|
|
|
54
|
$indicator = 'SOC_PRICING'; |
76
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-11') { |
77
|
541
|
|
|
|
|
1380
|
$indicator = 'ROC_DETAIL'; |
78
|
|
|
|
|
|
|
} elsif ($summary_detail_indicator eq '3-13') { |
79
|
333
|
|
|
|
|
719
|
$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
|
|
|
|
|
27
|
$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
|
|
|
|
|
42
|
$indicator = 'OTHER_DETAIL'; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
1131
|
50
|
|
|
|
5327
|
if (exists $self->{_type_map}->{$indicator}) { |
89
|
1131
|
|
|
|
|
7156
|
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__ |