You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by di...@apache.org on 2016/06/18 23:02:14 UTC

svn commit: r1749104 - in /ofbiz/trunk/applications/order: groovyScripts/reports/OpenOrderItemsReport.groovy widget/ordermgr/ReportForms.xml

Author: diveshdutta
Date: Sat Jun 18 23:02:14 2016
New Revision: 1749104

URL: http://svn.apache.org/viewvc?rev=1749104&view=rev
Log:
[OFBIZ-7386] Allowing user to select multiple options in Open Order Items report from basic search criterias while generating report. Thanks Mohammad Kathawala for your patch and thanks Swapnil Shah for suggesting the improvment. 

Modified:
    ofbiz/trunk/applications/order/groovyScripts/reports/OpenOrderItemsReport.groovy
    ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml

Modified: ofbiz/trunk/applications/order/groovyScripts/reports/OpenOrderItemsReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/reports/OpenOrderItemsReport.groovy?rev=1749104&r1=1749103&r2=1749104&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/groovyScripts/reports/OpenOrderItemsReport.groovy (original)
+++ ofbiz/trunk/applications/order/groovyScripts/reports/OpenOrderItemsReport.groovy Sat Jun 18 23:02:14 2016
@@ -29,12 +29,13 @@ import org.ofbiz.entity.util.*;
 import org.ofbiz.entity.*;
 import org.ofbiz.base.util.*;
 
-productStoreId = parameters.productStoreId;
-orderTypeId = parameters.orderTypeId;
-orderStatusId = parameters.orderStatusId;
+productStoreId = ObjectType.simpleTypeConvert(parameters.productStoreId, "List", null, null);
+orderTypeId = ObjectType.simpleTypeConvert(parameters.orderTypeId, "List", null, null);
+orderStatusId = ObjectType.simpleTypeConvert(parameters.orderStatusId, "List", null, null);
+
 
 // search by orderTypeId is mandatory
-conditions = [EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, orderTypeId)];
+conditions = [EntityCondition.makeCondition("orderTypeId", EntityOperator.IN, orderTypeId)];
 
 if (fromOrderDate) {
     conditions.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromOrderDate));
@@ -44,7 +45,7 @@ if (thruOrderDate) {
 }
 
 if (productStoreId) {
-    conditions.add(EntityCondition.makeCondition("productStoreId", EntityOperator.EQUALS, productStoreId));
+    conditions.add(EntityCondition.makeCondition("productStoreId", EntityOperator.IN, productStoreId));
     // for generating a title (given product store)
     context.productStore = from("ProductStore").where("productStoreId", productStoreId).cache(true).queryOne();
 } else {
@@ -52,7 +53,7 @@ if (productStoreId) {
     context.productStore = [storeName : "All Stores"];
 }
 if (orderStatusId) {
-    conditions.add(EntityCondition.makeCondition("orderStatusId", EntityOperator.EQUALS, orderStatusId));
+    conditions.add(EntityCondition.makeCondition("orderStatusId", EntityOperator.IN, orderStatusId));
 } else {
     // search all orders that are not completed, cancelled or rejected
     conditions.add(

Modified: ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml?rev=1749104&r1=1749103&r2=1749104&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml Sat Jun 18 23:02:14 2016
@@ -101,12 +101,12 @@ under the License.
     <form name="OpenOrderItemsReport" type="single" target="OpenOrderItemsReport" title=""
         header-row-style="header-row" default-table-style="basic-table">
         <field name="productStoreId">
-            <drop-down allow-empty="false">
+            <check all-checked="false">
                 <option key="" description="- ${uiLabelMap.CommonSelectAny} -"/>
                 <entity-options entity-name="ProductStore" description="${storeName} [${productStoreId}]">
                     <entity-order-by field-name="storeName"/>
                 </entity-options>
-            </drop-down>
+            </check>
         </field>
         <field name="orderTypeId">
             <drop-down allow-empty="false">
@@ -115,12 +115,12 @@ under the License.
             </drop-down>
         </field>
         <field name="orderStatusId">
-            <drop-down allow-empty="false">
+            <check all-checked="false">
                 <option key="" description="- ${uiLabelMap.CommonSelectAny} -"/>
                 <entity-options entity-name="StatusItem" key-field-name="statusId">
-                    <entity-constraint name="statusTypeId" operator="equals" value="ORDER_STATUS"/>
+                    <entity-constraint name="statusId" operator="in" value="ORDER_APPROVED,ORDER_CREATED,ORDER_HOLD"/>
                 </entity-options>
-            </drop-down>
+            </check>
         </field>
         <field name="fromOrderDate" title="${uiLabelMap.OrderReportFromDate}"><date-time type="timestamp"/></field>
         <field name="thruOrderDate" title="${uiLabelMap.OrderReportThruDate}"><date-time type="timestamp"/></field>