svn commit: r783751 - /ofbiz/branches/release09.04/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: r783751 - /ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

ashish-18
Author: ashish
Date: Thu Jun 11 12:59:52 2009
New Revision: 783751

URL: http://svn.apache.org/viewvc?rev=783751&view=rev
Log:
Applied fix from trunk revision: 783749
Applied patch from jira issue OFBIZ-2591 (Getting error while updating item from order view page.)
Thanks Arun Patidar for your contribution & to Ratnesh for discussing issue with Arun and reviewing it.

Modified:
    ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=783751&r1=783750&r2=783751&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jun 11 12:59:52 2009
@@ -3834,15 +3834,20 @@
             throw new GeneralException(e.getMessage());
         }
 
+        // get the new orderItems, adjustments, shipping info, payments and order item atrributes from the cart
+        List<Map> modifiedItems = FastList.newInstance();
+        List toStore = new LinkedList();
+        List<GenericValue> toAddList = new ArrayList<GenericValue>();
+        toAddList.addAll(cart.makeAllAdjustments());
+        cart.clearAllPromotionAdjustments();
+        ProductPromoWorker.doPromotions(cart, dispatcher);
+
         // validate the payment methods
         Map validateResp = coh.validatePaymentMethods();
         if (ServiceUtil.isError(validateResp)) {
             throw new GeneralException(ServiceUtil.getErrorMessage(validateResp));
         }
 
-        // get the new orderItems, adjustments, shipping info, payments and order item atrributes from the cart
-        List<Map> modifiedItems = FastList.newInstance();
-        List toStore = new LinkedList();
         toStore.addAll(cart.makeOrderItems());
         toStore.addAll(cart.makeAllAdjustments());
         
@@ -3869,7 +3874,13 @@
             }
             toStore.removeAll(removeList);
         }
-        
+        for (GenericValue toAdd: (List<GenericValue>)toAddList) {
+            if ("OrderAdjustment".equals(toAdd.getEntityName())) {
+                if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && ("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId")))) {
+                    toStore.add(toAdd);
+                }
+            }
+        }
         // Creating objects for New Shipping and Handling Charges Adjustment and Sales Tax Adjustment
         toStore.addAll(cart.makeAllShipGroupInfos());
         toStore.addAll(cart.makeAllOrderPaymentInfos(dispatcher));