Author: ashish
Date: Tue Nov 10 14:14:52 2009
New Revision: 834473
URL:
http://svn.apache.org/viewvc?rev=834473&view=revLog:
Applied fix from jira issue OFBIZ-3158 - Send item shipped request from OFBiz to Google in a collection instead of sending multiple request for each item shipped.
The last implementation was blocking Quick Ship Entire order processing.
Thanks Ratnesh for reporting the bug and Arun for quick fix.
Modified:
ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java
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=834473&r1=834472&r2=834473&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java (original)
+++ ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java Tue Nov 10 14:14:52 2009
@@ -513,20 +513,21 @@
List<GenericValue> issued = delegator.findByAnd("ItemIssuance", UtilMisc.toMap("shipmentId", shipmentId));
if (UtilValidate.isNotEmpty(issued)) {
try {
+ GenericValue googleOrder = null;
ShipItemsRequest isr = null;
for (GenericValue issue : issued) {
GenericValue orderItem = issue.getRelatedOne("OrderItem");
String shipmentItemSeqId = issue.getString("shipmentItemSeqId");
String productId = orderItem.getString("productId");
String orderId = issue.getString("orderId");
- GenericValue order = findGoogleOrder(delegator, orderId);
- if (UtilValidate.isNotEmpty(order)) {
- MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(order));
+ googleOrder = findGoogleOrder(delegator, orderId);
+ if (UtilValidate.isNotEmpty(googleOrder)) {
+ MerchantInfo mInfo = getMerchantInfo(delegator, getProductStoreFromOrder(googleOrder));
if (UtilValidate.isEmpty(mInfo)) {
Debug.logInfo("Cannot find Google MerchantInfo for Order #" + orderId, module);
continue;
}
- String externalId = order.getString("externalId");
+ String externalId = googleOrder.getString("externalId");
if (UtilValidate.isEmpty(isr)) {
isr = new ShipItemsRequest(mInfo, externalId);
}
@@ -561,7 +562,9 @@
}
}
}
- isr.send();
+ if (UtilValidate.isNotEmpty(googleOrder)) {
+ isr.send();
+ }
} catch (CheckoutException e) {
Debug.logError(e, module);
throw new GeneralException(e);