svn commit: r611313 - /ofbiz/trunk/applications/order/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: r611313 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

jleroux@apache.org
Author: jleroux
Date: Fri Jan 11 13:59:50 2008
New Revision: 611313

URL: http://svn.apache.org/viewvc?rev=611313&view=rev
Log:
A patch from Jeremy Wickersheimer "Process order payment doesn't check for cancelled/rejected order" (https://issues.apache.org/jira/browse/OFBIZ-1573) - OFBIZ-1573
Not sure how to test this but it's really simple to review and obviously it makes sense.

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=611313&r1=611312&r2=611313&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Jan 11 13:59:50 2008
@@ -3574,6 +3574,13 @@
         OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
         String productStoreId = orh.getProductStoreId();
 
+        // check if order was already cancelled / rejected
+        GenericValue orderHeader = orh.getOrderHeader();
+        String orderStatus = orderHeader.getString("statusId");
+        if ("ORDER_CANCELLED".equals(orderStatus) || "ORDER_REJECTED".equals(orderStatus)) {
+            return ServiceUtil.returnSuccess();
+        }
+
         // process the payments
         if (!"PURCHASE_ORDER".equals(orh.getOrderTypeId())) {
             GenericValue productStore = ProductStoreWorker.getProductStore(productStoreId, delegator);