line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use 5.014; |
2
|
1
|
|
|
1
|
|
83844
|
use warnings; |
|
1
|
|
|
|
|
11
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
4
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Date::Utility; |
8
|
1
|
|
|
1
|
|
440
|
use Exporter 'import'; |
|
1
|
|
|
|
|
1056339
|
|
|
1
|
|
|
|
|
106
|
|
9
|
1
|
|
|
1
|
|
11
|
use File::ShareDir; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
10
|
1
|
|
|
1
|
|
5
|
use YAML::XS qw/LoadFile/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
51
|
|
11
|
1
|
|
|
1
|
|
570
|
use utf8; |
|
1
|
|
|
|
|
2632
|
|
|
1
|
|
|
|
|
46
|
|
12
|
1
|
|
|
1
|
|
7
|
our @EXPORT_OK = qw(mifir_concat); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Finance::MIFIR::CONCAT - provides CONCAT code generation out of client data according to MIFIR rules |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Finance::MIFIR::CONCAT qw/mifir_concat/; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
print mifir_concat({ |
23
|
|
|
|
|
|
|
cc => 'DE', |
24
|
|
|
|
|
|
|
date => '1960-01-01', |
25
|
|
|
|
|
|
|
first_name => 'Jack', |
26
|
|
|
|
|
|
|
last_name => 'Daniels', |
27
|
|
|
|
|
|
|
}); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 mifir_concat |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Accepts hashref of person's data with keys: cc, date, first_name, last_name. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Returns string representing CONCATed MIFIR ID. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
our $config = LoadFile(File::ShareDir::dist_file('Finance-MIFIR-CONCAT', 'mifir.yml')); |
42
|
|
|
|
|
|
|
our $romanization = LoadFile(File::ShareDir::dist_file('Finance-MIFIR-CONCAT', 'romanization.yml')); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $args = shift; |
45
|
|
|
|
|
|
|
my $cc = $args->{cc}; |
46
|
3
|
|
|
3
|
1
|
5538
|
my $date = Date::Utility->new($args->{date})->date_yyyymmdd; |
47
|
3
|
|
|
|
|
6
|
$date =~ s/\-//g; |
48
|
3
|
|
|
|
|
16
|
my $first_name = _process_name($args->{first_name}); |
49
|
3
|
|
|
|
|
1134
|
my $last_name = _process_name($args->{last_name}); |
50
|
3
|
|
|
|
|
8
|
return uc($cc . $date . $first_name . $last_name); |
51
|
3
|
|
|
|
|
8
|
} |
52
|
3
|
|
|
|
|
19
|
|
53
|
|
|
|
|
|
|
my ($str) = @_; |
54
|
|
|
|
|
|
|
$str = lc($str); |
55
|
|
|
|
|
|
|
my $strip_re = join "|", (@{$config->{titles}}, @{$config->{prefixes}}); |
56
|
40
|
|
|
40
|
|
22435
|
$strip_re = qr/($strip_re)\s+/; |
57
|
40
|
|
|
|
|
450
|
$str =~ s/$strip_re//g; |
58
|
40
|
|
|
|
|
4955
|
my $re = join '', keys %$romanization; |
|
40
|
|
|
|
|
85
|
|
|
40
|
|
|
|
|
213
|
|
59
|
40
|
|
|
|
|
392
|
$re = qr/([$re])/; |
60
|
40
|
|
|
|
|
193
|
$str =~ s/$re/$romanization->{$1}/ge; |
61
|
40
|
|
|
|
|
934
|
$str =~ s/[^a-z]//g; |
62
|
40
|
|
|
|
|
370
|
$str = substr($str . '######', 0, 5); |
63
|
40
|
|
|
|
|
195
|
return $str; |
|
156
|
|
|
|
|
471
|
|
64
|
40
|
|
|
|
|
90
|
} |
65
|
40
|
|
|
|
|
106
|
|
66
|
40
|
|
|
|
|
174
|
1; |