Author: jaz
Date: Fri Sep 14 12:21:48 2007
New Revision: 575780
URL:
http://svn.apache.org/viewvc?rev=575780&view=revLog:
patch which fixes the refund financial account code; added missing partyIds needed by returns to process
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=575780&r1=575779&r2=575780&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Fri Sep 14 12:21:48 2007
@@ -364,6 +364,8 @@
// make sure there is an order available to refund
if (orderId != null && orderItemSeqId != null) {
+ GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId",orderId));
+ GenericValue productStore = delegator.getRelatedOne("ProductStore", orderHeader);
GenericValue orderItem = delegator.findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
if (!"ITEM_CANCELLED".equals(orderItem.getString("statusId"))) {
@@ -379,7 +381,7 @@
refundAmount = refundAmount.add(refAmt);
// create the return header
- Map rhCtx = UtilMisc.toMap("returnHeaderTypeId", "CUSTOMER_RETURN", "userLogin", userLogin);
+ Map rhCtx = UtilMisc.toMap("returnHeaderTypeId", "CUSTOMER_RETURN", "fromPartyId", finAccount.getString("ownerPartyId"), "toPartyId", productStore.getString("payToPartyId"), "userLogin", userLogin);
Map rhResp = dispatcher.runSync("createReturnHeader", rhCtx);
if (ServiceUtil.isError(rhResp)) {
throw new GeneralException(ServiceUtil.getErrorMessage(rhResp));