svn commit: r479750 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java

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

svn commit: r479750 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java

jacopoc
Author: jacopoc
Date: Mon Nov 27 12:26:33 2006
New Revision: 479750

URL: http://svn.apache.org/viewvc?view=rev&rev=479750
Log:
This patch fixes an error in the calculation of the offline payments received for an order:
the new amount received is summed two times to the total of already received offline amounts.
For example, if the order total is $80, and you receive an offline payment of $50, due to the bad calculation, the method says 50+50 = 100 > 80 and so approves the order.
OFBIZ-484

Modified:
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java?view=diff&rev=479750&r1=479749&r2=479750
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java Mon Nov 27 12:26:33 2006
@@ -174,7 +174,6 @@
         }
 
         Iterator pmti = paymentMethodTypes.iterator();
-        double paymentTally = 0.00;
         while (pmti.hasNext()) {
             GenericValue paymentMethodType = (GenericValue) pmti.next();
             String paymentMethodTypeId = paymentMethodType.getString("paymentMethodTypeId");
@@ -189,7 +188,6 @@
                     return "error";
                 }
                 if (paymentTypeAmount > 0.00) {
-                    paymentTally += paymentTypeAmount;
 
                     // create the OrderPaymentPreference
                     // TODO: this should be done with a service
@@ -236,6 +234,7 @@
         // get the current payment prefs
         GenericValue offlineValue = null;
         List currentPrefs = null;
+        double paymentTally = 0.00;
         try {
             List oppFields = UtilMisc.toList(new EntityExpr("orderId", EntityOperator.EQUALS, orderId),
                     new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED"));