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

NAME

Business::Shipping::UPS_Offline::RateRequest

GLOSSARY

  • EAS Extended Area Surcharge

  • DAS Delivery Area Surcharge (same as EAS)

METHODS

update

download

unzip

convert

is_from_west_coast

is_from_east_coast

to_residential

Zones

Hash. Format:

    $self->Zones() = (
        'Canada' => {
            'zone_data' => [
                'low    high    service1    service2',
                '004    005        208            209',
                '006    010        208            209',
                'Canada    Canada    504            504',
            ]
        }
    )

zone_file

zone_name

  - For International, it's the name of the country (e.g. 'Canada')
  - For Domestic, it is the first three of a zip (e.g. '986')
  - For Canada, it is...?

* Required()

from_state only required for Offline international orders.

validate

_handle_response

$self->_increase_total_charges( $amount )

Increase the _total_charges by an amount.

calc_express_plus_adder

calc_delivery_area_surcharge

The "Delivery Area Surcharge" is also known as "Extended Area Surcharge", but does not include special residential charges that apply to some services (air services, for example).

$self->calc_residential_surcharge()

Note that this is different than the delivery area surcharge. It is listed as "Residential Differential" in the accessorials.csv file.

calc_fuel_surcharge

ups_name_to_table

Find rate table using UPS 'type' or name at the top of the table.

determine_keys()

Decides what unique keys will be used to locate the zone record.

 * The first key ("key") is a shortened version (the zip code "98682" becomes
   "986") to locate the zone file and the range that it fits into.
   
 * The second key ("raw_key") is the actual key, for looking up the record
   in the correct zone file once it has been found.

Returns ( $key, $raw_key )

rate_table_exceptions

WorldWide methods use different tables for Canada

calc_zone( )

calc_cost( )

seq_scan( $array, $target )

Sequential scan.

binary_numeric_exact_match

binary_numeric( $array, $target )

From Mastering Algorithms in Perl, modified to handle rows and my own matching specifications.

special_zone_hi_ak( $type )

 $type    Type of service.
 

Hawaii and Alaska have special per-zipcode zone exceptions for 1da/2da.

calc_zone_info()

Determines which zone (zone_name), and which zone file to use for lookup.

determine_coast

If this is an international order, we need to determine which state the shipper is in, then if it is east or west coast. If west, then use the first "Express" field in the zone chart. If east, then use the second.

* readfile( $file )

Note: this is not an object-oriented method.

_massage_values()

Performs some final value modification just before the submit.

AUTHOR

Daniel Browning, db@kavod.com, http://www.kavod.com/

COPYRIGHT AND LICENCE

Copyright 2003-2011 Daniel Browning <db@kavod.com>. 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.