You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/12/04 13:34:22 UTC

svn commit: r887172 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy

Author: ashish
Date: Fri Dec  4 12:34:22 2009
New Revision: 887172

URL: http://svn.apache.org/viewvc?rev=887172&view=rev
Log:
Applied patch from jira issue OFBIZ-3306 - Showing Promotion Item Duplicate, when click on Update Link on Order View Page.
In ordermgr when we update the items it will recreate the adjustments and promotion and cancel the previous promotion item, and showing deleted adjustment promotion item on the order view page (i.e showing duplicate promotion item with cancel status on order view page).

Steps to produce scenario :
– goto https://localhost:8443/ordermgr/control/main
– create aa sales order.
– on order view page click on "Edit Items" links.
– click on "Update Items" link.

Now on order view page it will show the duplicate promotion items of respective adjustment.

Thanks Arpit for the contribution.

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=887172&r1=887171&r2=887172&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy Fri Dec  4 12:34:22 2009
@@ -114,7 +114,14 @@
     grandTotal = OrderReadHelper.getOrderGrandTotal(orderItems, orderAdjustments);
     context.grandTotal = grandTotal;
 
+    canceledPromoOrderItem = [:];
     orderItemList = orderReadHelper.getOrderItems();
+    orderItemList.each { orderItem -> 
+        if("Y".equals(orderItem.get("isPromo")) && "ITEM_CANCELLED".equals(orderItem.get("statusId"))) {
+            canceledPromoOrderItem = orderItem;
+        }
+        orderItemList.remove(canceledPromoOrderItem);
+    }
     context.orderItemList = orderItemList;
 
     shippingAddress = orderReadHelper.getShippingAddress();