Author: sichen
Date: Wed May 23 15:32:03 2007
New Revision: 541108
URL:
http://svn.apache.org/viewvc?view=rev&rev=541108Log:
Adding an option for handling UPS COD surcharges ('none') to be used when surcharges have been applied upstream, such as during the order entry process
Modified:
ofbiz/trunk/applications/product/config/shipment.properties
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
Modified: ofbiz/trunk/applications/product/config/shipment.properties
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/shipment.properties?view=diff&rev=541108&r1=541107&r2=541108==============================================================================
--- ofbiz/trunk/applications/product/config/shipment.properties (original)
+++ ofbiz/trunk/applications/product/config/shipment.properties Wed May 23 15:32:03 2007
@@ -84,6 +84,8 @@
#Êfirst - surcharge amount will be applied to the first package in the shipment
#Êsplit - surcharge amount will be split between shipment packages (fractional cents are rounded
#Ê via symmetric arithmetic rounding)
+# none - the surcharge will not be applied to any packages (use this when COD surcharges have been applied
+# earlier in the process, such as during the order entry process
shipment.ups.cod.surcharge.applyToPackages=first
#ÊCODFundsCode
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?view=diff&rev=541108&r1=541107&r2=541108==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Wed May 23 15:32:03 2007
@@ -210,6 +210,7 @@
boolean codSurchargeApplyToFirstPackage = false;
boolean codSurchargeApplyToAllPackages = false;
boolean codSurchargeSplitBetweenPackages = false;
+ boolean codSurchargeApplyToNoPackages = false;
BigDecimal codSurchargePackageAmount = null;
@@ -235,7 +236,9 @@
codSurchargeApplyToFirstPackage = "first".equalsIgnoreCase(codSurchargeApplyToPackages);
codSurchargeApplyToAllPackages = "all".equalsIgnoreCase(codSurchargeApplyToPackages);
codSurchargeSplitBetweenPackages = "split".equalsIgnoreCase(codSurchargeApplyToPackages);
+ codSurchargeApplyToNoPackages = "none".equalsIgnoreCase(codSurchargeApplyToPackages);
+ if (codSurchargeApplyToNoPackages) codSurchargeAmount = "0";
codSurchargePackageAmount = new BigDecimal(codSurchargeAmount).setScale(decimals, rounding);
if (codSurchargeSplitBetweenPackages) {
codSurchargePackageAmount = codSurchargePackageAmount.divide(new BigDecimal(shipmentPackageRouteSegs.size()), decimals, rounding);