Author: ashish
Date: Sat Jul 24 06:13:06 2010
New Revision: 978806

URL: http://svn.apache.org/viewvc?rev=978806&view=rev
Log:
Applied patch from jira issue - OFBIZ-3872.
Error in Screen Ap -> Invoices -> Commission Run.

The following error screen appears when we click on find button with

partyId - Demo Agent (DemoCustAgent)
fromDate - (set current date)

org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen 
component://accounting/widget/ap/InvoiceScreens.xml#CommissionRun: 
java.lang.ClassCastException: java.lang.String cannot be cast to 
java.util.Collection (java.lang.String cannot be cast to java.util.Collection)

Thanks Amit for the contribution.

Modified:
    
ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
    ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml

Modified: 
ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy?rev=978806&r1=978805&r2=978806&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy
 Sat Jul 24 06:13:06 2010
@@ -22,7 +22,6 @@ import org.ofbiz.entity.condition.Entity
 
 fromDate = parameters.fromDate;
 thruDate = parameters.thruDate;
-partyIds = parameters.partyIds;
 
 if (fromDate) {
     List invoiceCond = [];
@@ -33,8 +32,8 @@ if (fromDate) {
     if (thruDate) {
         invoiceCond.add(EntityCondition.makeCondition("invoiceDate", 
EntityOperator.LESS_THAN_EQUAL_TO, Timestamp.valueOf(thruDate)));
     }
-    if (partyIds) {
-        invoiceCond.add(EntityCondition.makeCondition("invoiceRolePartyId", 
EntityOperator.IN, partyIds));
+    if (context.salesRepPartyList) {
+        invoiceCond.add(EntityCondition.makeCondition("invoiceRolePartyId", 
EntityOperator.IN, context.salesRepPartyList));
     }
     invoiceList = delegator.findList("InvoiceAndRole", 
EntityCondition.makeCondition(invoiceCond, EntityOperator.AND), null, null, 
null, false);
 

Modified: 
ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl?rev=978806&r1=978805&r2=978806&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl 
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl 
Sat Jul 24 06:13:06 2010
@@ -76,8 +76,8 @@ function enableSubmitButton() {
 
 <#if invoices?has_content >
   <form name="listSalesInvoices" id="listSalesInvoices" method="post">
-    <#if parties?has_content>
-      <input type="hidden" name="partyIds" value="${parties?if_exists}"/>
+    <#if salesRepPartyList?has_content>
+      ${setRequestAttribute("partyIds", salesRepPartyList)}
     </#if>
     <div align="right">
       <select name="serviceName" id="serviceName" 
onchange="javascript:setServiceName(this);">

Modified: ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml?rev=978806&r1=978805&r2=978806&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ap/InvoiceScreens.xml Sat Jul 24 
06:13:06 2010
@@ -165,7 +165,7 @@ under the License.
             <actions>
                 <set field="titleProperty" 
value="AccountingFindSalesInvoicesForCommissionRun"/>
                 <set field="tabButtonItem" value="commissionRun"/>
-                <set field="parties" type="List" 
from-field="parameters.partyIds"/>
+                <set field="salesRepPartyList" type="List" 
from-field="parameters.partyIds"/>
                 <script 
location="component://accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy"/>
             </actions>
             <widgets>


Reply via email to