You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/11/08 16:16:33 UTC

svn commit: r1407117 - in /ofbiz/branches/release12.04: ./ applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/ applications/order/src/org/ofbiz/order/order/ applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/src/org...

Author: jleroux
Date: Thu Nov  8 15:16:32 2012
New Revision: 1407117

URL: http://svn.apache.org/viewvc?rev=1407117&view=rev
Log:
"Applied fix from trunk for revision: 1407116  " 
------------------------------------------------------------------------
r1407116 | jleroux | 2012-11-08 16:15:04 +0100 (jeu., 08 nov. 2012) | 21 lines

An enhanced patch from John McDonald for "Customer's Shipment Address Not Assigned to Dropship Purchase Orders" https://issues.apache.org/jira/browse/OFBIZ-3883

When buying drop ship products from the demo store the customer's shipping address is not saved with the purchase order, so the shipping address cannot be provided to the drop ship supplier. 

Steps to Reproduce:
* From the DropShip Category add "DropShip from BigSupplier" and "DropShip from DemoSupplier" to your cart. 
* Login as admin
* Use the one page checkout to order the products

Resulting Order: 
https://demo-trunk.ofbiz.apache.org:8443/ordermgr/control/orderview?orderId=WSCO10002
The purchase orders WS10003 and WS10004 are associated correctly with the order items, but as the shipping groups don't have addresses, the purchase orders don't have either.

Expectation:
All Shipment groups should have the shipping address assigned.

Actual:
Only the first shipment group has the shipping address assigned. 


jleroux: thanks to Paul Foxworthy's help I rather removed than deprecate the old methods and replaced them where relevant
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
    ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java
    ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
    ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1407116

