Author: sichen
Date: Wed Sep 13 12:38:32 2006
New Revision: 443092
URL:
http://svn.apache.org/viewvc?view=rev&rev=443092Log:
Fixed a bug with modifying prices of purchase orders because POs don't have shipment estimates
Modified:
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=443092&r1=443091&r2=443092==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Wed Sep 13 12:38:32 2006
@@ -3101,14 +3101,14 @@
}
private static void saveUpdatedCartToOrder(LocalDispatcher dispatcher, GenericDelegator delegator, ShoppingCart cart, Locale locale, GenericValue userLogin, String orderId) throws GeneralException {
- // get/set the shipping estimates
+ // get/set the shipping estimates. if it's a SALES ORDER, then return an error if there are no ship estimates
int shipGroups = cart.getShipGroupSize();
for (int gi = 0; gi < shipGroups; gi++) {
String shipmentMethodTypeId = cart.getShipmentMethodTypeId(gi);
String carrierPartyId = cart.getCarrierPartyId(gi);
Debug.log("Getting ship estimate for group #" + gi + " [" + shipmentMethodTypeId + " / " + carrierPartyId + "]", module);
Map result = ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, gi);
- if (ServiceUtil.isError(result)) {
+ if (("SALES_ORDER".equals(cart.getOrderType())) && (ServiceUtil.isError(result))) {
Debug.logError(ServiceUtil.getErrorMessage(result), module);
throw new GeneralException(ServiceUtil.getErrorMessage(result));
}
@@ -3119,7 +3119,7 @@
}
cart.setItemShipGroupEstimate(shippingTotal.doubleValue(), gi);
}
-
+
// calc the sales tax
CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart);
try {