Author: jleroux
Date: Sat Nov 15 21:10:33 2014 New Revision: 1639918 URL: http://svn.apache.org/r1639918 Log: "Applied fix from trunk for revision: 1639835" ------------------------------------------------------------------------ r1639835 | ashish | 2014-11-15 06:28:30 +0100 (sam. 15 nov. 2014) | 2 lignes Applied patch from jira issue - OFBIZ-5416 - Sales order cart items already assigned to ship groups are incorrectly able to be modified to quantities/prices that break the ProductStoreShipmentMeth rules. Thanks Christian for reporting the issue and Thanks Arun for providing the patch. ------------------------------------------------------------------------ Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1639835 Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1639918&r1=1639917&r2=1639918&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sat Nov 15 21:10:33 2014 @@ -591,7 +591,12 @@ public class ShoppingCartEvents { if (UtilValidate.isNotEmpty(itemId)) { request.setAttribute("itemId", itemId); } - + for (int shipGroupIndex = 0; shipGroupIndex < cart.getShipGroupSize(); shipGroupIndex++) { + String shipContactMechId = cart.getShippingContactMechId(shipGroupIndex); + if (UtilValidate.isNotEmpty(shipContactMechId)) { + cart.setShipmentMethodTypeId(shipGroupIndex, null); + } + } // Determine where to send the browser if (controlDirective.equals(ERROR)) { return "error"; Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1639918&r1=1639917&r2=1639918&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original) +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Sat Nov 15 21:10:33 2014 @@ -806,6 +806,10 @@ public class ShoppingCartHelper { } } else { BigDecimal minQuantity = ShoppingCart.getMinimumOrderQuantity(delegator, item.getBasePrice(), item.getProductId()); + oldQuantity = item.getQuantity(); + if (oldQuantity.compareTo(quantity) != 0) { + cart.setShipmentMethodTypeId(index, null); + } if (quantity.compareTo(minQuantity) < 0) { quantity = minQuantity; } @@ -879,6 +883,7 @@ public class ShoppingCartHelper { Debug.logInfo("Removing item index: " + itemIndex, module); try { this.cart.removeCartItem(itemIndex, dispatcher); + cart.setShipmentMethodTypeId(itemIndex, null); } catch (CartItemModifyException e) { result = ServiceUtil.returnError(new ArrayList<String>()); errorMsgs.add(e.getMessage()); |
Free forum by Nabble | Edit this page |