svn commit: r464136 - in /incubator/ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java

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

svn commit: r464136 - in /incubator/ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java

jleroux@apache.org
Author: jleroux
Date: Sat Oct 14 23:02:14 2006
New Revision: 464136

URL: http://svn.apache.org/viewvc?view=rev&rev=464136
Log:
A patch from Chris Howe : "Allow statusDateTime to be passed to service changeOrderItemStatus" (https://issues.apache.org/jira/browse/OFBIZ-377)

Modified:
    incubator/ofbiz/trunk/applications/order/servicedef/services.xml
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=464136&r1=464135&r2=464136
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Sat Oct 14 23:02:14 2006
@@ -232,6 +232,7 @@
      <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
      <attribute name="fromStatusId" type="String" mode="IN" optional="true"/>
      <attribute name="statusId" type="String" mode="IN" optional="false"/>
+        <attribute name="statusDateTime" type="Timestamp" mode="IN" optional="true"/>
     </service>
 
     <service name="cancelOrderItem" engine="java" auth="true"

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=464136&r1=464135&r2=464136
==============================================================================
--- 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 Sat Oct 14 23:02:14 2006
@@ -1698,6 +1698,7 @@
         String orderItemSeqId = (String) context.get("orderItemSeqId");
         String fromStatusId = (String) context.get("fromStatusId");
         String statusId = (String) context.get("statusId");
+        Timestamp statusDateTime = (Timestamp) context.get("statusDateTime");
         Locale locale = (Locale) context.get("locale");
 
         // check and make sure we have permission to change the order
@@ -1757,14 +1758,16 @@
 
                 orderItem.set("statusId", statusId);
                 toBeStored.add(orderItem);
-
+                if (statusDateTime == null){
+                    statusDateTime = UtilDateTime.nowTimestamp();
+                }
                 // now create a status change
                 Map changeFields = new HashMap();
                 changeFields.put("orderStatusId", delegator.getNextSeqId("OrderStatus").toString());
                 changeFields.put("statusId", statusId);
                 changeFields.put("orderId", orderId);
                 changeFields.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
-                changeFields.put("statusDatetime", UtilDateTime.nowTimestamp());
+                changeFields.put("statusDatetime", statusDateTime);
                 changeFields.put("statusUserLogin", userLogin.getString("userLoginId"));
                 GenericValue orderStatus = delegator.makeValue("OrderStatus", changeFields);
                 toBeStored.add(orderStatus);