Author: sichen
Date: Wed May 23 15:40:39 2007 New Revision: 541109 URL: http://svn.apache.org/viewvc?view=rev&rev=541109 Log: Rename the shipment.ups.cod.applyCODSurcharge property in shipment.properties to shipment.ups.cod.allowCOD, which better describes the purpose. 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=541109&r1=541108&r2=541109 ============================================================================== --- ofbiz/trunk/applications/product/config/shipment.properties (original) +++ ofbiz/trunk/applications/product/config/shipment.properties Wed May 23 15:40:39 2007 @@ -72,10 +72,10 @@ # minimum be equal to the value below. shipment.ups.min.estimate.weight=.1 -#ÊCOD Surcharge -#ÊWill be applied if shipment.ups.cod.applyCODSurcharge is true and all shipment package items +#ÊCOD +#ÊWill be applied if shipment.ups.cod.allowCOD is true and all shipment package items #Êare from orders which have been fully paid via EXT_COD -shipment.ups.cod.applyCODSurcharge=true +shipment.ups.cod.allowCOD=true shipment.ups.cod.surcharge.amount=9 shipment.ups.cod.surcharge.currencyUomId=USD 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=541109&r1=541108&r2=541109 ============================================================================== --- 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:40:39 2007 @@ -189,17 +189,17 @@ } // COD Support - boolean applyCODSurcharge = "true".equalsIgnoreCase(UtilProperties.getPropertyValue("shipment", "shipment.ups.cod.applyCODSurcharge")); + boolean allowCOD = "true".equalsIgnoreCase(UtilProperties.getPropertyValue("shipment", "shipment.ups.cod.allowCOD")); // COD only applies if all orders involved with the shipment were paid only with EXT_COD - anything else becomes too complicated - if (applyCODSurcharge) { + if (allowCOD) { // Get the paymentMethodTypeIds of all the orderPaymentPreferences involved with the shipment List opps = delegator.findByCondition("OrderPaymentPreference", new EntityExpr("orderId", EntityOperator.IN, orderIdSet), null, null); List paymentMethodTypeIds = EntityUtil.getFieldListFromEntityList(opps, "paymentMethodTypeId", true); if (paymentMethodTypeIds.size() > 1 || ! paymentMethodTypeIds.contains("EXT_COD")) { - applyCODSurcharge = false; + allowCOD = false; } } @@ -214,7 +214,7 @@ BigDecimal codSurchargePackageAmount = null; - if (applyCODSurcharge) { + if (allowCOD) { codSurchargeAmount = UtilProperties.getPropertyValue("shipment", "shipment.ups.cod.surcharge.amount"); if (UtilValidate.isEmpty(codSurchargeAmount)) { @@ -458,7 +458,7 @@ UtilXml.addChildElementValue(insuredValueElement, "CurrencyCode", currencyCode, shipmentConfirmRequestDoc); } - if (applyCODSurcharge) { + if (allowCOD) { Element codElement = UtilXml.addChildElement(packageServiceOptionsElement, "COD", shipmentConfirmRequestDoc); UtilXml.addChildElementValue(codElement, "CODCode", "3", shipmentConfirmRequestDoc); // "3" is the only valid value for package-level COD UtilXml.addChildElementValue(codElement, "CODFundsCode", codFundsCode, shipmentConfirmRequestDoc); |
Free forum by Nabble | Edit this page |