svn commit: r420753 - in /incubator/ofbiz/trunk/applications: order/entitydef/ order/servicedef/ order/src/org/ofbiz/order/order/ order/src/org/ofbiz/order/shoppingcart/ order/src/org/ofbiz/order/shoppinglist/ product/entitydef/

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

svn commit: r420753 - in /incubator/ofbiz/trunk/applications: order/entitydef/ order/servicedef/ order/src/org/ofbiz/order/order/ order/src/org/ofbiz/order/shoppingcart/ order/src/org/ofbiz/order/shoppinglist/ product/entitydef/

jonesde
Author: jonesde
Date: Tue Jul 11 00:47:06 2006
New Revision: 420753

URL: http://svn.apache.org/viewvc?rev=420753&view=rev
Log:
Added a new OrderHeader field: autoOrderShoppingListId, used to track the shoppingListId for orders auto-created from a ShoppingList; also added some fields to the ProductStore to configure certain payment retry settings for these automatic orders from shopping lists; the new OrderHeader field is now also being saved through the storeOrder service, ie all changes in place there

Modified:
    incubator/ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    incubator/ofbiz/trunk/applications/order/servicedef/services.xml
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
    incubator/ofbiz/trunk/applications/product/entitydef/entitymodel.xml

Modified: incubator/ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ incubator/ofbiz/trunk/applications/order/entitydef/entitymodel.xml Tue Jul 11 00:47:06 2006
@@ -327,6 +327,7 @@
       <field name="productStoreId" type="id"></field>
       <field name="terminalId" type="id-long"></field>
       <field name="transactionId" type="id-long"></field>
+      <field name="autoOrderShoppingListId" type="id"></field>
       <field name="needsInventoryIssuance" type="indicator"></field>
       <field name="isRushOrder" type="indicator"></field>
       <field name="internalCode" type="id-long"></field>
@@ -350,6 +351,9 @@
       </relation>
       <relation type="one" fk-name="ORDER_HDR_PDSTR" rel-entity-name="ProductStore">
         <key-map field-name="productStoreId"/>
+      </relation>
+      <relation type="one" fk-name="ORDER_HDR_AOSHLST" title="AutoOrder" rel-entity-name="ShoppingList">
+        <key-map field-name="autoOrderShoppingListId" rel-field-name="shoppingListId"/>
       </relation>
       <relation type="one" fk-name="ORDER_HDR_CBUL" title="CreatedBy" rel-entity-name="UserLogin">
         <key-map field-name="createdBy" rel-field-name="userLoginId"/>

Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Tue Jul 11 00:47:06 2006
@@ -105,6 +105,7 @@
         <attribute name="originFacilityId" type="String" mode="IN" optional="true"/>
         <attribute name="transactionId" type="String" mode="IN" optional="true"/>
         <attribute name="terminalId" type="String" mode="IN" optional="true"/>
+        <attribute name="autoOrderShoppingListId" type="String" mode="IN" optional="true"/>
         <attribute name="webSiteId" type="String" mode="IN" optional="true"/>
         <attribute name="externalId" type="String" mode="IN" optional="true"/>
         <attribute name="internalCode" type="String" mode="IN" optional="true"/>

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Tue Jul 11 00:47:06 2006
@@ -473,6 +473,10 @@
             orderHeader.set("terminalId", context.get("terminalId"));
         }
 
+        if (UtilValidate.isNotEmpty((String) context.get("autoOrderShoppingListId"))) {
+            orderHeader.set("autoOrderShoppingListId", context.get("autoOrderShoppingListId"));
+        }
+
         if (UtilValidate.isNotEmpty((String) context.get("webSiteId"))) {
             orderHeader.set("webSiteId", context.get("webSiteId"));
         }

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Tue Jul 11 00:47:06 2006
@@ -517,22 +517,14 @@
         if (distributorId != null) context.put("distributorId", distributorId);
         if (affiliateId != null) context.put("affiliateId", affiliateId);
 
-        // need the partyId; don't use userLogin in case of an order via order mgr
-        String partyId = this.cart.getPartyId();
-        String facilityId = this.cart.getFacilityId();
-        String terminalId = this.cart.getTerminalId();
-        String transactionId = cart.getTransactionId();
-        String productStoreId = cart.getProductStoreId();
-
         context.put("grandTotal", grandTotal);
         context.put("userLogin", userLogin);
