[interchange-cvs] interchange - heins modified 30 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Thu Jan 31 23:53:01 2002


User:      heins
Date:      2002-02-01 04:50:41 GMT
Modified:  code/UserTag ups_query.tag
Removed:   dist/usertag bar_button.tag button.tag convert_date.tag
Removed:            db_date.tag delete_cart.tag email.tag email_raw.tag
Removed:            env.tag fcounter.tag fedex_query.tag formel.tag
Removed:            fortune.tag get_url.tag history_scan.tag image.tag
Removed:            load_cart.tag loc.tag rand.tag reconfig.tag
Removed:            reconfig_time.tag reconfig_wait.tag save_cart.tag
Removed:            summary.tag table_organize.tag title_bar.tag
Removed:            ups_query.tag usertrack.tag var.tag
Removed:            xml_generator.tag
Log:
	* Remove now-redundant usertag/*.tag.

	* Update ups_query.tag in code/UserTag

Revision  Changes    Path
1.2       +7 -0      interchange/code/UserTag/ups_query.tag


rev 1.2, prev_rev 1.1
Index: ups_query.tag
===================================================================
RCS file: /anon_cvs/repository/interchange/code/UserTag/ups_query.tag,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ups_query.tag	29 Jan 2002 05:52:42 -0000	1.1
+++ ups_query.tag	1 Feb 2002 04:50:41 -0000	1.2
@@ -8,17 +8,24 @@
 			import Business::UPS;
 		};
 	};
+
 	$origin		= $::Variable->{UPS_ORIGIN}
 					if ! $origin;
 	$country	= $::Values->{$::Variable->{UPS_COUNTRY_FIELD}}
 					if ! $country;
 	$zip		= $::Values->{$::Variable->{UPS_POSTCODE_FIELD}}
 					if ! $zip;
+
 	$country = uc $country;
+
+	# In the U.S., UPS only wants the 5-digit base ZIP code, not ZIP+4
+	$country eq 'US' and $zip =~ /^(\d{5})/ and $zip = $1;
+
 #::logGlobal("calling with: " . join("|", $mode, $origin, $zip, $weight, $country));
 	my ($shipping, $zone, $error) =
 		getUPS( $mode, $origin, $zip, $weight, $country);
 #::logGlobal("received back: " . join("|", $shipping, $zone, $error));
+
 	if($error) {
 		$Vend::Session->{ship_message} .= " $mode: $error";
 		return 0;