svn commit: r792119 - in /ofbiz/trunk/applications/accounting: webapp/ar/WEB-INF/actions/BatchPayments.groovy webapp/ar/payment/batchPayments.ftl widget/ar/ArPaymentScreens.xml widget/ar/forms/ArPaymentForms.xml

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

svn commit: r792119 - in /ofbiz/trunk/applications/accounting: webapp/ar/WEB-INF/actions/BatchPayments.groovy webapp/ar/payment/batchPayments.ftl widget/ar/ArPaymentScreens.xml widget/ar/forms/ArPaymentForms.xml

ashish-18
Author: ashish
Date: Wed Jul  8 12:49:04 2009
New Revision: 792119

URL: http://svn.apache.org/viewvc?rev=792119&view=rev
Log:
Applied patch from jira issue OFBIZ-2699 - Create Payment Batches for Ar Payment.
Following things are covered in this patch:
-- The Payments display in search should shown if their PaymentGroupMembers records expires i.e thruDate is set.
-- Search now filtered on partyIdTo.
-- Miscellaneous fixes done in Running Total functionality, now no server error occurs on calling.

Thanks Rishi for your contribution on this.

Modified:
    ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
    ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
    ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
    ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml

Modified: ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy?rev=792119&r1=792118&r2=792119&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy Wed Jul  8 12:49:04 2009
@@ -18,6 +18,7 @@
  */
 
 import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
 
@@ -33,13 +34,16 @@
     if (partyIdFrom) {
         paymentCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom));
     }
+    if (organizationPartyId) {
+        paymentCond.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, organizationPartyId));
+    }
     payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
     paymentListWithCreditCard = [];
     paymentListWithoutCreditCard = [];
     if (payments) {
         payments.each { payment ->
-            paymentGroupMember = delegator.findList("PaymentGroupMember", EntityCondition.makeCondition([paymentId : payment.paymentId]), null, null, null, false);
-            if (!paymentGroupMember) {
+            paymentGroupMembers = EntityUtil.filterByDate(delegator.findList("PaymentGroupMember", EntityCondition.makeCondition([paymentId : payment.paymentId]), null, null, null, false));
+            if (!paymentGroupMembers) {
                 if (cardType && payment.paymentMethodId) {
                     creditCard = delegator.findOne("CreditCard", [paymentMethodId : payment.paymentMethodId], false);
                     if (creditCard.cardType == cardType) {

Modified: ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=792119&r1=792118&r2=792119&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Wed Jul  8 12:49:04 2009
@@ -19,7 +19,6 @@
 
 <script language="JavaScript" type="text/javascript">
 <!-- //
-
 function togglePaymentId(master) {
     var form = document.paymentBatchForm;
     var payments = form.elements.length;
@@ -32,16 +31,29 @@
     getPaymentRunningTotal(master);
 }
 function getPaymentRunningTotal(e) {
+    var form = document.paymentBatchForm;
+    var payments = form.elements.length;
+    var isSingle = true;
+    for (var i = 0; i < payments; i++) {
+        var element = form.elements[i];
+        if (element.name == "paymentIds" && element.checked) {
+            isSingle = false;
+        }
+    }
     if (!($(e).checked)) {
         $('checkAllPayments').checked = false;
     }
-    new Ajax.Request('getPaymentRunningTotal', {
-        asynchronous: false,
-        onSuccess: function(transport) {
-            var data = transport.responseText.evalJSON(true);
-            $('showPaymentRunningTotal').update(data.paymentRunningTotal);
-        }, parameters: $('paymentBatchForm').serialize(), requestHeaders: {Accept: 'application/json'}
-    });
+    if (!isSingle) {
+        new Ajax.Request('getPaymentRunningTotal', {
+            asynchronous: false,
+            onSuccess: function(transport) {
+                var data = transport.responseText.evalJSON(true);
+                $('showPaymentRunningTotal').update(data.paymentRunningTotal);
+            }, parameters: $('paymentBatchForm').serialize(), requestHeaders: {Accept: 'application/json'}
+        });
+    } else {
+        $('showPaymentRunningTotal').update("");
+    }
 }
 // -->
 

Modified: ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml?rev=792119&r1=792118&r2=792119&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ar/ArPaymentScreens.xml Wed Jul  8 12:49:04 2009
@@ -64,6 +64,7 @@
                 <set field="fromDate" type="Timestamp" from-field="parameters.fromDate"/>
                 <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
                 <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
+                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
                 <script location="component://accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy"/>
             </actions>
             <widgets>

Modified: ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml?rev=792119&r1=792118&r2=792119&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ar/forms/ArPaymentForms.xml Wed Jul  8 12:49:04 2009
@@ -22,6 +22,9 @@
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
 
     <form name="FindBatchPayments" type="single" target="batchPayments">
+        <actions>
+            <set field="organizationPartyId" from-field="organizationPartyId" default-value="${defaultOrganizationPartyId}"/>
+        </actions>
         <field name="paymentMethodTypeId" title="${uiLabelMap.FormFieldTitle_paymentMethodTypeId}*" required-field="true">
             <drop-down allow-empty="false">
                 <entity-options entity-name="PaymentMethodType" description="${description}">
@@ -29,6 +32,7 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="organizationPartyId"><hidden/></field>
         <field name="cardType">
             <drop-down allow-empty="true">
                 <entity-options entity-name="Enumeration" description="${enumCode}" key-field-name="enumCode">