Author: diveshdutta
Date: Mon Sep  5 18:51:28 2016
New Revision: 1759343

URL: http://svn.apache.org/viewvc?rev=1759343&view=rev
Log:
[OFBIZ-7394, OFBIZ-7403] Allow user to select multiple options in Purchase by 
Product and Purchases by Payment Method report. Thanks Swapnil Shah for 
creating the issue and Mohammad Kathawala for providing the patch.

Modified:
    
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportPayment.fo.ftl
    
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportProduct.fo.ftl
    ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml
    ofbiz/trunk/applications/order/widget/ordermgr/ReportScreens.xml

Modified: 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportPayment.fo.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportPayment.fo.ftl?rev=1759343&r1=1759342&r2=1759343&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportPayment.fo.ftl
 (original)
+++ 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportPayment.fo.ftl
 Mon Sep  5 18:51:28 2016
@@ -43,7 +43,15 @@ under the License.
             <#if !showProductStore><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} ${uiLabelMap.ProductProductStore}: 
${parameters.productStoreId}</fo:block></#if>
             <#if !showOriginFacility><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} 
${uiLabelMap.FormFieldTitle_originFacilityId}: 
${parameters.originFacilityId}</fo:block></#if>
             <#if !showTerminal><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} 
${uiLabelMap.FormFieldTitle_terminalId}: 
${parameters.terminalId}</fo:block></#if>
-            <#if !showStatus><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} 
${uiLabelMap.FormFieldTitle_orderStatusId}: 
${parameters.statusId}</fo:block></#if>
+            <#if !showStatus>
+              <fo:block font-size="10pt">
+                ${uiLabelMap.CommonFor} ${uiLabelMap.CommonStatus}: 
+                <#list statusIds as statusId>
+                  <#assign statusItem = delegator.findOne("StatusItem", 
{"statusId" : statusId}, false)!/>
+                  ${statusItem.description}
+                </#list>
+              </fo:block>
+            </#if>
             <#if parameters.fromOrderDate?has_content><fo:block 
font-size="10pt">${uiLabelMap.CommonFromDate}: ${parameters.fromOrderDate} 
(${uiLabelMap.OrderDate} &gt;= ${uiLabelMap.CommonFrom})</fo:block></#if>
             <#if parameters.thruOrderDate?has_content><fo:block 
font-size="10pt">${uiLabelMap.CommonThruDate}: ${parameters.thruOrderDate} 
(${uiLabelMap.OrderDate} &lt; ${uiLabelMap.CommonFrom})</fo:block></#if>
             <fo:block space-after.optimum="10pt" font-size="10pt">

Modified: 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportProduct.fo.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportProduct.fo.ftl?rev=1759343&r1=1759342&r2=1759343&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportProduct.fo.ftl
 (original)
+++ 
ofbiz/trunk/applications/order/template/reports/OrderPurchaseReportProduct.fo.ftl
 Mon Sep  5 18:51:28 2016
@@ -43,7 +43,15 @@ under the License.
             <#if !showProductStore><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} ${uiLabelMap.ProductProductStore}: 
${parameters.productStoreId}</fo:block></#if>
             <#if !showOriginFacility><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} 
${uiLabelMap.FormFieldTitle_originFacilityId}: 
${parameters.originFacilityId}</fo:block></#if>
             <#if !showTerminal><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} 
${uiLabelMap.FormFieldTitle_terminalId}: 
${parameters.terminalId}</fo:block></#if>
-            <#if !showStatus><fo:block 
font-size="10pt">${uiLabelMap.CommonFor} ${uiLabelMap.CommonStatus}: 
${parameters.statusId}</fo:block></#if>
+            <#if !showStatus>
+              <fo:block font-size="10pt">
+                ${uiLabelMap.CommonFor} ${uiLabelMap.CommonStatus}: 
+                <#list statusIds as statusId>
+                  <#assign statusItem = delegator.findOne("StatusItem", 
{"statusId" : statusId}, false)!/>
+                  ${statusItem.description}
+                </#list>
+              </fo:block>
+            </#if>
             <#if parameters.fromOrderDate?has_content><fo:block 
font-size="10pt">${uiLabelMap.CommonFromDate}: ${parameters.fromOrderDate} 
(${uiLabelMap.OrderDate} &gt;= ${uiLabelMap.CommonFrom})</fo:block></#if>
             <#if parameters.thruOrderDate?has_content><fo:block 
