You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/06/16 16:41:39 UTC

svn commit: r785235 - in /ofbiz/trunk/applications/product: config/ servicedef/ src/org/ofbiz/shipment/weightPackage/ webapp/facility/WEB-INF/

Author: ashish
Date: Tue Jun 16 14:41:38 2009
New Revision: 785235

URL: http://svn.apache.org/viewvc?rev=785235&view=rev
Log:
Applied patch from jira issue OFBIZ-2227 (If CC capture fails while packing order, Packer is notified and sets the package aside for CSR to handle.)
Thanks Akash Jain for the contribution and Pranay Pandey for reviewing and commenting on the work.

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=785235&r1=785234&r2=785235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Tue Jun 16 14:41:38 2009
@@ -222,6 +222,9 @@
         <value xml:lang="zh">特别说明</value>
         <value xml:lang="zh_CN">特殊说明</value>
     </property>
+    <property key="FacilityThereIsProblemOccuredInPaymentCapture">
+        <value xml:lang="en">There is problem occured in payment capture, shipment is still in PICKED status</value>
+    </property>
     <property key="FacilityWaitEntireOrderReady">
         <value xml:lang="de">Bitte warten Sie mit der Auslieferung bis die Bestellung vollständig vorliegt.</value>
         <value xml:lang="en">Please wait until the entire order is ready before shipping.</value>

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=785235&r1=785234&r2=785235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Tue Jun 16 14:41:38 2009
@@ -537,13 +537,22 @@
 
     <service name="completeShipment" engine="java"
             location="org.ofbiz.shipment.weightPackage.WeightPackageServices" invoke="completeShipment" auth="true">
-         <description>Complete the packaging set the shipment to packed</description>
+        <description>Complete the packaging set the shipment to packed</description>
         <attribute name="weightPackageSession" type="org.ofbiz.shipment.weightPackage.WeightPackageSession" mode="IN" optional="false"/>
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
         <attribute name="facilityId" type="String" mode="IN" optional="true"/>
         <attribute name="shipmentId" type="String" mode="INOUT" optional="true"/>
     </service>
 
+    <service name="savePackagesInfo" engine="java"
+            location="org.ofbiz.shipment.weightPackage.WeightPackageServices" invoke="savePackagesInfo" auth="true">
+        <description>Save the package(s) information in ShipmentPackage entity from session</description>
+        <attribute name="weightPackageSession" type="org.ofbiz.shipment.weightPackage.WeightPackageSession" mode="IN" optional="false"/>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
+        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
+    </service>
+
     <!-- Pack Order Services -->
     <service name="packSingleItem" engine="java"
             location="org.ofbiz.shipment.packing.PackingServices" invoke="addPackLine" auth="true">

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java?rev=785235&r1=785234&r2=785235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageServices.java Tue Jun 16 14:41:38 2009
@@ -171,13 +171,7 @@
         Map<String, Object> response = FastMap.newInstance();
         try {
             String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N");
-            String result = "error";
-            // Check if UPS integration is done
-            if ("Y".equals(getActualShippingQuoteFromUps)) {
-                result = weightPackageSession.complete(orderId, locale, "Y");
-            } else {
-                result = weightPackageSession.complete(orderId, locale);
-            }
+            String result = weightPackageSession.complete(orderId, locale, getActualShippingQuoteFromUps);;
             if ("showWarningForm".equals(result)) {
                 response.put("showWarningForm", true);
             } else if ("success".equals(result)) {
@@ -202,9 +196,9 @@
         try {
             String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N");
             // Check if UPS integration is done
-            if ("Y".equals(getActualShippingQuoteFromUps) && weightPackageSession.completeShipment(orderId, "Y")) {
+            if ("Y".equals(getActualShippingQuoteFromUps) && weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) {
                 response.put("shipmentId", shipmentId);
-            } else if (weightPackageSession.completeShipment(orderId)) {
+            } else if (weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) {
                 response.put("shipmentId", shipmentId);
             } else {
                 response = ServiceUtil.returnError(UtilProperties.getMessage("ProductErrorUiLabels", "ProductErrorNoItemsCurrentlySetToBeShippedCannotComplete", locale));
@@ -215,4 +209,20 @@
         return response;
     }
 
+    public static Map<String, Object> savePackagesInfo(DispatchContext dctx, Map<String, ? extends Object> context) {
+        Locale locale = (Locale) context.get("locale");
+        WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession");
+
+        String orderId = (String) context.get("orderId");
+
+        String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N");
+        try {
+            weightPackageSession.savePackagesInfo(orderId, getActualShippingQuoteFromUps);
+        } catch (GeneralException e) {
+            return ServiceUtil.returnError(e.getMessage());
+        }
+
+        return ServiceUtil.returnSuccess(UtilProperties.getMessage("ProductUiLabels", "FacilityThereIsProblemOccuredInPaymentCapture", locale));
+    }
+
 }
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java?rev=785235&r1=785234&r2=785235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java Tue Jun 16 14:41:38 2009
@@ -293,10 +293,6 @@
         }
     }
 
-    public String complete(String orderId, Locale locale) throws GeneralException {
-        return complete(orderId, locale, "N");
-    }
-
     public String complete(String orderId, Locale locale, String calculateOnlineShippingRateFromUps) throws GeneralException {
 
         //create the package(s)
@@ -330,10 +326,6 @@
         return "success";
     }
 
-    public boolean completeShipment(String orderId) throws GeneralException {
-        return completeShipment(orderId, "N");
-    }
-
     public boolean completeShipment(String orderId, String calculateOnlineShippingRateFromUps) throws GeneralException {
         // Check if UPS integration is done 
         if ("Y".equals(calculateOnlineShippingRateFromUps)) {
@@ -522,4 +514,14 @@
         }
         return shipmentCostEstimate;
     }
+
+    protected void savePackagesInfo(String orderId, String calculateOnlineShippingRateFromUps) throws GeneralException {
+        //create the package(s)
+        this.createPackages(orderId);
+        // Check if UPS integration is done 
+        if ("Y".equals(calculateOnlineShippingRateFromUps)) {
+            // call upsShipmentConfirm service, it will calculate the online shipping rate from UPS and save in ShipmentRouteSegment entity in actualCost field
+            this.upsShipmentConfirm();
+        }
+    }
 }
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=785235&r1=785234&r2=785235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Tue Jun 16 14:41:38 2009
@@ -731,6 +731,12 @@
         <security https="true" auth="true"/>
         <event type="service" invoke="completePackage"/>
         <response name="success" type="view" value="WeightPackageOnly"/>
+        <response name="error" type="request" value="savePackagesInfo"/>
+    </request-map>
+    <request-map uri="savePackagesInfo">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="savePackagesInfo"/>
+        <response name="success" type="view" value="WeightPackageOnly"/>
         <response name="error" type="view" value="WeightPackageOnly"/>
     </request-map>