Author: ashish
Date: Wed Nov 4 08:38:58 2009
New Revision: 832680
URL: http://svn.apache.org/viewvc?rev=832680&view=rev
Log:
Applied patch from jira issue - OFBIZ-3139 - Correct refunded amount does not
go to Google Checkout when we returns more than 1 qty of a item.
When we creates return for orders placed through Google Checkout then correct
refunded amount does not go to Google Checkout.
Thanks Pranay / Arun for the contribution.
Modified:
ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml
ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
Modified: ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml?rev=832680&r1=832679&r2=832680&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/googlecheckout/servicedef/secas.xml Wed Nov 4
08:38:58 2009
@@ -40,8 +40,8 @@
<!-- return related services -->
<eca service="updateReturnHeader" event="commit" run-on-failure="false"
run-on-error="false">
- <condition field-name="statusId" operator="equals"
value="RETURN_COMPLETED"/>
- <condition field-name="currentStatusId" operator="not-equals"
value="RETURN_COMPLETED"/>
+ <condition field-name="statusId" operator="equals"
value="RETURN_RECEIVED"/>
+ <condition field-name="currentStatusId" operator="not-equals"
value="RETURN_RECEIVED"/>
<action service="sendGoogleReturnRequest" mode="sync"/>
</eca>
Modified:
ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java?rev=832680&r1=832679&r2=832680&view=diff
==============================================================================
---
ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
(original)
+++
ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
Wed Nov 4 08:38:58 2009
@@ -298,7 +298,8 @@
// sort by order
Map<String, BigDecimal> toRefund = FastMap.newInstance();
Map<String, List<String>> toReturn = FastMap.newInstance();
-
+ BigDecimal refundTotal = new BigDecimal(0.0);
+
List<GenericValue> returnItems = null;
try {
returnItems = delegator.findByAnd("ReturnItem",
UtilMisc.toMap("returnId", returnId));
@@ -313,7 +314,7 @@
GenericValue order = findGoogleOrder(delegator, orderId);
if (order != null) {
- BigDecimal refundTotal = toRefund.get(orderId);
+ refundTotal = toRefund.get(orderId);
if (refundTotal == null) {
refundTotal = new BigDecimal(0.0);
}
@@ -323,7 +324,8 @@
}
// get the values from the return item
- BigDecimal returnPrice =
returnItem.getBigDecimal("returnPrice");
+ BigDecimal returnQty =
returnItem.getBigDecimal("returnQuantity");
+ BigDecimal returnPrice =
returnItem.getBigDecimal("returnPrice").multiply(returnQty);
String productId = returnItem.getString("productId");
// only look at refund returns to calculate the refund
amount