font-size="10pt">${uiLabelMap.CommonThruDate}: ${parameters.thruOrderDate} 
(${uiLabelMap.OrderDate} &lt; ${uiLabelMap.CommonFrom})</fo:block></#if>
             <fo:block space-after.optimum="10pt" font-size="10pt">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml?rev=1759343&r1=1759342&r2=1759343&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/ReportForms.xml Mon Sep  5 
18:51:28 2016
@@ -23,24 +23,16 @@ under the License.
     <form name="OrderPurchaseReportOptions" type="single" title=""
         header-row-style="header-row" default-table-style="basic-table">
         <field name="productStoreId">
-            <drop-down allow-empty="false">
+            <drop-down allow-empty="false" allow-multiple="true" size="4">
                 <option key="" description="- ${uiLabelMap.CommonAny} -"/>
                 <entity-options entity-name="ProductStore" 
description="${storeName} [${productStoreId}]">
                     <entity-order-by field-name="storeName"/>
                 </entity-options>
             </drop-down>
         </field>
-        <field name="orderTypeId">
-            <drop-down allow-empty="false">
-                <option key="" description="- ${uiLabelMap.CommonAny} -"/>
-                <entity-options entity-name="OrderType">
-                    <entity-order-by field-name="orderTypeId"/>
-                </entity-options>
-            </drop-down>
-        </field>
 
         <field name="originFacilityId">
-            <drop-down allow-empty="false">
+            <drop-down allow-empty="false" allow-multiple="true" size="4">
                 <option key="" description="- ${uiLabelMap.CommonAny} -"/>
                 <entity-options entity-name="Facility" 
key-field-name="facilityId" description="${facilityName} [${facilityId}]">
                     <entity-order-by field-name="facilityName"/>
@@ -49,13 +41,13 @@ under the License.
         </field>
         <field name="terminalId"><text size="10" maxlength="20"/></field>
         <field name="statusId">
-            <drop-down allow-empty="false" 
no-current-selected-key="ORDER_COMPLETED">
+            <check all-checked="false">
                 <option key="" description="- ${uiLabelMap.CommonAny} -"/>
                 <entity-options entity-name="StatusItem">
                     <entity-constraint value="ORDER_STATUS" 
name="statusTypeId"/>
                     <entity-order-by field-name="sequenceId"/>
                 </entity-options>
-            </drop-down>
+            </check>
         </field>
     </form>
     <form name="OrderPurchaseProductOptions" type="single" 
target="OrderPurchaseReportProduct.pdf" title="" 
extends="OrderPurchaseReportOptions" target-window="_BLANK">
@@ -64,6 +56,13 @@ under the License.
         <field name="submitButton" title="${uiLabelMap.CommonRun}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
     <form name="OrderPurchasePaymentOptions" type="single" 
target="OrderPurchaseReportPayment.pdf" title="" 
extends="OrderPurchaseReportOptions" target-window="_BLANK">
+        <field name="orderTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="OrderType">
+                    <entity-order-by field-name="orderTypeId"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="fromOrderDate" 
title="${uiLabelMap.OrderReportFromDate}"><date-time type="timestamp"/></field>
         <field name="thruOrderDate" 
title="${uiLabelMap.OrderReportThruDate}"><date-time type="timestamp"/></field>
 
@@ -74,12 +73,12 @@ under the License.
     <form name="SalesByStoreReport" type="single" 
target="SalesByStoreReport.pdf" title=""
         header-row-style="header-row" default-table-style="basic-table" 
target-window="_BLANK">
         <field name="productStoreId">
-            <check all-checked="false">
+            <drop-down allow-empty="false" allow-multiple="true" size="4">
                 <option key="" description="- ${uiLabelMap.CommonSelectAny} 
-"/>
                 <entity-options entity-name="ProductStore" 
description="${storeName} [${productStoreId}]">
                     <entity-order-by field-name="storeName"/>
                 </entity-options>
-            </check>
+            </drop-down>
         </field>
         <field name="toPartyId" title="${uiLabelMap.AccountingToPartyId}">
             <lookup target-form-name="LookupPartyName"/>
@@ -101,12 +100,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">
-            <check all-checked="false">
+            <drop-down allow-empty="false" allow-multiple="true" size="4">
                 <option key="" description="- ${uiLabelMap.CommonSelectAny} 
-"/>
                 <entity-options entity-name="ProductStore" 
description="${storeName} [${productStoreId}]">
                     <entity-order-by field-name="storeName"/>
                 </entity-options>
