svn commit: r739225 - in /ofbiz/trunk: .classpath LICENSE applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

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

svn commit: r739225 - in /ofbiz/trunk: .classpath LICENSE applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

bibryam
Author: bibryam
Date: Fri Jan 30 09:54:05 2009
New Revision: 739225

URL: http://svn.apache.org/viewvc?rev=739225&view=rev
Log:
Replaced my changes from r738810 per David's advice.
Put updated json library names.

Modified:
    ofbiz/trunk/.classpath
    ofbiz/trunk/LICENSE
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Modified: ofbiz/trunk/.classpath
URL: http://svn.apache.org/viewvc/ofbiz/trunk/.classpath?rev=739225&r1=739224&r2=739225&view=diff
==============================================================================
--- ofbiz/trunk/.classpath (original)
+++ ofbiz/trunk/.classpath Fri Jan 30 09:54:05 2009
@@ -135,7 +135,7 @@
  <classpathentry kind="lib" path="framework/base/lib/scripting/groovy-1.5.6.jar"/>
  <classpathentry kind="lib" path="framework/base/lib/jpim-0.1.jar"/>
  <classpathentry kind="lib" path="framework/base/lib/freemarker-2.3.15.jar"/>
- <classpathentry kind="lib" path="framework/webapp/lib/json-lib-0.9.jar"/>
+ <classpathentry kind="lib" path="framework/webapp/lib/json-lib-2.2.3-jdk15.jar"/>
  <classpathentry kind="lib" path="framework/webapp/lib/ezmorph-0.9.1.jar"/>
  <classpathentry kind="lib" path="specialpurpose/pos/lib/looks-2.0.2.jar"/>
  <classpathentry kind="lib" path="specialpurpose/pos/lib/jpos18-controls.jar"/>

Modified: ofbiz/trunk/LICENSE
URL: http://svn.apache.org/viewvc/ofbiz/trunk/LICENSE?rev=739225&r1=739224&r2=739225&view=diff
==============================================================================
--- ofbiz/trunk/LICENSE (original)
+++ ofbiz/trunk/LICENSE Fri Jan 30 09:54:05 2009
@@ -83,7 +83,7 @@
 ofbiz/trunk/framework/webapp/lib/fop-0.94.jar
 ofbiz/trunk/framework/webapp/lib/velocity-1.5.jar
 ofbiz/trunk/framework/webapp/lib/xmlgraphics-commons-1.2.jar
-ofbiz/trunk/framework/webapp/lib/json-lib-0.9.jar
+ofbiz/trunk/framework/webapp/lib/json-lib-2.2.3-jdk15.jar
 ofbiz/trunk/framework/webapp/lib/ezmorph-0.9.1.jar
 ofbiz/trunk/framework/webapp/lib/rome-0.9.jar
 ofbiz/trunk/framework/webapp/lib/serializer-2.7.0.jar

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=739225&r1=739224&r2=739225&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Fri Jan 30 09:54:05 2009
@@ -21,7 +21,6 @@
 import java.math.BigDecimal;
 import java.math.MathContext;
 import java.sql.Timestamp;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
@@ -612,12 +611,12 @@
 
         // Convert the quote adjustment to order header adjustments and
         // put them in a map: the key/values pairs are quoteItemSeqId/List of adjs
-        Map<String, List<GenericValue>> orderAdjsMap = new HashMap(); // HashMap supports null key
+        Map<String, List<GenericValue>> orderAdjsMap = FastMap.newInstance() ;
         for (GenericValue quoteAdj : quoteAdjs) {
-            List<GenericValue> orderAdjs = (List<GenericValue>)orderAdjsMap.get(quoteAdj.get("quoteItemSeqId"));
+            List<GenericValue> orderAdjs = (List<GenericValue>)orderAdjsMap.get(UtilValidate.isNotEmpty(quoteAdj.getString("quoteItemSeqId")) ? quoteAdj.getString("quoteItemSeqId") : quoteId);
             if (orderAdjs == null) {
                 orderAdjs = FastList.newInstance();
-                orderAdjsMap.put(quoteAdj.getString("quoteItemSeqId"), orderAdjs);
+                orderAdjsMap.put(UtilValidate.isNotEmpty(quoteAdj.getString("quoteItemSeqId")) ? quoteAdj.getString("quoteItemSeqId") : quoteId, orderAdjs);
             }
             // convert quote adjustments to order adjustments
             GenericValue orderAdj = delegator.makeValue("OrderAdjustment");
@@ -745,7 +744,7 @@
         // If applyQuoteAdjustments is set to false then standard cart adjustments are used.
         if (applyQuoteAdjustments) {
             // The cart adjustments, derived from quote adjustments, are added to the cart
-            List<GenericValue> adjs = (List<GenericValue>)orderAdjsMap.get(null);
+            List<GenericValue> adjs = (List<GenericValue>)orderAdjsMap.get(quoteId);
             if (adjs != null) {
                 cart.getAdjustments().addAll(adjs);
             }