NAME
Business::Shipping::Shipment - Abstract class
VERSION
$Rev: 240 $
DESCRIPTION
Abstract Class: real implementations are done in subclasses.
Shipments have a source, a destination, packages, and other attributes.
METHODS
service
from_country
from_zip
from_city
to_country
to_zip
to_city
packages
weight
Forward the weight to the current package.
default_package()
Only used for forwarding methods in simple uses of the class. For example:
$rate_request->init(
service => '',
weight => '',
packaging => '',
);
Which is simpler than:
$rate_request->shipment->service( '' );
$rate_request->shipment->packages_index( 0 )->weight( '' );
$rate_request->shipment->packages_index( 0 )->packaging( '' );
Note that it only works when there is one package only (no multiple packages).
package0
Alias for default_package.
dflt_pkg
Alias for default_package.
total_weight
Returns the weight of all packages within the shipment.
to_zip( $to_zip )
Throw away the "four" from zip+four.
Redefines the MethodMaker implementation of this attribute.
to_country()
to_country must be overridden to transform from various forms (alternate spellings of the full name, abbreviatations, alternate abbreviations) into the full name that we use internally.
May be overridden by subclasses to provide their own spelling ("United Kingdom" vs "Great Britain", etc.).
Redefines the MethodMaker implementation of this attribute.
to_country_abbrev()
Returns the abbreviated form of 'to_country'.
Redefines the MethodMaker implementation of this attribute.
from_country()
from_country_abbrev()
domestic_or_ca()
Returns 1 (true) if the to_country value for this shipment is domestic (United States) or Canada.
Returns 1 if to_country is not set.
intl()
Uses to_country() value to determine if the order is International (non-US).
Returns 1 or 0 (true or false).
domestic()
Returns the opposite of $self->intl
from_canada()
UPS treats Canada differently.
to_canada()
UPS treats Canada differently.
to_ak_or_hi()
Alaska and Hawaii are treated differently by many shippers.
add_package( %args )
Adds a new package to the shipment.
AUTHOR
Dan Browning <db@kavod.com>, Kavod Technologies, http://www.kavod.com.
COPYRIGHT AND LICENCE
Copyright (c) 2003-2004 Kavod Technologies, Dan Browning. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.