-            </check>
+            </drop-down>
         </field>
         <field name="orderTypeId">
             <drop-down allow-empty="false">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/ReportScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/ReportScreens.xml?rev=1759343&r1=1759342&r2=1759343&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/ReportScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/ReportScreens.xml Mon Sep  5 
18:51:28 2016
@@ -114,6 +114,9 @@ under the License.
         <section>
             <actions>
                 <set field="titleProperty" 
value="OrderReportPurchasesByPaymentMethod"/>
+                <set field="productStoreIds" 
from-field="parameters.productStoreId" type="List"/>
+                <set field="originFacilityIds" 
from-field="parameters.originFacilityId" type="List"/>
+                <set field="statusIds" from-field="parameters.statusId" 
type="List"/>
                 <property-map resource="OrderUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
@@ -121,10 +124,10 @@ under the License.
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <entity-condition entity-name="OrderPurchasePaymentSummary" 
list="orderPurchasePaymentSummaryList">
                     <condition-list combine="and">
-                        <condition-expr field-name="productStoreId" 
operator="equals" from-field="parameters.productStoreId" 
ignore-if-empty="true"/>
-                        <condition-expr field-name="originFacilityId" 
operator="equals" from-field="parameters.originFacilityId" 
ignore-if-empty="true"/>
+                        <condition-expr field-name="productStoreId" 
operator="in" from-field="productStoreIds" ignore-if-empty="true"/>
+                        <condition-expr field-name="originFacilityId" 
operator="in" from-field="originFacilityIds" ignore-if-empty="true"/>
                         <condition-expr field-name="terminalId" 
operator="equals" from-field="parameters.terminalId" ignore-if-empty="true"/>
-                        <condition-expr field-name="statusId" 
operator="equals" from-field="parameters.statusId" ignore-if-empty="true"/>
+                        <condition-expr field-name="statusId" operator="in" 
from-field="statusIds" ignore-if-empty="true"/>
                         <condition-expr field-name="orderDate" 
operator="greater-equals" from-field="parameters.fromOrderDate" 
ignore-if-empty="true"/>
                         <condition-expr field-name="orderDate" operator="less" 
from-field="parameters.thruOrderDate" ignore-if-empty="true"/>
                     </condition-list>
@@ -152,17 +155,20 @@ under the License.
         <section>
             <actions>
                 <set field="titleProperty" 
value="OrderReportPurchasesByProduct"/>
+                <set field="productStoreIds" 
from-field="parameters.productStoreId" type="List"/>
+                <set field="originFacilityIds" 
from-field="parameters.originFacilityId" type="List"/>
+                <set field="statusIds" from-field="parameters.statusId" 
type="List"/>
                 <property-map resource="OrderUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
                 <entity-condition entity-name="OrderPurchaseProductSummary" 
list="orderPurchaseProductSummaryList">
                     <condition-list combine="and">
-                        <condition-expr field-name="productStoreId" 
operator="equals" from-field="parameters.productStoreId" 
ignore-if-empty="true"/>
-                        <condition-expr field-name="orderTypeId" 
operator="equals" from-field="parameters.orderTypeId" ignore-if-empty="true"/>
-                        <condition-expr field-name="originFacilityId" 
operator="equals" from-field="parameters.originFacilityId" 
ignore-if-empty="true"/>
+                        <condition-expr field-name="productStoreId" 
operator="in" from-field="productStoreIds" ignore-if-empty="true"/>
+                        <condition-expr field-name="orderTypeId" 
operator="equals" from-field="PURCHASE_ORDER" ignore-if-empty="true"/>
+                        <condition-expr field-name="originFacilityId" 
operator="in" from-field="originFacilityIds" ignore-if-empty="true"/>
                         <condition-expr field-name="terminalId" 
operator="equals" from-field="parameters.terminalId" ignore-if-empty="true"/>
-                        <condition-expr field-name="statusId" 
operator="equals" from-field="parameters.statusId" ignore-if-empty="true"/>
+                        <condition-expr field-name="statusId" operator="in" 
from-field="statusIds" ignore-if-empty="true"/>
                         <condition-expr field-name="orderDate" 
operator="greater-equals" from-field="parameters.fromOrderDate" 
ignore-if-empty="true"/>
                         <condition-expr field-name="orderDate" operator="less" 
from-field="parameters.thruOrderDate" ignore-if-empty="true"/>
                     </condition-list>


Reply via email to