svn commit: r421016 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

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

svn commit: r421016 - /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

sichen
Author: sichen
Date: Tue Jul 11 15:32:59 2006
New Revision: 421016

URL: http://svn.apache.org/viewvc?rev=421016&view=rev
Log:
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) {