Author: rishi
Date: Tue Mar 27 10:40:18 2018
New Revision: 1827828
URL:
http://svn.apache.org/viewvc?rev=1827828&view=revLog:
Fixed: loadCartFromOrder changes order date even when updating order items. It should only set orderDate as nowTimeStamp only if createAsNewOrder flag is true other wise it should set orderDate from existing orderHeader. Also, removed setting of redundant orderName on cart. Applied fix from trunk revision 1827827.
(OFBIZ-10301)
Thanks Suraj Khurana for reporting the issue and providing fix for the same.
Modified:
ofbiz/ofbiz-framework/branches/release17.12/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
Modified: ofbiz/ofbiz-framework/branches/release17.12/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1827828&r1=1827827&r2=1827828&view=diff==============================================================================
--- ofbiz/ofbiz-framework/branches/release17.12/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/ofbiz-framework/branches/release17.12/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java Tue Mar 27 10:40:18 2018
@@ -204,7 +204,11 @@ public class ShoppingCartServices {
cart.setOrderType(orderTypeId);
cart.setChannelType(orderHeader.getString("salesChannelEnumId"));
cart.setInternalCode(orderHeader.getString("internalCode"));
- cart.setOrderDate(UtilDateTime.nowTimestamp());
+ if ("Y".equals(createAsNewOrder)) {
+ cart.setOrderDate(UtilDateTime.nowTimestamp());
+ } else {
+ cart.setOrderDate(orderHeader.getTimestamp("orderDate"));
+ }
cart.setOrderId(orderHeader.getString("orderId"));
cart.setOrderName(orderHeader.getString("orderName"));
cart.setOrderStatusId(orderHeader.getString("statusId"));
@@ -218,12 +222,6 @@ public class ShoppingCartServices {
return ServiceUtil.returnError(e.getMessage());
}
- // set the order name
- String orderName = orh.getOrderName();
- if (orderName != null) {
- cart.setOrderName(orderName);
- }
-
// set the role information
GenericValue placingParty = orh.getPlacingParty();
if (placingParty != null) {