You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/11/10 15:14:53 UTC

svn commit: r834473 - /ofbiz/trunk/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleRequestServices.java

Author: ashish
Date: Tue Nov 10 14:14:52 2009
New Revision: 834473

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