svn commit: r940803 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml src/org/ofbiz/order/shoppingcart/CheckOutEvents.java src/org/ofbiz/order/shoppingcart/CheckOutHelper.java webapp/ordermgr/entry/optionsettings.ftl

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

svn commit: r940803 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml src/org/ofbiz/order/shoppingcart/CheckOutEvents.java src/org/ofbiz/order/shoppingcart/CheckOutHelper.java webapp/ordermgr/entry/optionsettings.ftl

hansbak-2
Author: hansbak
Date: Tue May  4 11:00:44 2010
New Revision: 940803

URL: http://svn.apache.org/viewvc?rev=940803&view=rev
Log:
be able to enter a shipping extimate per shipping group on purchase order entry

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=940803&r1=940802&r2=940803&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Tue May  4 11:00:44 2010
@@ -6676,6 +6676,9 @@
         <value xml:lang="zh">扣留的订单</value>
         <value xml:lang="zh_CN">未完成订单</value>
     </property>
+    <property key="OrderOrderShipEstimate">
+        <value xml:lang="en">Shipping estimate amount</value>
+    </property>
     <property key="OrderOrdersTotals">
         <value xml:lang="de">Aufträge Total</value>
         <value xml:lang="en">Orders Totals</value>

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=940803&r1=940802&r2=940803&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Tue May  4 11:00:44 2010
@@ -677,6 +677,7 @@ public class CheckOutEvents {
         Boolean offlinePayments;
         String shippingContactMechId = null;
         String shippingMethod = null;
+        BigDecimal shipEstimate = null;
         String shippingInstructions = null;
         String maySplit = null;
         String giftMessage = null;
@@ -807,8 +808,15 @@ public class CheckOutEvents {
                     shipAfterDate = request.getParameter("sgi" + shipGroupIndex + "_shipAfterDate");
                     internalOrderNotes = request.getParameter("internal_order_notes");
                     shippingNotes = request.getParameter("shippingNotes");
-
-                    callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, internalOrderNotes, shippingNotes);
+                    if (request.getParameter(shipGroupIndex + "_ship_estimate") != null) {
+                        shipEstimate = new BigDecimal(request.getParameter(shipGroupIndex + "_ship_estimate"));
+                    }
+                    
+                    if (shipEstimate == null) {  // allow ship estimate to be set manually if a purchase order
+                        callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, internalOrderNotes, shippingNotes);
+                    } else {
+                        callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, internalOrderNotes, shippingNotes, shipEstimate);
+                    }
                     ServiceUtil.addErrors(errorMessages, errorMaps, callResult);
                 }
             }

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=940803&r1=940802&r2=940803&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Tue May  4 11:00:44 2010
@@ -1330,6 +1330,11 @@ public class CheckOutHelper {
         return finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, null, null);
     }
     public Map finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit,
+            String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes, BigDecimal shipEstimate) {
+        this.cart.setItemShipGroupEstimate(shipEstimate, shipGroupIndex);
+        return finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, internalOrderNotes, shippingNotes);
+    }
+    public Map finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit,
             String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes) {
 
         Map result = ServiceUtil.returnSuccess();

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=940803&r1=940802&r2=940803&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl Tue May  4 11:00:44 2010
@@ -65,7 +65,6 @@ under the License.
                     <h1><b>${uiLabelMap.OrderShipGroup} ${uiLabelMap.CommonNbr} ${currIndex}</b><#if supplier?has_content> - ${supplier.groupName?default(supplier.partyId)}</#if></h1>
                 </td>
               </tr>
-
                <#if cart.getOrderType() != "PURCHASE_ORDER">
                 <tr>
                   <td colspan="2">
@@ -109,7 +108,17 @@ under the License.
                 </tr>
                 </#if>
                <#else>
-                   <input type='hidden' name='${shipGroupIndex?default("0")}_shipping_method' value="NO_SHIPPING@_NA_" />
+                   <tr>
+                     <td>
+                       <h2>${uiLabelMap.OrderOrderShipEstimate}</h2>
+                     </td>
+                   </tr>
+                   <tr>
+                     <input type='hidden' name='${shipGroupIndex?default("0")}_shipping_method' value="STANDARD@_NA_" />
+                     <td>
+                       <input type='text' name='${shipGroupIndex?default("0")}_ship_estimate'/>
+                     </td>
+                   </tr>
                </#if>
                 <tr>
                   <td colspan='2'>