svn commit: r798481 - /ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy

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

svn commit: r798481 - /ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy

apatel-2
Author: apatel
Date: Tue Jul 28 10:45:38 2009
New Revision: 798481

URL: http://svn.apache.org/viewvc?rev=798481&view=rev
Log:
Code reformating. No functional changes.

Modified:
    ofbiz/trunk/applications/accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy

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=798481&r1=798480&r2=798481&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 Tue Jul 28 10:45:38 2009
@@ -23,49 +23,48 @@
 import org.ofbiz.entity.condition.EntityOperator;
 
 List paymentCond = [];
-    if (paymentMethodTypeId) {
+if (paymentMethodTypeId) {
     paymentCond.add(EntityCondition.makeCondition("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId));
-    }
-    if (fromDate) {
-        paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
-    }
-    if (thruDate) {
-        paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
-    }
-    if (partyIdFrom) {
-        paymentCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom));
-    }
-    if (organizationPartyId) {
-        paymentCond.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, organizationPartyId));
-    }
-    if (finAccountId) {
-        finAccountTransList = delegator.findList("FinAccountTrans", EntityCondition.makeCondition([finAccountId : finAccountId]), null, null, null, false);
-        if (finAccountTransList) {
-            finAccountTransIds = EntityUtil.getFieldListFromEntityList(finAccountTransList, "finAccountTransId", true);
-            paymentCond.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.IN, finAccountTransIds));
-        }
-    }
-    payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
-    paymentListWithCreditCard = [];
-    paymentListWithoutCreditCard = [];
-    if (payments) {
-        payments.each { payment ->
-            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) {
-                        paymentListWithCreditCard.add(payment);
-                    }
-                } else if (UtilValidate.isEmpty(cardType)) {
-                    paymentListWithoutCreditCard.add(payment);
+}
+if (fromDate) {
+    paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
+}
+if (thruDate) {
+    paymentCond.add(EntityCondition.makeCondition("effectiveDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
+}
+if (partyIdFrom) {
+    paymentCond.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom));
+}
+if (organizationPartyId) {
+    paymentCond.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, organizationPartyId));
+}
+if (finAccountId) {
+    finAccountTransList = delegator.findList("FinAccountTrans", EntityCondition.makeCondition([finAccountId : finAccountId]), null, null, null, false);
+    if (finAccountTransList) {
+        finAccountTransIds = EntityUtil.getFieldListFromEntityList(finAccountTransList, "finAccountTransId", true);
+        paymentCond.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.IN, finAccountTransIds));
+    }
+}
+payments = delegator.findList("Payment", EntityCondition.makeCondition(paymentCond, EntityOperator.AND), null, null, null, false);
+paymentListWithCreditCard = [];
+paymentListWithoutCreditCard = [];
+if (payments) {
+    payments.each { payment ->
+        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) {
+                    paymentListWithCreditCard.add(payment);
                 }
+            } else if (UtilValidate.isEmpty(cardType)) {
+                paymentListWithoutCreditCard.add(payment);
             }
-                
-        }
-        if (paymentListWithCreditCard) {
-            context.paymentList = paymentListWithCreditCard;
-        } else {
-            context.paymentList = paymentListWithoutCreditCard;
         }
     }
+    if (paymentListWithCreditCard) {
+        context.paymentList = paymentListWithCreditCard;
+    } else {
+        context.paymentList = paymentListWithoutCreditCard;
+    }
+}
\ No newline at end of file