Add residential property to driver. Add test for quantity checking.

This commit is contained in:
Colin Kuskie 2009-07-21 15:53:00 -07:00
parent cc7b28ecce
commit b7b86fd248
2 changed files with 45 additions and 9 deletions

View file

@ -9,6 +9,7 @@ use LWP;
use Tie::IxHash;
use Locales::Country qw/ en /;
use Class::InsideOut qw/ :std /;
use Data::Dumper;
public testMode => my %testMode;
@ -109,6 +110,9 @@ sub buildXML {
},
Package => [],
};
if ($self->get('residentialIndicator') eq 'residential') {
$xmlRate->{Shipment}->{ShipTo}->{Address}->[0]->{ResidentialAddressIndicator} = [''];
}
my $packHash = $xmlRate->{Shipment}->{Package};
PACKAGE: foreach my $package (@{ $packages }) {
my $weight = 0;
@ -137,9 +141,9 @@ sub buildXML {
}
return '' unless scalar @{ $packHash }; ##Nothing to calculate shipping for.
$xml .= XMLout(\%xmlHash,
KeepRoot => 1,
NoSort => 1,
SuppressEmpty => 0,
KeepRoot => 1,
NoSort => 1,
SuppressEmpty => '',
XMLDecl => 1,
);
@ -367,6 +371,16 @@ sub definition {
options => \%customerClassification,
defaultValue => '01',
},
residential => {
fieldType => 'radioList',
label => $i18n->get('residential'),
hoverHelp => $i18n->get('residential help'),
options => {
residential => $i18n->get('residential'),
commercial => $i18n->get('commercial'),
},
defaultValue => 'commercial',
},
##Note, if a flat fee is added to this driver, then according to the license
##terms the website must display a note to the user (shop customer) that additional
##fees have been added.