| Number-Object-Plugin-Tax-AU documentation | Contained in the Number-Object-Plugin-Tax-AU distribution. |
Number::Object::Plugin::Tax::AU::GST - a Number::Object plugin for Australian GST
Version 0.06
use Number::Object;
Number::Object->load_components('Autocall');
Number::Object->load_plugins('Tax::AU::GST');
my $amount = Number::Object->new(99.95);
say $amount; # 99.95
say "$amount"; # 99.95
say $amount + 0; # 99.95
say $amount->value; # 99.95
say $amount->tax; # 9.995
say $amount->include_tax; # 109.945
Matt Koscica, <matt at qx.net.au>
Please report any bugs or feature requests to bug-number::object::plugin::tax::au::gst at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Number::Object::Plugin::Tax::AU::GST. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Number::Object::Plugin::Tax::AU::GST
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Number::Object::Plugin::Tax::AU::GST
http://annocpan.org/dist/Number::Object::Plugin::Tax::AU::GST
http://cpanratings.perl.org/d/Number::Object::Plugin::Tax::AU::GST
http://search.cpan.org/dist/Number::Object::Plugin::Tax::AU::GST/
Copyright 2009 Matt Koscica.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
| Number-Object-Plugin-Tax-AU documentation | Contained in the Number-Object-Plugin-Tax-AU distribution. |
package Number::Object::Plugin::Tax::AU::GST; use warnings; use strict; use base 'Number::Object::Plugin::Tax'; our $VERSION = 0.06; our $RATE = 1.1; sub calc { my($self, $c) = @_; my $price = $c->{value}; my $total = $price * $RATE; return $total - $price; } sub deduct_tax : Method { my ($self, $c) = @_; my $price = $c->{value}; my $total = $price / $RATE; return $total; } sub inc_price_tax_portion : Method { my ($self, $c) = @_; my $price = $c->{value}; return $price / 11; } sub ex_price_tax_portion : Method { my ($self, $c) = @_; my $price = $c->{value}; return $price / 10; }
1; # End of Number::Object::Plugin::Tax::AU::GST