line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::RO::TaxDeduction::Role::Utils; |
2
|
|
|
|
|
|
|
$Business::RO::TaxDeduction::Role::Utils::VERSION = '0.010'; |
3
|
|
|
|
|
|
|
# ABSTRACT: A utility role |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
7610
|
use Moo::Role; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
23
|
|
6
|
4
|
|
|
|
|
24
|
use Business::RO::TaxDeduction::Types qw( |
7
|
|
|
|
|
|
|
Int |
8
|
4
|
|
|
4
|
|
1292
|
); |
|
4
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'year' => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => Int, |
13
|
|
|
|
|
|
|
default => sub { 2016 }, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'base_year' => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => Int, |
19
|
|
|
|
|
|
|
lazy => 1, |
20
|
|
|
|
|
|
|
default => sub { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
if ($self->year >= 2016) { |
23
|
|
|
|
|
|
|
return 2016; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
elsif ($self->year >= 2005) { |
26
|
|
|
|
|
|
|
return 2005; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
|
|
|
|
|
|
die "The tax deduction does not apply before 2005!"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |