svn commit: r727640 - in /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart: ShoppingCart.java 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: r727640 - in /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart: ShoppingCart.java ShoppingCartServices.java

jleroux@apache.org
Author: jleroux
Date: Wed Dec 17 20:55:12 2008
New Revision: 727640

URL: http://svn.apache.org/viewvc?rev=727640&view=rev
Log:
Patches from Stephen Rufle "ShoppingCartServices.loadCartFromOrder" (https://issues.apache.org/jira/browse/OFBIZ-2089) - OFBIZ-2089 and (https://issues.apache.org/jira/browse/OFBIZ-2090) - OFBIZ-2090

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

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=727640&r1=727639&r2=727640&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Wed Dec 17 20:55:12 2008
@@ -2328,6 +2328,26 @@
         return csi.facilityId;
     }
 
+    public void setShipGroupVendorPartyId(int idx, String vendorPartyId) {
+        CartShipInfo csi = this.getShipInfo(idx);
+        csi.vendorPartyId = vendorPartyId;
+    }
+
+    public String getShipGroupVendorPartyId(int idx) {
+        CartShipInfo csi = this.getShipInfo(idx);
+        return csi.vendorPartyId;
+    }
+
+    public void setShipGroupSeqId(int idx, String shipGroupSeqId) {
+        CartShipInfo csi = this.getShipInfo(idx);
+        csi.shipGroupSeqId = shipGroupSeqId;
+    }
+    
+    public String getShipGroupSeqId(int idx) {
+        CartShipInfo csi = this.getShipInfo(idx);
+        return csi.shipGroupSeqId;
+    }
+
     public void setOrderAdditionalEmails(String orderAdditionalEmails) {
         this.orderAdditionalEmails = orderAdditionalEmails;
     }

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=727640&r1=727639&r2=727640&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 Wed Dec 17 20:55:12 2008
@@ -434,6 +434,22 @@
                     return ServiceUtil.returnError(e.getMessage());
                 }
 
+                // load order item contact mechs
+                List<GenericValue> orderItemContactMechList = null;
+                try {
+                    orderItemContactMechList = delegator.findByAnd("OrderItemContactMech", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
+                    if (UtilValidate.isNotEmpty(orderAttributesList)) {
+                        for (GenericValue orderItemAttr : orderItemContactMechList) {
+                            String contactMechPurposeTypeId = orderItemAttr.getString("contactMechPurposeTypeId");
+                            String contactMechId = orderItemAttr.getString("contactMechId");
+                            cartItem.addContactMech(contactMechPurposeTypeId, contactMechId);
+                        }
+                    }
+                } catch (GenericEntityException e) {
+                    Debug.logError(e, module);
+                    return ServiceUtil.returnError(e.getMessage());
+                }
+
                 // set the PO number on the cart
                 cart.setPoNumber(item.getString("correspondingPoId"));
 
@@ -462,6 +478,9 @@
                     cart.setGiftMessage(g, sg.getString("giftMessage"));
                     cart.setShippingContactMechId(g, sg.getString("contactMechId"));
                     cart.setShippingInstructions(g, sg.getString("shippingInstructions"));
+                    cart.setShipGroupFacilityId(g, sg.getString("facilityId"));
+                    cart.setShipGroupVendorPartyId(g, sg.getString("vendorPartyId"));
+                    cart.setShipGroupSeqId(g, sg.getString("shipGroupSeqId"));
                     cart.setItemShipGroupQty(itemIndex, shipGroupQty.doubleValue(), g);
                 }
             }