Modified: ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java (original)
+++ ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java Thu Nov  8 15:16:32 2012
@@ -246,8 +246,8 @@ public class PayPalServices {
             if (estimate == null || estimate.compareTo(BigDecimal.ZERO) < 0) {
                 continue;
             }
-            cart.setShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
-            cart.setCarrierPartyId(shipMethod.getString("partyId"));
+            cart.setAllShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
+            cart.setAllCarrierPartyId(shipMethod.getString("partyId"));
             try {
                 coh.calcAndAddTax();
             } catch (GeneralException e) {
@@ -594,18 +594,18 @@ public class PayPalServices {
         // that was shown to the customer
         String shipMethod = decoder.get("SHIPPINGOPTIONNAME");
         if ("Calculated Offline".equals(shipMethod)) {
-            cart.setCarrierPartyId("_NA_");
-            cart.setShipmentMethodTypeId("NO_SHIPPING");
+            cart.setAllCarrierPartyId("_NA_");
+            cart.setAllShipmentMethodTypeId("NO_SHIPPING");
         } else {
             String[] shipMethodSplit = shipMethod.split(" - ");
-            cart.setCarrierPartyId(shipMethodSplit[0]);
+            cart.setAllCarrierPartyId(shipMethodSplit[0]);
             String shippingMethodTypeDesc = StringUtils.join(shipMethodSplit, " - ", 1, shipMethodSplit.length);
             try {
                 EntityCondition cond = EntityCondition.makeCondition(
                         UtilMisc.toMap("productStoreId", cart.getProductStoreId(), "partyId", shipMethodSplit[0], "roleTypeId", "CARRIER", "description", shippingMethodTypeDesc)
                );
                 GenericValue shipmentMethod = EntityUtil.getFirst(delegator.findList("ProductStoreShipmentMethView", cond, null, null, null, false));
-                cart.setShipmentMethodTypeId(shipmentMethod.getString("shipmentMethodTypeId"));
+                cart.setAllShipmentMethodTypeId(shipmentMethod.getString("shipmentMethodTypeId"));
             } catch (GenericEntityException e1) {
                 Debug.logError(e1, module);
             }
@@ -619,7 +619,7 @@ public class PayPalServices {
             }
         }
         cart.cleanUpShipGroups();
-        cart.setShippingContactMechId(postalContactId);
+        cart.setAllShippingContactMechId(postalContactId);
         Map<String, Object> result = ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0);
         if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) {
             return ServiceUtil.returnError((String) result.get(ModelService.ERROR_MESSAGE));

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Nov  8 15:16:32 2012
@@ -4864,7 +4864,7 @@ public class OrderServices {
                             // set checkout options
                             cart.setDefaultCheckoutOptions(dispatcher);
                             // the shipping address is the one of the customer
-                            cart.setShippingContactMechId(shipGroup.getString("contactMechId"));
+                            cart.setAllShippingContactMechId(shipGroup.getString("contactMechId"));
                             // associate ship groups of sales and purchase orders
                             ShoppingCart.CartShipInfo cartShipInfo = cart.getShipGroups().get(0);
                             cartShipInfo.setAssociatedShipGroupSeqId(shipGroup.getString("shipGroupSeqId"));

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Thu Nov  8 15:16:32 2012
@@ -234,8 +234,8 @@ public class CheckOutEvents {
 
         // if no shipping applies, set the no shipment method and skip to payment
         if (!cart.shippingApplies()) {
-            cart.setShipmentMethodTypeId("NO_SHIPPING");
-            cart.setCarrierPartyId("_NA_");
+            cart.setAllShipmentMethodTypeId("NO_SHIPPING");
+            cart.setAllCarrierPartyId("_NA_");
             page = "payment";
         }
 
@@ -273,7 +273,7 @@ public class CheckOutEvents {
         ShoppingCart cart = (ShoppingCart) request.getSession().getAttribute("shoppingCart");
         String shipToCustomerPartyId = request.getParameter("shipToCustomerPartyId");
         cart.setShipToCustomerPartyId(shipToCustomerPartyId);
-        cart.setShippingContactMechId(null);
+        cart.setAllShippingContactMechId(null);
         return "success";
     }
 

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Thu Nov  8 15:16:32 2012
@@ -115,7 +115,7 @@ public class CheckOutHelper {
 
         // set the shipping address
         if (UtilValidate.isNotEmpty(shippingContactMechId)) {
-            this.cart.setShippingContactMechId(shippingContactMechId);
+            this.cart.setAllShippingContactMechId(shippingContactMechId);
         } else if (cart.shippingApplies()) {
             // only return an error if shipping is required for this purchase
             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_shipping_destination", (cart != null ? cart.getLocale() : Locale.getDefault()));
@@ -166,8 +166,8 @@ public class CheckOutHelper {
                 carrierPartyId = shippingMethod.substring(delimiterPos + 1);
             }
 
-            this.cart.setShipmentMethodTypeId(shipmentMethodTypeId);
-            this.cart.setCarrierPartyId(carrierPartyId);
+            this.cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
+            this.cart.setAllCarrierPartyId(carrierPartyId);
         } else if (cart.shippingApplies()) {
             // only return an error if shipping is required for this purchase
             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_shipping_method", (cart != null ? cart.getLocale() : Locale.getDefault()));
@@ -175,20 +175,20 @@ public class CheckOutHelper {
         }
 
         // set the shipping instructions
-        this.cart.setShippingInstructions(shippingInstructions);
+        this.cart.setAllShippingInstructions(shippingInstructions);
 
         if (UtilValidate.isNotEmpty(maySplit)) {
-            cart.setMaySplit(Boolean.valueOf(maySplit));
+            cart.setAllMaySplit(Boolean.valueOf(maySplit));
         } else {
             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_splitting_preference", (cart != null ? cart.getLocale() : Locale.getDefault()));
             errorMessages.add(errMsg);
         }
 
         // set the gift message
-        this.cart.setGiftMessage(giftMessage);
+        this.cart.setAllGiftMessage(giftMessage);
 
         if (UtilValidate.isNotEmpty(isGift)) {
-            cart.setIsGift(Boolean.valueOf(isGift));
+            cart.setAllIsGift(Boolean.valueOf(isGift));
         } else {
             errMsg = UtilProperties.getMessage(resource_error, "checkhelper.specify_if_order_is_gift", (cart != null ? cart.getLocale() : Locale.getDefault()));
             errorMessages.add(errMsg);

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Thu Nov  8 15:16:32 2012
@@ -18,10 +18,39 @@
  *******************************************************************************/
 package org.ofbiz.order.shoppingcart;
 
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeMap;
+
 import javolution.util.FastList;
 import javolution.util.FastMap;
 
-import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.GeneralRuntimeException;
+import org.ofbiz.base.util.UtilDateTime;
+import org.ofbiz.base.util.UtilFormatOut;
+import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilNumber;
+import org.ofbiz.base.util.UtilProperties;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.DelegatorFactory;
 import org.ofbiz.entity.GenericEntityException;
@@ -46,13 +75,6 @@ import org.ofbiz.product.store.ProductSt
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
 
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.MathContext;
-import java.sql.Timestamp;
-import java.util.*;
-import java.util.Map.Entry;
-
 /**
  * Shopping Cart Object
  */
@@ -2217,11 +2239,19 @@ public class ShoppingCart implements Ite
         }
         csi.setContactMechId(shippingContactMechId);
     }
-
-    public void setShippingContactMechId(String shippingContactMechId) {
-        this.setShippingContactMechId(0, shippingContactMechId);
+    
+    /**
+     * Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param shippingContactMechId
+     */
+    public void setAllShippingContactMechId(String shippingContactMechId) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setShippingContactMechId(x, shippingContactMechId);
+        }
     }
-
+    
     /** Returns the shipping contact mech id. */
     public String getShippingContactMechId(int idx) {
         CartShipInfo csi = this.getShipInfo(idx);
@@ -2237,11 +2267,19 @@ public class ShoppingCart implements Ite
         CartShipInfo csi = this.getShipInfo(idx);
         csi.shipmentMethodTypeId = shipmentMethodTypeId;
     }
-
-    public void setShipmentMethodTypeId(String shipmentMethodTypeId) {
-        this.setShipmentMethodTypeId(0, shipmentMethodTypeId);
+    
+    /**
+     * Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param shipmentMethodTypeId
+     */
+    public void setAllShipmentMethodTypeId(String shipmentMethodTypeId) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setShipmentMethodTypeId(x, shipmentMethodTypeId);
+        }
     }
-
+    
     /** Returns the shipment method type ID */
     public String getShipmentMethodTypeId(int idx) {
         CartShipInfo csi = this.getShipInfo(idx);
@@ -2285,9 +2323,17 @@ public class ShoppingCart implements Ite
         CartShipInfo csi = this.getShipInfo(idx);
         csi.shippingInstructions = shippingInstructions;
     }
-
-    public void setShippingInstructions(String shippingInstructions) {
-        this.setShippingInstructions(0, shippingInstructions);
+    
+    /**
+     * Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param shippingInstructions
+     */
+    public void setAllShippingInstructions(String shippingInstructions) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setShippingInstructions(x, shippingInstructions);
+        }
     }
 
     /** Returns the shipping instructions. */
@@ -2306,10 +2352,19 @@ public class ShoppingCart implements Ite
             csi.setMaySplit(maySplit);
         }
     }
-
-    public void setMaySplit(Boolean maySplit) {
-        this.setMaySplit(0, maySplit);
+    
+    /**
+     * Sets @param maySplit in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param maySplit
+     */
+    public void setAllMaySplit(Boolean maySplit) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setMaySplit(x, maySplit);
+        }
     }
+    
 
     /** Returns Boolean.TRUE if the order may be split (null if unspecified) */
     public String getMaySplit(int idx) {
@@ -2326,10 +2381,18 @@ public class ShoppingCart implements Ite
         csi.giftMessage = giftMessage;
     }
 
-    public void setGiftMessage(String giftMessage) {
-        this.setGiftMessage(0, giftMessage);
+    /**
+     * Sets @param giftMessage in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param giftMessage
+     */
+    public void setAllGiftMessage(String giftMessage) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setGiftMessage(x, giftMessage);
+        }
     }
-
+    
     public String getGiftMessage(int idx) {
         CartShipInfo csi = this.getShipInfo(idx);
         return csi.giftMessage;
@@ -2346,10 +2409,18 @@ public class ShoppingCart implements Ite
         }
     }
 
