You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/04/04 17:19:46 UTC

svn commit: r525534 - in /ofbiz/trunk/applications/order: entitydef/entitymodel.xml src/org/ofbiz/order/shoppinglist/ShoppingListServices.java

Author: jonesde
Date: Wed Apr  4 08:19:45 2007
New Revision: 525534

URL: http://svn.apache.org/viewvc?view=rev&rev=525534
Log:
Added productPromoCodeId to ShoppingList, and change order from list service code to add it to the cart when a shopping list order is placed

Modified:
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?view=diff&rev=525534&r1=525533&r2=525534
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Wed Apr  4 08:19:45 2007
@@ -2496,6 +2496,7 @@
       <field name="recurrenceInfoId" type="id"></field>
       <field name="lastOrderedDate" type="date-time"></field>
       <field name="lastAdminModified" type="date-time"></field>
+      <field name="productPromoCodeId" type="id"></field>
       <prim-key field="shoppingListId"/>
       <relation type="one" fk-name="SHLIST_PARENT" title="Parent" rel-entity-name="ShoppingList">
         <key-map field-name="parentShoppingListId" rel-field-name="shoppingListId"/>
@@ -2538,6 +2539,9 @@
       <relation type="one" fk-name="SHLIST_RECINFO" rel-entity-name="RecurrenceInfo">
         <key-map field-name="recurrenceInfoId"/>
       </relation>
+        <relation type="one" fk-name="SHLIST_PRMCD" rel-entity-name="ProductPromoCode">
+            <key-map field-name="productPromoCodeId"/>
+        </relation>
     </entity>
     <entity entity-name="ShoppingListItem"
             package-name="org.ofbiz.order.shoppinglist"

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?view=diff&rev=525534&r1=525533&r2=525534
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Wed Apr  4 08:19:45 2007
@@ -452,17 +452,20 @@
                 }
 
                 if (listCart.size() > 0) {
-                    if (shoppingList.get("paymentMethodId") != null) {
+                    if (UtilValidate.isNotEmpty(shoppingList.get("paymentMethodId"))) {
                         listCart.addPayment(shoppingList.getString("paymentMethodId"));
                     }
-                    if (shoppingList.get("contactMechId") != null) {
+                    if (UtilValidate.isNotEmpty(shoppingList.get("contactMechId"))) {
                         listCart.setShippingContactMechId(0, shoppingList.getString("contactMechId"));
                     }
-                    if (shoppingList.get("shipmentMethodTypeId") != null) {
+                    if (UtilValidate.isNotEmpty(shoppingList.get("shipmentMethodTypeId"))) {
                         listCart.setShipmentMethodTypeId(0, shoppingList.getString("shipmentMethodTypeId"));
                     }
-                    if (shoppingList.get("carrierPartyId") != null) {
+                    if (UtilValidate.isNotEmpty(shoppingList.get("carrierPartyId"))) {
                         listCart.setCarrierPartyId(0, shoppingList.getString("carrierPartyId"));
+                    }
+                    if (UtilValidate.isNotEmpty(shoppingList.getString("productPromoCodeId"))) {
+                        listCart.addProductPromoCode(shoppingList.getString("productPromoCodeId"), dispatcher);
                     }
                 }
             }