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/17 12:34:56 UTC

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

Author: ashish
Date: Wed Jun 17 10:34:55 2009
New Revision: 785544

URL: http://svn.apache.org/viewvc?rev=785544&view=rev
Log:
Removed unused code. Now "weightPackageOnly" is no more in use.
Thanks Akash for your contribution.

Modified:
    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/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=785544&r1=785543&r2=785544&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Wed Jun 17 10:34:55 2009
@@ -483,12 +483,6 @@
     </service>
 
     <!-- Weight Package Only Services -->
-    <service name="weightPackageOnly" engine="java"
-            location="org.ofbiz.shipment.weightPackage.WeightPackageServices" invoke="weightPackageOnly" auth="true">
-        <description>Check order is verified or not, if veified than shown weight package only screen otherwise shown packing screen</description>
-        <attribute name="orderId" type="String" mode="IN" optional="false"/>
-    </service>
-
     <service name="setPackageInfo" engine="java"
             location="org.ofbiz.shipment.weightPackage.WeightPackageServices" invoke="setPackageInfo" auth="true">
         <description>Set the weight, dimensions/shipmentBoxType of package in SESSION</description>
@@ -629,30 +623,6 @@
         <attribute name="packageSeqId" type="Integer" mode="IN" optional="false"/>
     </service>
 
-    <service name="weightPackage" engine="java"
-            location="org.ofbiz.shipment.packing.PackingServices" invoke="weightPackage" auth="true">
-        <description>Set the dimension and weight of packages in the ShipmentPackage entity</description>
-        <attribute name="packingSession" type="org.ofbiz.shipment.packing.PackingSession" mode="IN" optional="false"/>
-        <attribute name="packageWeight" type="String" mode="IN" optional="true"/>
-        <attribute name="packageLength" type="String" mode="IN" optional="true"/>
-        <attribute name="packageWidth" type="String" mode="IN" optional="true"/>
-        <attribute name="packageHeight" type="String" mode="IN" optional="true"/>
-        <attribute name="packageSeqId" type="String" mode="IN" optional="true"/>
-        <attribute name="shipmentBoxTypeId" type="String" mode="IN" optional="true"/>
-        <attribute name="weightPackageSeqId" type="String" mode="IN" optional="true"/>
-        <attribute name="dimensionSavedInSession" type="Boolean" mode="OUT" optional="true"/>
-    </service>
-
-    <service name="holdShipment" engine="java"
-            location="org.ofbiz.shipment.packing.PackingServices" invoke="holdShipment" auth="true">
-        <description>Shipment will remains in PICKED sataus and dimension and weight will save in the ShipmentPackage entity</description>
-        <attribute name="packingSession" type="org.ofbiz.shipment.packing.PackingSession" mode="IN" optional="false"/>
-        <attribute name="facilityId" type="String" mode="IN" optional="true"/>
-        <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
-        <attribute name="dimensionUomId" type="String" mode="IN" optional="true"/>
-        <attribute name="weightUomId" type="String" mode="IN" optional="true"/>
-    </service>
-
     <service name="completePack" engine="java"
             location="org.ofbiz.shipment.packing.PackingServices" invoke="completePack" auth="true">
         <description>Complete the packaging set the shipment to PACKED</description>

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=785544&r1=785543&r2=785544&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 Wed Jun 17 10:34:55 2009
@@ -27,35 +27,16 @@
 
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.UtilNumber;
 import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.ServiceUtil;
 
 public class WeightPackageServices {
 
     private static BigDecimal ZERO = BigDecimal.ZERO;
-    private static int rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding");
-
-    public static Map<String, Object> weightPackageOnly(DispatchContext dctx, Map<String, ? extends Object> context) {
-        GenericDelegator delegator = dctx.getDelegator();
-        Locale locale = (Locale) context.get("locale");
-        WeightPackageSession weightPackageSession = (WeightPackageSession) context.get("weightPackageSession");
-        String orderId = (String) context.get("orderId");
-        try {
-            GenericValue shipment = EntityUtil.getFirst(delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId, "statusId", "SHIPMENT_PICKED")));
-            if (UtilValidate.isEmpty(shipment)) {
-                return ServiceUtil.returnError(UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderNotVerified", UtilMisc.toMap("orderId", orderId), locale));
-            }
-        } catch (GeneralException e) {
-            ServiceUtil.returnError(e.getMessage());
-        }
-        return ServiceUtil.returnSuccess();
-    }
 
     public static Map<String, Object> setPackageInfo(DispatchContext dctx, Map<String, ? extends Object> context) {
         GenericDelegator delegator = dctx.getDelegator();
@@ -195,10 +176,7 @@
         Map<String, Object> response = FastMap.newInstance();
         try {
             String getActualShippingQuoteFromUps = UtilProperties.getPropertyValue("shipment.properties", "shipment.ups.shipping", "N");
-            // Check if UPS integration is done
-            if ("Y".equals(getActualShippingQuoteFromUps) && weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) {
-                response.put("shipmentId", shipmentId);
-            } else if (weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) {
+            if (weightPackageSession.completeShipment(orderId, getActualShippingQuoteFromUps)) {
                 response.put("shipmentId", shipmentId);
             } else {
                 response = ServiceUtil.returnError(UtilProperties.getMessage("ProductErrorUiLabels", "ProductErrorNoItemsCurrentlySetToBeShippedCannotComplete", locale));

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=785544&r1=785543&r2=785544&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 Wed Jun 17 10:34:55 2009
@@ -39,8 +39,6 @@
 import org.ofbiz.service.GenericDispatcher;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.shipment.weightPackage.WeightPackageSession;
-import org.ofbiz.shipment.weightPackage.WeightPackageSessionLine;
 
 public class WeightPackageSession implements Serializable {
 

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=785544&r1=785543&r2=785544&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Wed Jun 17 10:34:55 2009
@@ -781,16 +781,6 @@
         <response name="success" type="view" value="PackOrder"/>
         <response name="error" type="view" value="PackOrder"/>
     </request-map>
-    <request-map uri="WeightPackgeOnly">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="PackOrder"/>
-    </request-map>
-    <request-map uri="weightPackage">
-        <security https="true" auth="true"/>
-        <event type="service" invoke="weightPackage"/>
-        <response name="success" type="view" value="PackOrder"/>
-        <response name="error" type="view" value="PackOrder"/>
-    </request-map>
     <request-map uri="CompletePack">
         <security https="true" auth="true"/>
         <event type="service" invoke="completePack"/>