The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Business::TPGPost - Calculate Dutch (TPG Post) shipping costs

SYNOPSIS

  use Business::TPGPost;

  my $tpg = Business::TPGPost->new();
     $tpg->country('DE');
     $tpg->weight('534');
     $tpg->large(1);
     $tpg->priority(1);
     $tpg->tracktrace(1);
     $tpg->register(1);
     $tpg->receipt(1);

  my $costs = $tpg->calculate or die $Business::TPGPost::ERROR;
  

or

  use Business::TPGPost;

  my $tpg = Business::TPGPost->new();
  my $costs = $tpg->calculate(
                  country    =>'DE', 
                  weight     => 534, 
                  large      => 1, 
                  tracktrace => 1,
                  register   => 1,
                  receipt    => 1
              ) or die $Business::TPGPost::ERROR;

DESCRIPTION

This module calculates the shipping costs for the Dutch TPG Post, based on country, weight and priority shipping (or not), etc.

The shipping cost information is based on 'Tarieven juni 2006'.

It returns the shipping costs in euro or undef (which usually means the parcel is heavier than the maximum allowed weight; check $Business::TPGPost::ERROR).

METHODS

The following methods can be used

new

new creates a new Business::TPGPost object. No more, no less.

country

Sets the country (ISO 3166, 2-letter country code) and returns the zone number used by TPG Post (or 0 for The Netherlands (NL)).

This value is mandatory for the calculations.

weight

Sets and/or returns the weight of the parcel in question in grams.

This value is mandatory for the calculations.

large

Sets and/or returns the value of this option. Defaults to 0 (meaning: the package will fit through the mail slot).

priority

Sets and/or returns the value of this option. Defaults to 0 (meaning: standard class (or economy class, where standard is not available)).

tracktrace

Sets and/or returns the value of this options. Defaults to 0 (meaning: no track & trace feature wanted). When a parcel destined for abroad weighs over 2 kilograms, default is 1, while over 2kg it's not even optional anymore.

register

Sets and/or returns the value of this options. Defaults to 0 (meaning: parcel is not registered (Dutch: aangetekend)).

receipt

Sets and/or returns the value of this options. Defaults to 0 (meaning: receipt not requested for registered parcels).

machine

Sets and/or returns the value of this options. Defaults to 0 (meaning: stamps will be used, not the machine (Dutch: frankeermachine)).

Only interesting for destinies within NL. Note that "Pakketzegel AVP" and "Easystamp" should also use this option.

calculate

Method to calculate the actual shipping cost based on the input (see methods above). These options can also be passed straight in to this method (see SYNOPSIS).

Two settings are mandatory: country and weight. The rest are given a default value that will be used unless told otherwise.

Returns the shipping costs in euro, or undef (see $Business::TPGPost::ERROR in that case).

BUGS

Please do report bugs/patches to http://rt.cpan.org/Public/Dist/Display.html?Name=Business-TPGPost

CAVEAT

The Dutch postal agency (TPG Post) uses many, many, many various ways for you to ship your parcels. Some of them are included in this module, but a lot of them not (maybe in the future? Feel free to patch ;-)

This module handles the following shipping ways (page numbers refer to the TPG Post booklet (sorry, all in Dutch)):

Nederland

Brievenbuspost

Brieven, drukwerken, kaarten, buspakjes

Pagina 6

Aangetekend (tot 1kg)

Pagina 8, incl. toeslag handtekening retour

Paketten

Basis Pakket

Pagina 10

Buitenland

Brievenbuspost

Brieven, drukwerken, kaarten, buspakjes

Pagina 36

Pakketten

Internationaal Pakket Basis

Pagina 37

Internationaal Pakket Plus (EU)

Pagina 38

Internationaal Pakket Plus (buiten EU)

Pagina 38

Extra Zeker

Aangetekend

Pagina 40

Bericht van ontvangst

Pagina 40

These should be the most commom methods of shipment.

AUTHOR

M. Blom, <blom@cpan.org>, http://menno.b10m.net/perl/

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

http://www.tpgpost.nl/, http://www.iso.org/iso/en/prods-services/iso3166ma/index.html