svn commit: r1827960 - /ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1827960 - /ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java

rishi
Author: rishi
Date: Thu Mar 29 08:15:17 2018
New Revision: 1827960

URL: http://svn.apache.org/viewvc?rev=1827960&view=rev
Log:
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 your contribution

Modified:
    ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java

Modified: ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1827960&r1=1827959&r2=1827960&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/branches/release16.11/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java Thu Mar 29 08:15:17 2018
@@ -200,7 +200,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"));
@@ -214,12 +218,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) {