| 1 | package Finance::Tax::Aruba::BBO; | ||||||||||
| 2 | 2 | our $VERSION = '0.014'; | |||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: BBO (turnover tax) calculations for Aruba | ||||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | ▶ | use List::Util qw(first); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | use Module::Pluggable | ||||||||||
| 12 | 2 | ▶ | require => 1, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | sub_name => '_plugins', | ||||||||||
| 14 | search_path => 'Finance::Tax::Aruba::BBO', | ||||||||||
| 15 | 2 | ; | |||||||||
| 16 | |||||||||||
| 17 | 2 | our @years; | |||||||||
| 18 | |||||||||||
| 19 | 15 | ▶ | sub _years { | ||||||||
|
Subroutine
_years: called CC=2 SCAR=6.9
| |||||||||||
| 20 | 15 | ▶ | return @years if @years; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 1 | @years = shift->_plugins; | |||||||||
| 22 | 1 | return @years; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 15 | ▶ | sub tax_year { | ||||||||
|
Subroutine
tax_year: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 15 | my $self = shift; | |||||||||
| 27 | 15 | my $year = shift; | |||||||||
| 28 | |||||||||||
| 29 | 15 | my @years = $self->_years(); | |||||||||
| 30 | 15 | ▶ | my $module = first { $_->is_year($year) } @years; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 31 | 15 | ▶ | return $module->new(@_) if $module; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 1 | croak("Unable to find module for year $year"); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 2 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||