Author: surajk
Date: Tue Apr 30 13:08:07 2019
New Revision: 1858428

URL: http://svn.apache.org/viewvc?rev=1858428&view=rev
Log:
Improved: Removed unused Debug.log statements and also returned success from 
service if allocation plan is not found instead of returning error.
(OFBIZ-10518)

Modified:
    
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1858428&r1=1858427&r2=1858428&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
 Tue Apr 30 13:08:07 2019
@@ -6831,8 +6831,7 @@ public class OrderServices {
 
             List<GenericValue> allocationPlanItems = 
EntityQuery.use(delegator).from("AllocationPlanItem").where(exprs).queryList();
             if (allocationPlanItems == null || 
UtilValidate.isEmpty(allocationPlanItems)) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
-                        "OrderErrorAllocationPlanIsNotAvailable", locale) + ": 
[" + orderId + ":"+ orderItemSeqId + "]");
+                return ServiceUtil.returnSuccess();
             }
             List<String> planIds = new ArrayList<>();
             Map<String, Object> serviceCtx = new HashMap<>();
@@ -6901,8 +6900,7 @@ public class OrderServices {
 
             List<GenericValue> allocationPlanItems = 
EntityQuery.use(delegator).from("AllocationPlanItem").where(exprs).queryList();
             if (allocationPlanItems == null || 
UtilValidate.isEmpty(allocationPlanItems)) {
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
-                        "OrderErrorAllocationPlanIsNotAvailable", locale) + ": 
[" + orderId + ":"+ orderItemSeqId + "]");
+                return ServiceUtil.returnSuccess();
             }
             List<String> planIds = new ArrayList<>();
             Map<String, Object> serviceCtx = new HashMap<>();
@@ -6971,7 +6969,6 @@ public class OrderServices {
                 if (orderItemChange != null) {
                     BigDecimal quantityChanged = 
orderItemChange.getBigDecimal("quantity");
                     if (quantityChanged.compareTo(BigDecimal.ZERO) < 0) {
-                        Debug.log("=========quantity 
decreased==========="+quantityChanged);
                         GenericValue allocationPlanItem = 
EntityQuery.use(delegator).from("AllocationPlanItem").where("orderId", orderId, 
"orderItemSeqId", orderItemSeqId, "statusId", "ALLOC_PLAN_ITEM_CRTD", 
"productId", orderItem.getString("productId")).queryFirst();
                         if (allocationPlanItem != null) {
                             BigDecimal revisedQuantity = 
orderItem.getBigDecimal("quantity");
@@ -6991,8 +6988,6 @@ public class OrderServices {
                                 }
                             }
                         }
-                    } else if (quantityChanged.compareTo(BigDecimal.ZERO) > 0) 
{
-                        Debug.log("=========quantity 
increased==========="+quantityChanged);
                     }
                 }
             }


Reply via email to