Number::Object::Plugin::Tax::AU::GST - a Number::Object plugin for Australian GST


Number-Object-Plugin-Tax-AU documentation Contained in the Number-Object-Plugin-Tax-AU distribution.

Index


Code Index:

NAME

Top

Number::Object::Plugin::Tax::AU::GST - a Number::Object plugin for Australian GST

VERSION

Top

Version 0.06

SYNOPSIS

Top

    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

AUTHOR

Top

Matt Koscica, <matt at qx.net.au>

BUGS

Top

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.

SUPPORT

Top

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:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Number::Object::Plugin::Tax::AU::GST

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Number::Object::Plugin::Tax::AU::GST

* CPAN Ratings

http://cpanratings.perl.org/d/Number::Object::Plugin::Tax::AU::GST

* Search CPAN

http://search.cpan.org/dist/Number::Object::Plugin::Tax::AU::GST/

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


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