svn commit: r1091698 - /ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy

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

svn commit: r1091698 - /ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy

ashish-18
Author: ashish
Date: Wed Apr 13 08:19:59 2011
New Revision: 1091698

URL: http://svn.apache.org/viewvc?rev=1091698&view=rev
Log:
Applied changes from trunk r1091694. Bug fix. In case of EXT_OFFLINE payment "ORDER_CREATED" status must be included to filter-out the list for fetching the userlogin object.

Modified:
    ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy

Modified: ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy?rev=1091698&r1=1091697&r2=1091698&view=diff
==============================================================================
--- ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy (original)
+++ ofbiz/branches/release10.04/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy Wed Apr 13 08:19:59 2011
@@ -39,7 +39,20 @@ if (!userLogin) {
         if (orderId) {
             orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
             orderStatuses = orderHeader.getRelated("OrderStatus");
-            filteredOrderStatusList = EntityUtil.filterByCondition(orderStatuses, EntityCondition.makeCondition("statusId", EntityOperator.IN, ["ORDER_COMPLETED", "ORDER_APPROVED"]));
+            filteredOrderStatusList = [];
+            extOfflineModeExists = false;
+            
+            // Handled the case of OFFLINE payment method.
+            orderPaymentPreferences = orderHeader.getRelated("OrderPaymentPreference", UtilMisc.toList("orderPaymentPreferenceId"));
+            filteredOrderPaymentPreferences = EntityUtil.filterByCondition(orderPaymentPreferences, EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.IN, ["EXT_OFFLINE"]));
+            if (filteredOrderPaymentPreferences) {
+                extOfflineModeExists = true;
+            }
+            if (extOfflineModeExists) {
+                filteredOrderStatusList = EntityUtil.filterByCondition(orderStatuses, EntityCondition.makeCondition("statusId", EntityOperator.IN, ["ORDER_COMPLETED", "ORDER_APPROVED", "ORDER_CREATED"]));
+            } else {
+                filteredOrderStatusList = EntityUtil.filterByCondition(orderStatuses, EntityCondition.makeCondition("statusId", EntityOperator.IN, ["ORDER_COMPLETED", "ORDER_APPROVED"]));
+            }            
             if (UtilValidate.isNotEmpty(filteredOrderStatusList)) {
                 if (filteredOrderStatusList.size() < 2) {
                     statusUserLogin = EntityUtil.getFirst(filteredOrderStatusList).statusUserLogin;