Author: ashish
Date: Wed Apr 13 08:14:34 2011
New Revision: 1091694
URL:
http://svn.apache.org/viewvc?rev=1091694&view=revLog:
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/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy?rev=1091694&r1=1091693&r2=1091694&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/order/OrderStatus.groovy Wed Apr 13 08:14:34 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. In case of OFFLINE payment "ORDER_CREATED" status must be checked.
+ 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;