-    public void setIsGift(Boolean isGift) {
-        this.setIsGift(0, isGift);
+    /**
+     * Sets @param isGift in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param isGift
+     */
+    public void setAllIsGift(Boolean isGift) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setIsGift(x, isGift);
+        }
     }
-
+    
     public String getIsGift(int idx) {
         CartShipInfo csi = this.getShipInfo(idx);
         return csi.isGift;
@@ -2363,11 +2434,19 @@ public class ShoppingCart implements Ite
         CartShipInfo csi = this.getShipInfo(idx);
         csi.carrierPartyId = carrierPartyId;
     }
-
-    public void setCarrierPartyId(String carrierPartyId) {
-        this.setCarrierPartyId(0, carrierPartyId);
+    
+    /**
+     * Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param carrierPartyId
+     */
+    public void setAllCarrierPartyId(String carrierPartyId) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setCarrierPartyId(x, carrierPartyId);
+        }
     }
-
+    
     public String getCarrierPartyId(int idx) {
         CartShipInfo csi = this.getShipInfo(idx);
         return csi.carrierPartyId;
@@ -2390,9 +2469,17 @@ public class ShoppingCart implements Ite
         CartShipInfo csi = this.getShipInfo(idx);
         csi.productStoreShipMethId = productStoreShipMethId;
     }
-
-    public void setProductStoreShipMethId(String productStoreShipMethId) {
-        this.setProductStoreShipMethId(0, productStoreShipMethId);
+    
+    /**
+     * Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated
+     * with this ShoppingCart
+     * <p>
+     * @param productStoreShipMethId
+     */
+    public void setAllProductStoreShipMethId(String productStoreShipMethId) {
+        for(int x=0; x < shipInfo.size(); x++) {
+            this.setProductStoreShipMethId(x, productStoreShipMethId);
+        }
     }
 
     public void setShipGroupFacilityId(int idx, String facilityId) {
@@ -2490,7 +2577,7 @@ public class ShoppingCart implements Ite
                     Collection<GenericValue> shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
                     if (UtilValidate.isNotEmpty(shippingContactMechList)) {
                         GenericValue shippingContactMech = (shippingContactMechList.iterator()).next();
-                        this.setShippingContactMechId(shippingContactMech.getString("contactMechId"));
+                        this.setAllShippingContactMechId(shippingContactMech.getString("contactMechId"));
                     }
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "Error setting shippingContactMechId in setDefaultCheckoutOptions() method.", module);
@@ -2500,8 +2587,8 @@ public class ShoppingCart implements Ite
             ShippingEstimateWrapper shipEstimateWrapper = org.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper.getWrapper(dispatcher, this, 0);
             GenericValue carrierShipmentMethod = EntityUtil.getFirst(shipEstimateWrapper.getShippingMethods());
             if (carrierShipmentMethod != null) {
-                this.setShipmentMethodTypeId(carrierShipmentMethod.getString("shipmentMethodTypeId"));
-                this.setCarrierPartyId(carrierShipmentMethod.getString("partyId"));
+                this.setAllShipmentMethodTypeId(carrierShipmentMethod.getString("shipmentMethodTypeId"));
+                this.setAllCarrierPartyId(carrierShipmentMethod.getString("partyId"));
             }
         } else {
             // checkout options for purchase orders
@@ -2521,12 +2608,12 @@ public class ShoppingCart implements Ite
                 }
             }
             // shipping options
-            this.setShipmentMethodTypeId(0, "NO_SHIPPING");
-            this.setCarrierPartyId(0, "_NA_");
-            this.setShippingInstructions(0, "");
-            this.setGiftMessage(0, "");
-            this.setMaySplit(0, Boolean.TRUE);
-            this.setIsGift(0, Boolean.FALSE);
+            this.setAllShipmentMethodTypeId("NO_SHIPPING");
+            this.setAllCarrierPartyId("_NA_");
+            this.setAllShippingInstructions("");
+            this.setAllGiftMessage("");
+            this.setAllMaySplit(Boolean.TRUE);
+            this.setAllIsGift(Boolean.FALSE);
             //this.setInternalCode(internalCode);
         }
     }

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Thu Nov  8 15:16:32 2012
@@ -20,9 +20,9 @@ package org.ofbiz.order.shoppinglist;
 
 import java.math.BigDecimal;
 import java.sql.Timestamp;
+import java.util.Date;
 import java.util.List;
 import java.util.Locale;
-import java.util.Date;
 import java.util.Map;
 
 import javolution.util.FastMap;
