Author: sichen
Date: Tue Jul 11 15:32:59 2006
New Revision: 421016
URL:
http://svn.apache.org/viewvc?rev=421016&view=revLog:
Fixed bug where BillingAccount created from return with refund of store credit would not show up in payment methods when creating order for that customer.
Modified:
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=421016&r1=421015&r2=421016&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Tue Jul 11 15:32:59 2006
@@ -543,7 +543,8 @@
if (billingAccountId == null) {
// create new BillingAccount w/ 0 balance
try {
- Map newBa = dispatcher.runSync("createBillingAccount", UtilMisc.toMap("accountLimit", new Double(0.00), "description", "Credit Account", "userLogin", userLogin));
+ // Note that accountLimit must be 0.0 for store credits, because the available balance of BillingAccounts is calculated as accountLimit + sum of Payments - sum of Invoices
+ Map newBa = dispatcher.runSync("createBillingAccount", UtilMisc.toMap("accountLimit", new Double(0.00), "description", "Credit Account", "userLogin", userLogin, "accountCurrencyUomId", returnHeader.get("currencyUomId")));
if (!newBa.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) {
billingAccountId = (String) newBa.get("billingAccountId");
if (billingAccountId != null) {