svn commit: r811606 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

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

svn commit: r811606 - /ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java

ashish-18
Author: ashish
Date: Sat Sep  5 08:43:36 2009
New Revision: 811606

URL: http://svn.apache.org/viewvc?rev=811606&view=rev
Log:
Few more improvements.

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

Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=811606&r1=811605&r2=811606&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Sat Sep  5 08:43:36 2009
@@ -219,10 +219,12 @@
                         productDescription = prod.getString("productName");
                     }
                     String startPrice = (String)context.get("startPrice");
+                    String currencyUomId = null;
                     if (UtilValidate.isEmpty(startPrice)) {
                         GenericValue startPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelatedByAnd("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MINIMUM_PRICE"))));
                         if (UtilValidate.isNotEmpty(startPriceValue)) {
                             startPrice = startPriceValue.getString("price");
+                            currencyUomId = startPriceValue.getString("currencyUomId");
                         } else {
                             return ServiceUtil.returnFailure("Unable to find a starting price for auction of product with id [" + prod.getString("productId") + "]");
                         }
@@ -285,7 +287,10 @@
                     UtilXml.addChildElementValue(primaryCatElem, "CategoryID", primaryCategoryId, itemDocument);
 
                     Element startPriceElem = UtilXml.addChildElementValue(itemElem, "StartPrice", startPrice, itemDocument);
-                    startPriceElem.setAttribute("currencyID", "USD");
+                    if (UtilValidate.isEmpty(currencyUomId)) {
+                        currencyUomId = UtilProperties.getPropertyValue("general.properties", "currency.uom.id.default", "USD");
+                    }
+                    startPriceElem.setAttribute("currencyID", currencyUomId);
                 }
                 //Debug.logInfo("The generated string is ======= " + UtilXml.writeXmlDocument(itemDocument), module);
                 dataItemsXml.append(UtilXml.writeXmlDocument(itemDocument));