@@ -515,13 +515,13 @@ public class ShoppingListServices {
                         listCart.addPayment(shoppingList.getString("paymentMethodId"));
                     }
                     if (UtilValidate.isNotEmpty(shoppingList.get("contactMechId"))) {
-                        listCart.setShippingContactMechId(0, shoppingList.getString("contactMechId"));
+                        listCart.setAllShippingContactMechId(shoppingList.getString("contactMechId"));
                     }
                     if (UtilValidate.isNotEmpty(shoppingList.get("shipmentMethodTypeId"))) {
-                        listCart.setShipmentMethodTypeId(0, shoppingList.getString("shipmentMethodTypeId"));
+                        listCart.setAllShipmentMethodTypeId(shoppingList.getString("shipmentMethodTypeId"));
                     }
                     if (UtilValidate.isNotEmpty(shoppingList.get("carrierPartyId"))) {
-                        listCart.setCarrierPartyId(0, shoppingList.getString("carrierPartyId"));
+                        listCart.setAllCarrierPartyId(shoppingList.getString("carrierPartyId"));
                     }
                     if (UtilValidate.isNotEmpty(shoppingList.getString("productPromoCodeId"))) {
                         listCart.addProductPromoCode(shoppingList.getString("productPromoCodeId"), dispatcher);

Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java Thu Nov  8 15:16:32 2012
@@ -187,8 +187,8 @@ public class EbayHelper {
         } catch (GenericEntityException e) {
             Debug.logInfo("Unable to find EbayShippingMethod", module);
         }
-        cart.setCarrierPartyId(partyId);
-        cart.setShipmentMethodTypeId(shipmentMethodTypeId);
+        cart.setAllCarrierPartyId(partyId);
+        cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
     }
 
     public static boolean createPaymentFromPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin,

Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java Thu Nov  8 15:16:32 2012
@@ -1201,8 +1201,8 @@ public class EbayOrderServices {
                 cart.setEndUserCustomerPartyId(partyId);
 
                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
-                cart.setShippingContactMechId(contactMechId);
-                cart.setMaySplit(Boolean.FALSE);
+                cart.setAllShippingContactMechId(contactMechId);
+                cart.setAllMaySplit(Boolean.FALSE);
 
                 Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module);
                 EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator);

Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Thu Nov  8 15:16:32 2012
@@ -781,8 +781,8 @@ public class ImportOrdersFromEbay {
                 cart.setEndUserCustomerPartyId(partyId);
 
                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
-                cart.setShippingContactMechId(contactMechId);
-                cart.setMaySplit(Boolean.FALSE);
+                cart.setAllShippingContactMechId(contactMechId);
+                cart.setAllMaySplit(Boolean.FALSE);
 
                 Debug.logInfo("Setting shipment method: " + (String) parameters.get("shippingService"), module);
                 EbayHelper.setShipmentMethodType(cart, (String) parameters.get("shippingService"), productStoreId, delegator);

Modified: ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java Thu Nov  8 15:16:32 2012
@@ -265,8 +265,8 @@ public class EbayStoreOrder {
                 cart.setEndUserCustomerPartyId(partyId);
 
                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
-                cart.setShippingContactMechId(contactMechId);
-                cart.setMaySplit(Boolean.FALSE);
+                cart.setAllShippingContactMechId(contactMechId);
+                cart.setAllMaySplit(Boolean.FALSE);
 
                 Debug.logInfo("Setting shipment method: " + context.get("shippingService").toString(), module);
                 EbayHelper.setShipmentMethodType(cart, context.get("shippingService").toString(), productStoreId, delegator);
@@ -499,8 +499,8 @@ public class EbayStoreOrder {
             cart.setEndUserCustomerPartyId(partyId);
 
             Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
-            cart.setShippingContactMechId(contactMechId);
-            cart.setMaySplit(Boolean.FALSE);
+            cart.setAllShippingContactMechId(contactMechId);
+            cart.setAllMaySplit(Boolean.FALSE);
 
             Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module);
             EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator);

Modified: ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java Thu Nov  8 15:16:32 2012
@@ -279,7 +279,7 @@ public class GoogleCheckoutHelper {
 
         cart.setOrderPartyId(partyInfo[0]);
         cart.setPlacingCustomerPartyId(partyInfo[0]);
-        cart.setShippingContactMechId(partyInfo[1]);
+        cart.setAllShippingContactMechId(partyInfo[1]);
 
         // contact info
         String shippingEmail = shippingAddress.getEmail();
@@ -418,10 +418,10 @@ public class GoogleCheckoutHelper {
             String carrierPartyId = googleShipping.getString("carrierPartyId");
             Boolean maySplit = Boolean.FALSE;
 
-            cart.setShipmentMethodTypeId(shipmentMethodTypeId);
-            cart.setCarrierPartyId(carrierPartyId);
-            cart.setMaySplit(maySplit);
-            cart.setShippingContactMechId(shipContactMechId);
+            cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
+            cart.setAllCarrierPartyId(carrierPartyId);
+            cart.setAllMaySplit(maySplit);
+            cart.setAllShippingContactMechId(shipContactMechId);
         } else {
             Debug.logWarning("No valid fulfillment method found! No shipping info set!", module);
         }

Modified: ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=1407117&r1=1407116&r2=1407117&view=diff
==============================================================================
--- ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original)
+++ ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Thu Nov  8 15:16:32 2012
@@ -819,8 +819,8 @@ public class PosTransaction implements S
         // attach the party ID to the cart
         cart.setOrderPartyId(partyId);
         // Set the shipping type
-        cart.setShipmentMethodTypeId("NO_SHIPPING");
-       // cart.setCarrierPartyId();
+        cart.setAllShipmentMethodTypeId("NO_SHIPPING");
+       // cart.setAllCarrierPartyId();
 
         // validate payment methods
         output.print(UtilProperties.getMessage(resource, "PosValidating", locale));



Re: svn commit: r1407117 - in /ofbiz/branches/release12.04: ./ applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/ applications/order/src/org/ofbiz/order/order/ applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/src/org

Posted by Jacques Le Roux <ja...@les7arts.com>.
I'm currently looking in issues with tests...

Jacques

> Author: jleroux
> Date: Thu Nov  8 15:16:32 2012
> New Revision: 1407117
> 
> URL: http://svn.apache.org/viewvc?rev=1407117&view=rev
> Log:
> "Applied fix from trunk for revision: 1407116  " 
> ------------------------------------------------------------------------
> r1407116 | jleroux | 2012-11-08 16:15:04 +0100 (jeu., 08 nov. 2012) | 21 lines
> 
> An enhanced patch from John McDonald for "Customer's Shipment Address Not Assigned to Dropship Purchase Orders" https://issues.apache.org/jira/browse/OFBIZ-3883
> 
> When buying drop ship products from the demo store the customer's shipping address is not saved with the purchase order, so the shipping address cannot be provided to the drop ship supplier. 
> 
> Steps to Reproduce:
> * From the DropShip Category add "DropShip from BigSupplier" and "DropShip from DemoSupplier" to your cart. 
> * Login as admin
> * Use the one page checkout to order the products
> 
> Resulting Order: 
> https://demo-trunk.ofbiz.apache.org:8443/ordermgr/control/orderview?orderId=WSCO10002
> The purchase orders WS10003 and WS10004 are associated correctly with the order items, but as the shipping groups don't have addresses, the purchase orders don't have either.
> 
> Expectation:
> All Shipment groups should have the shipping address assigned.
> 
> Actual:
> Only the first shipment group has the shipping address assigned. 
> 
> 
> jleroux: thanks to Paul Foxworthy's help I rather removed than deprecate the old methods and replaced them where relevant
> ------------------------------------------------------------------------
> 
> 
> Modified:
>    ofbiz/branches/release12.04/   (props changed)
>    ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
>    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
>    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
>    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
>    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
>    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
>    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
>    ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
>    ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java
>    ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
>    ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
> 
> Propchange: ofbiz/branches/release12.04/
> ------------------------------------------------------------------------------
>  Merged /ofbiz/trunk:r1407116
> 
> Modified: ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java (original)
> +++ ofbiz/branches/release12.04/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java Thu Nov  8 15:16:32 2012
> @@ -246,8 +246,8 @@ public class PayPalServices {
>             if (estimate == null || estimate.compareTo(BigDecimal.ZERO) < 0) {
>                 continue;
>             }
> -            cart.setShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
> -            cart.setCarrierPartyId(shipMethod.getString("partyId"));
> +            cart.setAllShipmentMethodTypeId(shipMethod.getString("shipmentMethodTypeId"));
> +            cart.setAllCarrierPartyId(shipMethod.getString("partyId"));
>             try {
>                 coh.calcAndAddTax();
>             } catch (GeneralException e) {
> @@ -594,18 +594,18 @@ public class PayPalServices {
>         // that was shown to the customer
>         String shipMethod = decoder.get("SHIPPINGOPTIONNAME");
>         if ("Calculated Offline".equals(shipMethod)) {
> -            cart.setCarrierPartyId("_NA_");
> -            cart.setShipmentMethodTypeId("NO_SHIPPING");
> +            cart.setAllCarrierPartyId("_NA_");
> +            cart.setAllShipmentMethodTypeId("NO_SHIPPING");
>         } else {
>             String[] shipMethodSplit = shipMethod.split(" - ");
> -            cart.setCarrierPartyId(shipMethodSplit[0]);
> +            cart.setAllCarrierPartyId(shipMethodSplit[0]);
>             String shippingMethodTypeDesc = StringUtils.join(shipMethodSplit, " - ", 1, shipMethodSplit.length);
>             try {
>                 EntityCondition cond = EntityCondition.makeCondition(
>                         UtilMisc.toMap("productStoreId", cart.getProductStoreId(), "partyId", shipMethodSplit[0], "roleTypeId", "CARRIER", "description", shippingMethodTypeDesc)
>                );
>                 GenericValue shipmentMethod = EntityUtil.getFirst(delegator.findList("ProductStoreShipmentMethView", cond, null, null, null, false));
> -                cart.setShipmentMethodTypeId(shipmentMethod.getString("shipmentMethodTypeId"));
> +                cart.setAllShipmentMethodTypeId(shipmentMethod.getString("shipmentMethodTypeId"));
>             } catch (GenericEntityException e1) {
>                 Debug.logError(e1, module);
>             }
> @@ -619,7 +619,7 @@ public class PayPalServices {
>             }
>         }
>         cart.cleanUpShipGroups();
> -        cart.setShippingContactMechId(postalContactId);
> +        cart.setAllShippingContactMechId(postalContactId);
>         Map<String, Object> result = ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0);
>         if (result.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) {
>             return ServiceUtil.returnError((String) result.get(ModelService.ERROR_MESSAGE));
> 
> Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
> +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Nov  8 15:16:32 2012
> @@ -4864,7 +4864,7 @@ public class OrderServices {
>                             // set checkout options
>                             cart.setDefaultCheckoutOptions(dispatcher);
>                             // the shipping address is the one of the customer
> -                            cart.setShippingContactMechId(shipGroup.getString("contactMechId"));
> +                            cart.setAllShippingContactMechId(shipGroup.getString("contactMechId"));
>                             // associate ship groups of sales and purchase orders
>                             ShoppingCart.CartShipInfo cartShipInfo = cart.getShipGroups().get(0);
>                             cartShipInfo.setAssociatedShipGroupSeqId(shipGroup.getString("shipGroupSeqId"));
> 
> Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
> +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Thu Nov  8 15:16:32 2012
> @@ -234,8 +234,8 @@ public class CheckOutEvents {
> 
>         // if no shipping applies, set the no shipment method and skip to payment
>         if (!cart.shippingApplies()) {
> -            cart.setShipmentMethodTypeId("NO_SHIPPING");
> -            cart.setCarrierPartyId("_NA_");
> +            cart.setAllShipmentMethodTypeId("NO_SHIPPING");
> +            cart.setAllCarrierPartyId("_NA_");
>             page = "payment";
>         }
> 
> @@ -273,7 +273,7 @@ public class CheckOutEvents {
>         ShoppingCart cart = (ShoppingCart) request.getSession().getAttribute("shoppingCart");
>         String shipToCustomerPartyId = request.getParameter("shipToCustomerPartyId");
>         cart.setShipToCustomerPartyId(shipToCustomerPartyId);
> -        cart.setShippingContactMechId(null);
> +        cart.setAllShippingContactMechId(null);
>         return "success";
>     }
> 
> 
> Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
> +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Thu Nov  8 15:16:32 2012
> @@ -115,7 +115,7 @@ public class CheckOutHelper {
> 
>         // set the shipping address
>         if (UtilValidate.isNotEmpty(shippingContactMechId)) {
> -            this.cart.setShippingContactMechId(shippingContactMechId);
> +            this.cart.setAllShippingContactMechId(shippingContactMechId);
>         } else if (cart.shippingApplies()) {
>             // only return an error if shipping is required for this purchase
>             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_shipping_destination", (cart != null ? cart.getLocale() : Locale.getDefault()));
> @@ -166,8 +166,8 @@ public class CheckOutHelper {
>                 carrierPartyId = shippingMethod.substring(delimiterPos + 1);
>             }
> 
> -            this.cart.setShipmentMethodTypeId(shipmentMethodTypeId);
> -            this.cart.setCarrierPartyId(carrierPartyId);
> +            this.cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
> +            this.cart.setAllCarrierPartyId(carrierPartyId);
>         } else if (cart.shippingApplies()) {
>             // only return an error if shipping is required for this purchase
>             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_shipping_method", (cart != null ? cart.getLocale() : Locale.getDefault()));
> @@ -175,20 +175,20 @@ public class CheckOutHelper {
>         }
> 
>         // set the shipping instructions
> -        this.cart.setShippingInstructions(shippingInstructions);
> +        this.cart.setAllShippingInstructions(shippingInstructions);
> 
>         if (UtilValidate.isNotEmpty(maySplit)) {
> -            cart.setMaySplit(Boolean.valueOf(maySplit));
> +            cart.setAllMaySplit(Boolean.valueOf(maySplit));
>         } else {
>             errMsg = UtilProperties.getMessage(resource_error,"checkhelper.select_splitting_preference", (cart != null ? cart.getLocale() : Locale.getDefault()));
>             errorMessages.add(errMsg);
>         }
> 
>         // set the gift message
> -        this.cart.setGiftMessage(giftMessage);
> +        this.cart.setAllGiftMessage(giftMessage);
> 
>         if (UtilValidate.isNotEmpty(isGift)) {
> -            cart.setIsGift(Boolean.valueOf(isGift));
> +            cart.setAllIsGift(Boolean.valueOf(isGift));
>         } else {
>             errMsg = UtilProperties.getMessage(resource_error, "checkhelper.specify_if_order_is_gift", (cart != null ? cart.getLocale() : Locale.getDefault()));
>             errorMessages.add(errMsg);
> 
> Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
> +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Thu Nov  8 15:16:32 2012
> @@ -18,10 +18,39 @@
>  *******************************************************************************/
> package org.ofbiz.order.shoppingcart;
> 
> +import java.io.Serializable;
> +import java.math.BigDecimal;
> +import java.math.MathContext;
> +import java.sql.Timestamp;
> +import java.util.ArrayList;
> +import java.util.Collection;
> +import java.util.Collections;
> +import java.util.Comparator;
> +import java.util.HashMap;
> +import java.util.HashSet;
> +import java.util.Iterator;
> +import java.util.LinkedHashMap;
> +import java.util.LinkedList;
> +import java.util.List;
> +import java.util.Locale;
> +import java.util.Map;
> +import java.util.Map.Entry;
> +import java.util.Set;
> +import java.util.TreeMap;
> +
> import javolution.util.FastList;
> import javolution.util.FastMap;
> 
> -import org.ofbiz.base.util.*;
> +import org.ofbiz.base.util.Debug;
> +import org.ofbiz.base.util.GeneralException;
> +import org.ofbiz.base.util.GeneralRuntimeException;
> +import org.ofbiz.base.util.UtilDateTime;
> +import org.ofbiz.base.util.UtilFormatOut;
> +import org.ofbiz.base.util.UtilGenerics;
> +import org.ofbiz.base.util.UtilMisc;
> +import org.ofbiz.base.util.UtilNumber;
> +import org.ofbiz.base.util.UtilProperties;
> +import org.ofbiz.base.util.UtilValidate;
> import org.ofbiz.entity.Delegator;
> import org.ofbiz.entity.DelegatorFactory;
> import org.ofbiz.entity.GenericEntityException;
> @@ -46,13 +75,6 @@ import org.ofbiz.product.store.ProductSt
> import org.ofbiz.service.LocalDispatcher;
> import org.ofbiz.service.ServiceUtil;
> 
> -import java.io.Serializable;
> -import java.math.BigDecimal;
> -import java.math.MathContext;
> -import java.sql.Timestamp;
> -import java.util.*;
> -import java.util.Map.Entry;
> -
> /**
>  * Shopping Cart Object
>  */
> @@ -2217,11 +2239,19 @@ public class ShoppingCart implements Ite
>         }
>         csi.setContactMechId(shippingContactMechId);
>     }
> -
> -    public void setShippingContactMechId(String shippingContactMechId) {
> -        this.setShippingContactMechId(0, shippingContactMechId);
> +    
> +    /**
> +     * Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param shippingContactMechId
> +     */
> +    public void setAllShippingContactMechId(String shippingContactMechId) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setShippingContactMechId(x, shippingContactMechId);
> +        }
>     }
> -
> +    
>     /** Returns the shipping contact mech id. */
>     public String getShippingContactMechId(int idx) {
>         CartShipInfo csi = this.getShipInfo(idx);
> @@ -2237,11 +2267,19 @@ public class ShoppingCart implements Ite
>         CartShipInfo csi = this.getShipInfo(idx);
>         csi.shipmentMethodTypeId = shipmentMethodTypeId;
>     }
> -
> -    public void setShipmentMethodTypeId(String shipmentMethodTypeId) {
> -        this.setShipmentMethodTypeId(0, shipmentMethodTypeId);
> +    
> +    /**
> +     * Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param shipmentMethodTypeId
> +     */
> +    public void setAllShipmentMethodTypeId(String shipmentMethodTypeId) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setShipmentMethodTypeId(x, shipmentMethodTypeId);
> +        }
>     }
> -
> +    
>     /** Returns the shipment method type ID */
>     public String getShipmentMethodTypeId(int idx) {
>         CartShipInfo csi = this.getShipInfo(idx);
> @@ -2285,9 +2323,17 @@ public class ShoppingCart implements Ite
>         CartShipInfo csi = this.getShipInfo(idx);
>         csi.shippingInstructions = shippingInstructions;
>     }
> -
> -    public void setShippingInstructions(String shippingInstructions) {
> -        this.setShippingInstructions(0, shippingInstructions);
> +    
> +    /**
> +     * Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param shippingInstructions
> +     */
> +    public void setAllShippingInstructions(String shippingInstructions) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setShippingInstructions(x, shippingInstructions);
> +        }
>     }
> 
>     /** Returns the shipping instructions. */
> @@ -2306,10 +2352,19 @@ public class ShoppingCart implements Ite
>             csi.setMaySplit(maySplit);
>         }
>     }
> -
> -    public void setMaySplit(Boolean maySplit) {
> -        this.setMaySplit(0, maySplit);
> +    
> +    /**
> +     * Sets @param maySplit in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param maySplit
> +     */
> +    public void setAllMaySplit(Boolean maySplit) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setMaySplit(x, maySplit);
> +        }
>     }
> +    
> 
>     /** Returns Boolean.TRUE if the order may be split (null if unspecified) */
>     public String getMaySplit(int idx) {
> @@ -2326,10 +2381,18 @@ public class ShoppingCart implements Ite
>         csi.giftMessage = giftMessage;
>     }
> 
> -    public void setGiftMessage(String giftMessage) {
> -        this.setGiftMessage(0, giftMessage);
> +    /**
> +     * Sets @param giftMessage in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param giftMessage
> +     */
> +    public void setAllGiftMessage(String giftMessage) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setGiftMessage(x, giftMessage);
> +        }
>     }
> -
> +    
>     public String getGiftMessage(int idx) {
>         CartShipInfo csi = this.getShipInfo(idx);
>         return csi.giftMessage;
> @@ -2346,10 +2409,18 @@ public class ShoppingCart implements Ite
>         }
>     }
> 
> -    public void setIsGift(Boolean isGift) {
> -        this.setIsGift(0, isGift);
> +    /**
> +     * Sets @param isGift in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param isGift
> +     */
> +    public void setAllIsGift(Boolean isGift) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setIsGift(x, isGift);
> +        }
>     }
> -
> +    
>     public String getIsGift(int idx) {
>         CartShipInfo csi = this.getShipInfo(idx);
>         return csi.isGift;
> @@ -2363,11 +2434,19 @@ public class ShoppingCart implements Ite
>         CartShipInfo csi = this.getShipInfo(idx);
>         csi.carrierPartyId = carrierPartyId;
>     }
> -
> -    public void setCarrierPartyId(String carrierPartyId) {
> -        this.setCarrierPartyId(0, carrierPartyId);
> +    
> +    /**
> +     * Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param carrierPartyId
> +     */
> +    public void setAllCarrierPartyId(String carrierPartyId) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setCarrierPartyId(x, carrierPartyId);
> +        }
>     }
> -
> +    
>     public String getCarrierPartyId(int idx) {
>         CartShipInfo csi = this.getShipInfo(idx);
>         return csi.carrierPartyId;
> @@ -2390,9 +2469,17 @@ public class ShoppingCart implements Ite
>         CartShipInfo csi = this.getShipInfo(idx);
>         csi.productStoreShipMethId = productStoreShipMethId;
>     }
> -
> -    public void setProductStoreShipMethId(String productStoreShipMethId) {
> -        this.setProductStoreShipMethId(0, productStoreShipMethId);
> +    
> +    /**
> +     * Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated
> +     * with this ShoppingCart
> +     * <p>
> +     * @param productStoreShipMethId
> +     */
> +    public void setAllProductStoreShipMethId(String productStoreShipMethId) {
> +        for(int x=0; x < shipInfo.size(); x++) {
> +            this.setProductStoreShipMethId(x, productStoreShipMethId);
> +        }
>     }
> 
>     public void setShipGroupFacilityId(int idx, String facilityId) {
> @@ -2490,7 +2577,7 @@ public class ShoppingCart implements Ite
>                     Collection<GenericValue> shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
>                     if (UtilValidate.isNotEmpty(shippingContactMechList)) {
>                         GenericValue shippingContactMech = (shippingContactMechList.iterator()).next();
> -                        this.setShippingContactMechId(shippingContactMech.getString("contactMechId"));
> +                        this.setAllShippingContactMechId(shippingContactMech.getString("contactMechId"));
>                     }
>                 } catch (GenericEntityException e) {
>                     Debug.logError(e, "Error setting shippingContactMechId in setDefaultCheckoutOptions() method.", module);
> @@ -2500,8 +2587,8 @@ public class ShoppingCart implements Ite
>             ShippingEstimateWrapper shipEstimateWrapper = org.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper.getWrapper(dispatcher, this, 0);
>             GenericValue carrierShipmentMethod = EntityUtil.getFirst(shipEstimateWrapper.getShippingMethods());
>             if (carrierShipmentMethod != null) {
> -                this.setShipmentMethodTypeId(carrierShipmentMethod.getString("shipmentMethodTypeId"));
> -                this.setCarrierPartyId(carrierShipmentMethod.getString("partyId"));
> +                this.setAllShipmentMethodTypeId(carrierShipmentMethod.getString("shipmentMethodTypeId"));
> +                this.setAllCarrierPartyId(carrierShipmentMethod.getString("partyId"));
>             }
>         } else {
>             // checkout options for purchase orders
> @@ -2521,12 +2608,12 @@ public class ShoppingCart implements Ite
>                 }
>             }
>             // shipping options
> -            this.setShipmentMethodTypeId(0, "NO_SHIPPING");
> -            this.setCarrierPartyId(0, "_NA_");
> -            this.setShippingInstructions(0, "");
> -            this.setGiftMessage(0, "");
> -            this.setMaySplit(0, Boolean.TRUE);
> -            this.setIsGift(0, Boolean.FALSE);
> +            this.setAllShipmentMethodTypeId("NO_SHIPPING");
> +            this.setAllCarrierPartyId("_NA_");
> +            this.setAllShippingInstructions("");
> +            this.setAllGiftMessage("");
> +            this.setAllMaySplit(Boolean.TRUE);
> +            this.setAllIsGift(Boolean.FALSE);
>             //this.setInternalCode(internalCode);
>         }
>     }
> 
> Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
> +++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Thu Nov  8 15:16:32 2012
> @@ -20,9 +20,9 @@ package org.ofbiz.order.shoppinglist;
> 
> import java.math.BigDecimal;
> import java.sql.Timestamp;
> +import java.util.Date;
> import java.util.List;
> import java.util.Locale;
> -import java.util.Date;
> import java.util.Map;
> 
> import javolution.util.FastMap;
> @@ -515,13 +515,13 @@ public class ShoppingListServices {
>                         listCart.addPayment(shoppingList.getString("paymentMethodId"));
>                     }
>                     if (UtilValidate.isNotEmpty(shoppingList.get("contactMechId"))) {
> -                        listCart.setShippingContactMechId(0, shoppingList.getString("contactMechId"));
> +                        listCart.setAllShippingContactMechId(shoppingList.getString("contactMechId"));
>                     }
>                     if (UtilValidate.isNotEmpty(shoppingList.get("shipmentMethodTypeId"))) {
> -                        listCart.setShipmentMethodTypeId(0, shoppingList.getString("shipmentMethodTypeId"));
> +                        listCart.setAllShipmentMethodTypeId(shoppingList.getString("shipmentMethodTypeId"));
>                     }
>                     if (UtilValidate.isNotEmpty(shoppingList.get("carrierPartyId"))) {
> -                        listCart.setCarrierPartyId(0, shoppingList.getString("carrierPartyId"));
> +                        listCart.setAllCarrierPartyId(shoppingList.getString("carrierPartyId"));
>                     }
>                     if (UtilValidate.isNotEmpty(shoppingList.getString("productPromoCodeId"))) {
>                         listCart.addProductPromoCode(shoppingList.getString("productPromoCodeId"), dispatcher);
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java Thu Nov  8 15:16:32 2012
> @@ -187,8 +187,8 @@ public class EbayHelper {
>         } catch (GenericEntityException e) {
>             Debug.logInfo("Unable to find EbayShippingMethod", module);
>         }
> -        cart.setCarrierPartyId(partyId);
> -        cart.setShipmentMethodTypeId(shipmentMethodTypeId);
> +        cart.setAllCarrierPartyId(partyId);
> +        cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
>     }
> 
>     public static boolean createPaymentFromPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin,
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java Thu Nov  8 15:16:32 2012
> @@ -1201,8 +1201,8 @@ public class EbayOrderServices {
>                 cart.setEndUserCustomerPartyId(partyId);
> 
>                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
> -                cart.setShippingContactMechId(contactMechId);
> -                cart.setMaySplit(Boolean.FALSE);
> +                cart.setAllShippingContactMechId(contactMechId);
> +                cart.setAllMaySplit(Boolean.FALSE);
> 
>                 Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module);
>                 EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator);
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/ebay/src/org/ofbiz/ebay/ImportOrdersFromEbay.java Thu Nov  8 15:16:32 2012
> @@ -781,8 +781,8 @@ public class ImportOrdersFromEbay {
>                 cart.setEndUserCustomerPartyId(partyId);
> 
>                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
> -                cart.setShippingContactMechId(contactMechId);
> -                cart.setMaySplit(Boolean.FALSE);
> +                cart.setAllShippingContactMechId(contactMechId);
> +                cart.setAllMaySplit(Boolean.FALSE);
> 
>                 Debug.logInfo("Setting shipment method: " + (String) parameters.get("shippingService"), module);
>                 EbayHelper.setShipmentMethodType(cart, (String) parameters.get("shippingService"), productStoreId, delegator);
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/ebaystore/src/org/ofbiz/ebaystore/EbayStoreOrder.java Thu Nov  8 15:16:32 2012
> @@ -265,8 +265,8 @@ public class EbayStoreOrder {
>                 cart.setEndUserCustomerPartyId(partyId);
> 
>                 Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
> -                cart.setShippingContactMechId(contactMechId);
> -                cart.setMaySplit(Boolean.FALSE);
> +                cart.setAllShippingContactMechId(contactMechId);
> +                cart.setAllMaySplit(Boolean.FALSE);
> 
>                 Debug.logInfo("Setting shipment method: " + context.get("shippingService").toString(), module);
>                 EbayHelper.setShipmentMethodType(cart, context.get("shippingService").toString(), productStoreId, delegator);
> @@ -499,8 +499,8 @@ public class EbayStoreOrder {
>             cart.setEndUserCustomerPartyId(partyId);
> 
>             Debug.logInfo("Setting contact mech in cart: " + contactMechId, module);
> -            cart.setShippingContactMechId(contactMechId);
> -            cart.setMaySplit(Boolean.FALSE);
> +            cart.setAllShippingContactMechId(contactMechId);
> +            cart.setAllMaySplit(Boolean.FALSE);
> 
>             Debug.logInfo("Setting shipment method: " + (String) shippingServiceSelectedCtx.get("shippingService"), module);
>             EbayHelper.setShipmentMethodType(cart, (String) shippingServiceSelectedCtx.get("shippingService"), productStoreId, delegator);
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/googlecheckout/src/org/ofbiz/googlecheckout/GoogleCheckoutHelper.java Thu Nov  8 15:16:32 2012
> @@ -279,7 +279,7 @@ public class GoogleCheckoutHelper {
> 
>         cart.setOrderPartyId(partyInfo[0]);
>         cart.setPlacingCustomerPartyId(partyInfo[0]);
> -        cart.setShippingContactMechId(partyInfo[1]);
> +        cart.setAllShippingContactMechId(partyInfo[1]);
> 
>         // contact info
>         String shippingEmail = shippingAddress.getEmail();
> @@ -418,10 +418,10 @@ public class GoogleCheckoutHelper {
>             String carrierPartyId = googleShipping.getString("carrierPartyId");
>             Boolean maySplit = Boolean.FALSE;
> 
> -            cart.setShipmentMethodTypeId(shipmentMethodTypeId);
> -            cart.setCarrierPartyId(carrierPartyId);
> -            cart.setMaySplit(maySplit);
> -            cart.setShippingContactMechId(shipContactMechId);
> +            cart.setAllShipmentMethodTypeId(shipmentMethodTypeId);
> +            cart.setAllCarrierPartyId(carrierPartyId);
> +            cart.setAllMaySplit(maySplit);
> +            cart.setAllShippingContactMechId(shipContactMechId);
>         } else {
>             Debug.logWarning("No valid fulfillment method found! No shipping info set!", module);
>         }
> 
> Modified: ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
> URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=1407117&r1=1407116&r2=1407117&view=diff
> ==============================================================================
> --- ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original)
> +++ ofbiz/branches/release12.04/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Thu Nov  8 15:16:32 2012
> @@ -819,8 +819,8 @@ public class PosTransaction implements S
>         // attach the party ID to the cart
>         cart.setOrderPartyId(partyId);
>         // Set the shipping type
> -        cart.setShipmentMethodTypeId("NO_SHIPPING");
> -       // cart.setCarrierPartyId();
> +        cart.setAllShipmentMethodTypeId("NO_SHIPPING");
> +       // cart.setAllCarrierPartyId();
> 
>         // validate payment methods
>         output.print(UtilProperties.getMessage(resource, "PosValidating", locale));
> 
>