Author: rishi
Date: Tue Mar 27 10:38:19 2018
New Revision: 1827827
URL:
http://svn.apache.org/viewvc?rev=1827827&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.
(OFBIZ-10301)
Thanks Suraj Khurana for reporting the issue and providing fix for the same.
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1827827&r1=1827826&r2=1827827&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java Tue Mar 27 10:38:19 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"));
@@ -219,12 +223,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) {