line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Number::Object::Plugin::Tax::AU::GST; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
32675
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
71
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
11
|
use base 'Number::Object::Plugin::Tax'; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
2047
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.06; |
9
|
|
|
|
|
|
|
our $RATE = 1.1; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub calc { |
12
|
2
|
|
|
2
|
0
|
8177
|
my($self, $c) = @_; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
8
|
my $price = $c->{value}; |
15
|
2
|
|
|
|
|
5
|
my $total = $price * $RATE; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
12
|
return $total - $price; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub deduct_tax : Method { |
21
|
1
|
|
|
1
|
0
|
567
|
my ($self, $c) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
2
|
my $price = $c->{value}; |
24
|
1
|
|
|
|
|
4
|
my $total = $price / $RATE; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
13
|
return $total; |
27
|
2
|
|
|
2
|
|
57150
|
} |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
11
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub inc_price_tax_portion : Method { |
30
|
0
|
|
|
0
|
0
|
0
|
my ($self, $c) = @_; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
my $price = $c->{value}; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
return $price / 11; |
35
|
2
|
|
|
2
|
|
534
|
} |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
9
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub ex_price_tax_portion : Method { |
38
|
0
|
|
|
0
|
0
|
0
|
my ($self, $c) = @_; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
0
|
my $price = $c->{value}; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
return $price / 10; |
43
|
2
|
|
|
2
|
|
560
|
} |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Number::Object::Plugin::Tax::AU::GST - a Number::Object plugin for Australian GST |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Version 0.06 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use Number::Object; |
58
|
|
|
|
|
|
|
Number::Object->load_components('Autocall'); |
59
|
|
|
|
|
|
|
Number::Object->load_plugins('Tax::AU::GST'); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $amount = Number::Object->new(99.95); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
say $amount; # 99.95 |
64
|
|
|
|
|
|
|
say "$amount"; # 99.95 |
65
|
|
|
|
|
|
|
say $amount + 0; # 99.95 |
66
|
|
|
|
|
|
|
say $amount->value; # 99.95 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
say $amount->tax; # 9.995 |
69
|
|
|
|
|
|
|
say $amount->include_tax; # 109.945 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Matt Koscica, C<< >> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 BUGS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
80
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
81
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SUPPORT |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
perldoc Number::Object::Plugin::Tax::AU::GST |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
You can also look for information at: |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=over 4 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * CPAN Ratings |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=item * Search CPAN |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
L |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=back |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Copyright 2009 Matt Koscica. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
120
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
121
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; # End of Number::Object::Plugin::Tax::AU::GST |