Author: lektran
Date: Sat Jun 16 15:21:51 2007
New Revision: 547992
URL:
http://svn.apache.org/viewvc?view=rev&rev=547992Log:
Applied patch from Andrew Sykes, OFBIZ-1059 - Amended orders lose Financial Account PaymentMethod
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?view=diff&rev=547992&r1=547991&r2=547992==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Sat Jun 16 15:21:51 2007
@@ -240,12 +240,19 @@
}
Double maxAmount = opp.getDouble("maxAmount");
String overflow = opp.getString("overflowFlag");
+
+ ShoppingCart.CartPaymentInfo cpi = null;
+
if ((overflow == null || !"Y".equals(overflow)) && oppi.hasNext()) {
- cart.addPaymentAmount(paymentId, maxAmount);
+ cpi = cart.addPaymentAmount(paymentId, maxAmount);
Debug.log("Added Payment: " + paymentId + " / " + maxAmount, module);
} else {
- cart.addPayment(paymentId);
+ cpi = cart.addPayment(paymentId);
Debug.log("Added Payment: " + paymentId + " / [no max]", module);
+ }
+ // for finance account the finAccountId needs to be set
+ if ("FIN_ACCOUNT".equals(paymentId)) {
+ cpi.finAccountId = opp.getString("finAccountId");
}
}
} else {