Business-Shipping

 view release on metacpan or  search on metacpan

lib/Business/Shipping/UPS_Offline/Shipment.pm  view on Meta::CPAN

Business::Shipping::UPS_Offline::Shipment

=head1 METHODS

=over 4

=item * disable_hundredweight( )

If true, don't estimate the hundredweight rate even if it would otherwise be possible.

=item * hundredweight_margin( $percent )

If the shipment weight is only $percent (default 10%) higher than the required amount to qualify for 
hundredweight shipping, then do not calculate hundredweight.  This is to guard against the chance that the 
actual shipment weight turns out to be lower than what is used for estimation, resulting in failed eligibility
for hundredweight rates and a much higher rate than estimated.

=back

=cut

use Business::Shipping::Config;
use Business::Shipping::Logging;

t/410-UPS_Offline-Rate.t  view on Meta::CPAN

        shipper => 'UPS_Online',
        cache   => 0,
        %user
    );

    $shipment->submit(%args) or print STDERR $shipment->user_error();
    return $shipment;
}

sub close_enough {
    my ($n1, $n2, $percent) = @_;

    $percent ||= CLOSE_ENOUGH_PERCENT;

    my ($greater, $lesser) = $n1 > $n2 ? ($n1, $n2) : ($n2, $n1);
    my $percentage_of_difference = 1 - ($lesser / $greater);
    my $required_percentage = $percent * .01;

#print "percentage_of_difference = $percentage_of_difference, required = $required_percentage\n";

    return 1 if ($percentage_of_difference <= $required_percentage);
    return 0;
}

{
###########################################################################
##  Domestic Single-package API
###########################################################################

    my %one_da_light_us = (
        service        => '1DA',



( run in 0.504 second using v1.01-cache-2.11-cpan-709fd43a63f )