[OFBiz] SVN: r7783 - in trunk/applications/order: servicedef src/org/ofbiz/order/order

sichen@svn.ofbiz.org sichen at svn.ofbiz.org
Tue Jun 13 11:08:39 CDT 2006


Author: sichen
Date: 2006-06-13 11:08:32 -0500 (Tue, 13 Jun 2006)
New Revision: 7783

Modified:
   trunk/applications/order/servicedef/services.xml
   trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Log:
A patch from Chris Howe to fix mass approve order, so that all the items are approved as well.  Also I improved the comments on the services used.

Modified: trunk/applications/order/servicedef/services.xml
===================================================================
--- trunk/applications/order/servicedef/services.xml	2006-06-13 16:03:20 UTC (rev 7782)
+++ trunk/applications/order/servicedef/services.xml	2006-06-13 16:08:32 UTC (rev 7783)
@@ -215,7 +215,7 @@
 
     <service name="changeOrderItemStatus" engine="java" auth="true"
     		location="org.ofbiz.order.order.OrderServices" invoke="setItemStatus">
-    	<description>Change the status of an existing order item</description>
+    	<description>Change the status of an existing order item.  If no orderItemSeqId is specified, the status of all order items will be changed.</description>
     	<attribute name="orderId" type="String" mode="IN" optional="false"/>
     	<attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/>
     	<attribute name="fromStatusId" type="String" mode="IN" optional="true"/>
@@ -278,7 +278,7 @@
 
     <service name="checkOrderItemStatus" engine="java"
     		location="org.ofbiz.order.order.OrderServices" invoke="checkItemStatus">
-    	<description>Check the status of all items and cancel/complete the order if we can</description>
+      <description>Check the status of all items and cancel/approve/complete the order if we can</description>
     	<attribute name="orderId" type="String" mode="IN" optional="false"/>
     </service>
 

Modified: trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
===================================================================
--- trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java	2006-06-13 16:03:20 UTC (rev 7782)
+++ trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java	2006-06-13 16:08:32 UTC (rev 7783)
@@ -3717,13 +3717,14 @@
                 return ServiceUtil.returnError("Order #" + orderId + " was not found.");
             }
 
+            // by changing all the items to approved, the checkOrderItemStatus service will automatically set the order to approved.
             Map ctx = FastMap.newInstance();
-            ctx.put("statusId", "ORDER_APPROVED");
+            ctx.put("statusId", "ITEM_APPROVED");
             ctx.put("orderId", orderId);
             ctx.put("userLogin", userLogin);
             Map resp = null;
             try {
-                resp = dispatcher.runSync("changeOrderStatus", ctx);
+                resp = dispatcher.runSync("changeOrderItemStatus", ctx);
             } catch (GenericServiceException e) {
                 Debug.logError(e, module);
                 return ServiceUtil.returnError(e.getMessage());



More information about the Svn mailing list