NL/Data.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 38 / 38 CC 3 SCAR 5.1
CC
3
Cov
100%
zones
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« NL.pm ↑ Summary
1 package Business::TNTPost::NL::Data;
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use vars qw($VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 9 ▶use YAML;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 $VERSION = 0.11;
10 9 @EXPORT = qw();
11 9 @EXPORT_OK = qw(zones table);
12 9 %EXPORT_TAGS = ("ALL" => [@EXPORT_OK]);
13  
14 =pod
15  
16 =head1 NAME
17  
18 Business::TNTPost::NL::Data - Shipping cost data for Business::TNTPost::NL
19  
20 =head1 DESCRIPTION
21  
22 Data module for Business::TNTPost::NL containing shipping cost
23 information, country zones etc.
24  
25 Nothing to see here, the show is over, move along please.
26  
27 =head2 METHODS
28  
29 The following methods are used and can be exported
30  
31 =head3 zones
32  
33 Returns a hashref with country and zone numbers
34  
35 =cut
36  
37 19 ▶sub zones {
Subroutine zones: called CC=3 SCAR=11.0
Pod documented
38 19 my %zones = (
39 0 => [ qw(NL) ], # NL
40 1 => [ qw(BE LU DK DE FR IT AT ES GB SE) ], # EU 1
41 2 => [ qw(BG EE FI HU IE LV LT PL PT RO SI SK CZ) ], # EU 2
42 3 => [ qw(AL AD BA IC CY FO GI GR GL IS HR LI MK MD MT
43 ME NO UA SM RS TR VA BY CH) ], # EU 3
44 );
45 19 my %z;
46 19 foreach my $key (keys %zones) {
47 76 foreach my $val (@{$zones{$key}}) {
48 912 $z{$val} = $key;
49 }
50 }
51 19 return \%z;
52 }
53  
54 =pod
55  
56 =head3 table
57  
58 This method contains the heart of this module, the lookup table
59  
60 =cut
61  
62 19 ▶sub table {
Subroutine table: called CC=1 SCAR=0.0
Pod documented
63 19 my $table = Load(<<'...');
64 ---
65 # Netherlands
66 netherlands:
67 # Letters (brievenbuspost)
68 small:
69 stamp:
70 '0,20': 0.46
71 '21,50': 0.92
72 '51,100': 1.38
73 '101,250': 1.84
74 '251,500': 2.30
75 '501,2000': 2.76
76 machine:
77 '0,20': 0.42
78 '21,50': 0.84
79 '51,100': 1.26
80 '101,250': 1.67
81 '251,500': 2.09
82 '501,2000': 2.51
83 # Parcels (paketten)
84 large:
85 '0,10000': 6.75
86 '10001,30000': 12.20
87 # Register (aangetekend)
88 register:
89 stamp:
90 '0,2000': 7.00
91 '2001,20000': 8.05
92 '20001,30000': 13.50
93 machine:
94 '0,2000': 6.79
95 '2001,10000': 8.05
96 # Outside of the Netherlands
97 world:
98 basic:
99 # Within Europe (EU1 & EU2)
100 europe:
101 # Letters (brievenbuspost)
102 small:
103 stamp:
104 priority:
105 '0,20': 0.79
106 '21,50': 1.58
107 '51,100': 2.37
108 '101,250': 3.16
109 '251,500': 6.32
110 '501,2000': 8.69
111 machine:
112 priority:
113 '0,20': 0.77
114 '21,50': 1.53
115 '51,100': 2.30
116 '101,250': 3.07
117 '251,500': 6.13
118 '501,2000': 8.43
119 # Outside Europe
120 world:
121 # Letters (brievenbuspost)
122 small:
123 stamp:
124 priority:
125 '0,20': 0.95
126 '21,50': 1.90
127 '51,100': 2.85
128 '101,250': 5.70
129 '251,500': 10.45
130 '501,2000': 16.15
131 machine:
132 priority:
133 '0,20': 0.92
134 '21,50': 1.84
135 '51,100': 2.76
136 '101,250': 5.53
137 '251,500': 10.14
138 '501,2000': 15.67
139 # Internationaal Pakket Plus (Track&Trace)
140 plus:
141 zone:
142 # EU1
143 1:
144 '0,2000': 13.00
145 '2001,5000': 19.50
146 '5001,10000': 25.00
147 '10001,20000': 34.00
148 '20001,30000': 40.46
149 # EU2
150 2:
151 '0,2000': 18.50
152 '2001,5000': 25.00
153 '5001,10000': 31.00
154 '10001,20000': 40.00
155 '20001,30000': 47.60
156 # EU3
157 3:
158 '0,2000': 19.30
159 '2001,5000': 26.30
160 '5001,10000': 32.30
161 '10001,20000': 42.30
162 # RoW
163 4:
164 '0,2000': 24.30
165 '2001,5000': 34.30
166 '5001,10000': 58.30
167 '10001,20000': 105.30
168 # Register ("aangetekend")
169 register:
170 europe:
171 stamp:
172 '0,2000': 9.48
173 machine:
174 '0,2000': 9.20
175 world:
176 stamp:
177 '0,2000': 16.15
178 machine:
179 '0,2000': 15.67
180 ...
181 19 return $table;
182 }
183  
184 =pod
185  
186 =head1 AUTHOR
187  
188 Menno Blom,
189 E<lt>blom@cpan.orgE<gt>,
190 L<http://menno.b10m.net/perl/>
191  
192 =head1 COPYRIGHT
193  
194 This program is free software; you can redistribute
195 it and/or modify it under the same terms as Perl itself.
196  
197 The full text of the license can be found in the
198 LICENSE file included with this module.
199  
200 =head1 SEE ALSO
201  
202 L<Business::TNTPost::NL>,
203 L<http://www.tntpost.nl/>
204  
205 =cut
206  
207 9 1;
« NL.pm ↑ Summary