-        context.put("partyId", partyId);
-        context.put("productStoreId", productStoreId);
-        context.put("transactionId", transactionId);
-        context.put("originFacilityId", facilityId);
         context.put("visitId", visitId);
-        context.put("terminalId", terminalId);
         context.put("webSiteId", webSiteId);
+
+        // need the partyId; don't use userLogin in case of an order via order mgr
+        String partyId = this.cart.getPartyId();
+        String productStoreId = cart.getProductStoreId();
 
         // store the order - invoke the service
         Map storeResult = null;

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Tue Jul 11 00:47:06 2006
@@ -145,6 +145,7 @@
     protected String facilityId = null;
     protected String webSiteId = null;
     protected String terminalId = null;
+    protected String autoOrderShoppingListId = null;
 
     /** General partyId for the Order, all other IDs default to this one if not specified explicitly */
     protected String orderPartyId = null;
@@ -198,6 +199,10 @@
         this.defaultShipAfterDate = cart.getDefaultShipAfterDate();
         this.defaultShipBeforeDate = cart.getDefaultShipBeforeDate();
         
+        this.terminalId = cart.getTerminalId();
+        this.transactionId = cart.getTransactionId();
+        this.autoOrderShoppingListId = cart.getAutoOrderShoppingListId();
+        
         // clone the additionalPartyRoleMap
         this.additionalPartyRole = new HashMap();
         Iterator it = cart.additionalPartyRole.entrySet().iterator();
@@ -320,6 +325,14 @@
         this.terminalId = terminalId;
     }
 
+    public String getAutoOrderShoppingListId() {
+        return this.autoOrderShoppingListId;
+    }
+
+    public void setAutoOrderShoppingListId(String autoOrderShoppingListId) {
+        this.autoOrderShoppingListId = autoOrderShoppingListId;
+    }
+
     public String getFacilityId() {
         return this.facilityId;
     }
@@ -3352,6 +3365,13 @@
         result.put("firstAttemptOrderId", this.getFirstAttemptOrderId());
         result.put("currencyUom", this.getCurrency());
         result.put("billingAccountId", this.getBillingAccountId());
+
+        result.put("partyId", this.getPartyId());
+        result.put("productStoreId", this.getProductStoreId());
+        result.put("transactionId", this.getTransactionId());
+        result.put("originFacilityId", this.getFacilityId());
+        result.put("terminalId", this.getTerminalId());
+        result.put("autoOrderShoppingListId", this.getAutoOrderShoppingListId());
 
         result.put("billToCustomerPartyId", this.getBillToCustomerPartyId());
         result.put("billFromVendorPartyId", this.getBillFromVendorPartyId());

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Tue Jul 11 00:47:06 2006
@@ -429,6 +429,7 @@
             if (UtilValidate.isNotEmpty(items)) {
                 listCart = new ShoppingCart(delegator, productStoreId, locale, currencyUom);
                 listCart.setOrderPartyId(shoppingList.getString("partyId"));
+                listCart.setAutoOrderShoppingListId(shoppingList.getString("shoppingListId"));
 
                 Iterator i = items.iterator();
                 while (i.hasNext()) {

Modified: incubator/ofbiz/trunk/applications/product/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=420753&r1=420752&r2=420753&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original)
+++ incubator/ofbiz/trunk/applications/product/entitydef/entitymodel.xml Tue Jul 11 00:47:06 2006
@@ -3077,6 +3077,10 @@
       <field name="vatTaxAuthPartyId" type="id"></field>
       <field name="enableDigProdUpload" type="indicator"></field>
       <field name="digProdUploadCategoryId" type="id"></field>
+      <field name="autoOrderCcTryExp" type="indicator"><description>For auto-orders try other Credit Card expiration dates (if date is wrong or general failure where type not known)?</description></field>
+      <field name="autoOrderCcTryOtherCards" type="indicator"><description>For auto-orders try other Credit Cards for the customer?</description></field>
+      <field name="autoOrderCcTryLaterNsf" type="indicator"><description>For auto-orders if Credit Cards fails for NSF (Not Sufficient Funds) try again later?</description></field>
+      <field name="autoOrderCcTryLaterMax" type="numeric"><description>For auto-orders if Credit Cards fails for NSF try again how many times?</description></field>
       <prim-key field="productStoreId"/>
       <relation type="one" fk-name="PROD_STR_PRSTRGP" title="Primary" rel-entity-name="ProductStoreGroup">
         <key-map field-name="primaryStoreGroupId" rel-field-name="productStoreGroupId"/>