svn commit: r1744117 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy webapp/accounting/WEB-INF/controller.xml widget/PaymentForms.xml widget/PaymentScreens.xml

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

svn commit: r1744117 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy webapp/accounting/WEB-INF/controller.xml widget/PaymentForms.xml widget/PaymentScreens.xml

jleroux@apache.org
Author: jleroux
Date: Mon May 16 19:38:14 2016
New Revision: 1744117

URL: http://svn.apache.org/viewvc?rev=1744117&view=rev
Log:
Fixes "Pagination Problem in Find Invoices By Due Date"  - https://issues.apache.org/jira/browse/OFBIZ-7070

Instead of calling the getInvoicePaymentInfoListByDueDateOffset service through the controller, uses redirect-parameter and a groovy script to call the service. This prevents the parameters in the pagination URLs.
The groovy script is needed to prevent the initial search which would always be done by a simple "<service..." call in the screen (daysOffset must not be null for the search to fire).

Added:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy   (with props)
Modified:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/PaymentForms.xml
    ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml

Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy?rev=1744117&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy (added)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy Mon May 16 19:38:14 2016
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.service.*;
+
+context.invoicePaymentInfoList = []
+
+if (parameters.daysOffset) { // it's not the initialisation but a real search request
+    serviceCtx = dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", "IN", parameters);
+    result = runService("getInvoicePaymentInfoListByDueDateOffset", serviceCtx)
+    context.invoicePaymentInfoList = result.invoicePaymentInfoList
+}
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=1744117&r1=1744116&r2=1744117&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon May 16 19:38:14 2016
@@ -374,23 +374,21 @@ under the License.
 
     <request-map uri="FindSalesInvoicesByDueDate">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="FindSalesInvoicesByDueDate"/>
-    </request-map>
-    <request-map uri="findSalesInvoicesByDueDate">
-        <security https="false" auth="true"/>
-        <event type="service" invoke="getInvoicePaymentInfoListByDueDateOffset"/>
-        <response name="success" type="view" value="FindSalesInvoicesByDueDate"/>
-        <response name="error" type="view" value="FindSalesInvoicesByDueDate"/>
+        <response name="success" type="view" value="FindSalesInvoicesByDueDate">
+            <redirect-parameter name="invoiceTypeId"/>
+            <redirect-parameter name="organizationPartyId"/>
+            <redirect-parameter name="partyId"/>
+            <redirect-parameter name="daysOffset"/>
+        </response>
     </request-map>
     <request-map uri="FindPurchaseInvoicesByDueDate">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="FindPurchaseInvoicesByDueDate"/>
-    </request-map>
-    <request-map uri="findPurchaseInvoicesByDueDate">
-        <security https="false" auth="true"/>
-        <event type="service" invoke="getInvoicePaymentInfoListByDueDateOffset"/>
-        <response name="success" type="view" value="FindPurchaseInvoicesByDueDate"/>
-        <response name="error" type="view" value="FindPurchaseInvoicesByDueDate"/>
+        <response name="success" type="view" value="FindPurchaseInvoicesByDueDate">
+            <redirect-parameter name="invoiceTypeId"/>
+            <redirect-parameter name="organizationPartyId"/>
+            <redirect-parameter name="partyId"/>
+            <redirect-parameter name="daysOffset"/>
+        </response>
     </request-map>
 
     <!-- Payment Group requests -->

Modified: ofbiz/trunk/applications/accounting/widget/PaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentForms.xml?rev=1744117&r1=1744116&r2=1744117&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/PaymentForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/PaymentForms.xml Mon May 16 19:38:14 2016
@@ -485,9 +485,8 @@ under the License.
         <field name="submitButton" title="${uiLabelMap.CommonSend}" widget-style="smallSubmit"><submit/></field>
     </form>
 
-    <form name="FindSalesInvoicesByDueDate" type="single" target="findSalesInvoicesByDueDate"
+    <form name="FindSalesInvoicesByDueDate" type="single" target="FindSalesInvoicesByDueDate"
         header-row-style="header-row" default-table-style="basic-table">
-        <field name="invoiceTypeId"><hidden value="SALES_INVOICE"/></field>
         <field name="organizationPartyId" parameter-name="partyIdFrom">
             <drop-down allow-empty="false">
                 <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId">
@@ -502,9 +501,8 @@ under the License.
             <submit button-type="button"/>
         </field>
     </form>
-    <form name="FindPurchaseInvoicesByDueDate" type="single" target="findPurchaseInvoicesByDueDate"
+    <form name="FindPurchaseInvoicesByDueDate" type="single" target="FindPurchaseInvoicesByDueDate"
         header-row-style="header-row" default-table-style="basic-table">
-        <field name="invoiceTypeId"><hidden value="PURCHASE_INVOICE"/></field>
         <field name="organizationPartyId" parameter-name="partyId">
             <drop-down allow-empty="false">
                 <entity-options description="${partyId}" entity-name="PartyRole" key-field-name="partyId">

Modified: ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml?rev=1744117&r1=1744116&r2=1744117&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/PaymentScreens.xml Mon May 16 19:38:14 2016
@@ -502,7 +502,8 @@ under the License.
                 <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
 
-                <set field="invoicePaymentInfoList" from-field="parameters.invoicePaymentInfoList" type="List"/>
+                <set field="parameters.invoiceTypeId" value="SALES_INVOICE"/>
+                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -534,7 +535,8 @@ under the License.
                 <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                 <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
 
-                <set field="invoicePaymentInfoList" from-field="parameters.invoicePaymentInfoList" type="List"/>
+                <set field="parameters.invoiceTypeId" value="PURCHASE_INVOICE"/>
+                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">