svn commit: r1715472 - /ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy

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

svn commit: r1715472 - /ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy

Mridul Pathak-5
Author: mridulpathak
Date: Sat Nov 21 07:00:24 2015
New Revision: 1715472

URL: http://svn.apache.org/viewvc?rev=1715472&view=rev
Log:
[OFBIZ-6725] Best Selling Products section in main order page takes into account cancelled orders. Applying patch from OFBIZ-6725. Thanks Aditya Patwa for your contribution. Thanks Jacques for reporting the issue. Applying fix from trunk r1715471.

Modified:
    ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy

Modified: ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy?rev=1715472&r1=1715471&r2=1715472&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy (original)
+++ ofbiz/branches/release14.12/applications/product/webapp/catalog/WEB-INF/actions/product/BestProducts.groovy Sat Nov 21 07:00:24 2015
@@ -27,12 +27,19 @@ exprList = [];
 exprList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.getDayStart(filterDate)));
 exprList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, UtilDateTime.getDayEnd(filterDate)));
 exprList.add(EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"));
+exprList.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED"));
 
 orderHeaderList = from("OrderHeader").where(exprList).queryList();
 
 orderHeaderList.each { orderHeader ->
-    orderItemList = from("OrderItem").where("orderId", orderHeader.orderId, "orderItemTypeId", "PRODUCT_ORDER_ITEM", "isPromo", "N").queryList();
-    
+    exprList.clear();
+    exprList.add(EntityCondition.makeCondition("orderId", orderHeader.orderId));
+    exprList.add(EntityCondition.makeCondition("orderItemTypeId", "PRODUCT_ORDER_ITEM"));
+    exprList.add(EntityCondition.makeCondition("isPromo", "N"));
+    exprList.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "ITEM_CANCELLED"));
+
+    orderItemList = from("OrderItem").where(exprList).queryList();
+
     orderItemList.each { orderItem ->
         orderItemDetail = [:];
         qtyOrdered = BigDecimal.ZERO;