svn commit: r1062152 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java

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

svn commit: r1062152 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java

jleroux@apache.org
Author: jleroux
Date: Sat Jan 22 13:15:36 2011
New Revision: 1062152

URL: http://svn.apache.org/viewvc?rev=1062152&view=rev
Log:
A patch from Arun Patidar "Some misc issues in ebayStore component." (https://issues.apache.org/jira/browse/OFBIZ-4118) - OFBIZ-4118

One more patch for setting shipping method in ofbiz order during import order by ebayStore component.

Modified:
    ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java?rev=1062152&r1=1062151&r2=1062152&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java Sat Jan 22 13:15:36 2011
@@ -175,6 +175,14 @@ public class EbayHelper {
             if (UtilValidate.isNotEmpty(ebayShippingMethod)) {
                 partyId = ebayShippingMethod.getString("carrierPartyId");
                 shipmentMethodTypeId = ebayShippingMethod.getString("shipmentMethodTypeId");
+            } else {
+                //Find ebay shipping method on the basis of shipmentMethodName so that we can create new record with productStorId, EbayShippingMethod data is required for atleast one productStore
+                List<GenericValue> ebayShippingMethods = delegator.findByAnd("EbayShippingMethod", UtilMisc.toMap("shipmentMethodName", shippingService));
+                ebayShippingMethod = EntityUtil.getFirst(ebayShippingMethods);
+                ebayShippingMethod.put("productStoreId", productStoreId);
+                delegator.create(ebayShippingMethod);
+                partyId = ebayShippingMethod.getString("carrierPartyId");
+                shipmentMethodTypeId = ebayShippingMethod.getString("shipmentMethodTypeId");
             }
         } catch (GenericEntityException e) {
             Debug.logInfo("Unable to find EbayShippingMethod", module);