svn commit: r551610 - in /ofbiz/trunk: applications/product/script/org/ofbiz/product/inventory/ applications/product/script/org/ofbiz/shipment/shipment/ applications/product/servicedef/ specialpurpose/oagis/src/org/ofbiz/oagis/

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

svn commit: r551610 - in /ofbiz/trunk: applications/product/script/org/ofbiz/product/inventory/ applications/product/script/org/ofbiz/shipment/shipment/ applications/product/servicedef/ specialpurpose/oagis/src/org/ofbiz/oagis/

apatel-2
Author: apatel
Date: Thu Jun 28 09:17:27 2007
New Revision: 551610

URL: http://svn.apache.org/viewvc?view=rev&rev=551610
Log:
Added service issueSerializedInvToShipmentPackageAndSetTracking and reserveAnInventoryItem. Fixed type error.

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml?view=diff&rev=551610&r1=551609&r2=551610
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml Thu Jun 28 09:17:27 2007
@@ -249,7 +249,37 @@
 
         <field-to-result field-name="quantityNotReserved" map-name="parameters"/>
     </simple-method>
-
+    
+    <simple-method method-name="reserveAnInventoryItem" short-description="Reserve a Specific Serialized InventoryItem">
+        <!--
+        Well the InventoryItem I want to reserve is already reserved, But my customer wants the just this inventoryItem.
+        Let me find the reservation on this inventory, cancel it and re-reserve something else for the other order.
+        This way I'll get what I want and the other orderItem will also have a similar thing to issue.
+        -->        
+        <set field="inventoryItemLookUp.inventoryItemId" from-field="parameters.inventoryItemId"/>
+        <find-by-primary-key map-name="inventoryItemLookUp" entity-name="InventoryItem" value-name="inventoryItem"/>        
+        <set field="inventoryReservationLookUp.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
+        <find-by-and map-name="inventoryReservationLookUp" list-name="invReservations" entity-name="OrderItemShipGrpInvRes"/>
+        <first-from-list entry-name="inventoryItemReservation" list-name="invReservations"/>        
+        <set-service-fields map-name="inventoryItemReservation" to-map-name="cancelOrderItemShipGrpInvResMap" service-name="cancelOrderItemShipGrpInvRes"/>        
+        <set-service-fields map-name="inventoryItemReservation" to-map-name="reReserveOrderItemShipGrpInvResMap" service-name="reserveProductInventory"/>        
+        <!-- We'll get all except productId, facilityId, requireInventory fields in  inventoryItemReservation -->
+        <set field="reReserveOrderItemShipGrpInvResMap.facilityId" from-field="parameters.facilityId"/>
+        <set field="reReserveOrderItemShipGrpInvResMap.productId" from-field="parameters.productId"/>
+        <set field="reReserveOrderItemShipGrpInvResMap.requireInventory" from-field="parameters.requireInventory"/>                
+        <!-- Step 1 call the cancel reservation service -->
+        <call-service service-name="cancelOrderItemShipGrpInvRes" in-map-name="cancelOrderItemShipGrpInvResMap"/>
+        <!-- Step 2 call this method again and the reservation should go through -->
+        <set field="orderHeaderMap.orderId" from-field="parameters.orderId"/>
+        <find-by-primary-key entity-name="OrderHeader" value-name="orderHeader" map-name="orderHeaderMap"/>
+        <call-simple-method method-name="reserveForInventoryItemInline"/>
+        <!-- Step 3 Now last thing, lets reReserve inventory for order form where we got our item. Be curtious -->
+        <call-service service-name="reserveProductInventory" in-map-name="reReserveOrderItemShipGrpInvResMap">        
+            <result-to-field result-name="quantityNotReserved" field-name="paramaters.quantityNotReserved"/>
+        </call-service>
+        <field-to-result field-name="quantityNotReserved" map-name="parameters"/>
+    </simple-method>
+    
     <simple-method method-name="reserveForInventoryItemInline" short-description="Does a reservation for one InventoryItem, meant to be called in-line">
         <!-- only do something with this inventoryItem if there is more inventory to reserve -->
         <if-compare field-name="parameters.quantityNotReserved" operator="greater" value="0" type="Double">
@@ -491,4 +521,5 @@
         </if-compare>
     </simple-method>
 </simple-methods>
+
 

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?view=diff&rev=551610&r1=551609&r2=551610
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Thu Jun 28 09:17:27 2007
@@ -1345,6 +1345,89 @@
         </iterate>
     </simple-method>
 
+    <simple-method method-name="issueSerializedInvToShipmentPackageAndSetTracking" short-description="">
+        <!-- In Parameters are
+            orderId, orderItemSeqId, shipGroupSeqId, inventoryItemId, originFacilityId, qtyShipped, trackingNum, serialNumber  
+            If serialNumber is provide, Then compare it with the serialNumber of inventoryItem on reservation. If they don't match,
+            We'll have to reReserve specific inventory that is shiped.            
+        -->
+        <make-value entity-name="OrderItemShipGrpInvRes" value-name="orderItemShipGrpInvResLookupPk"/>                
+        <set-pk-fields value-name="orderItemShipGrpInvResLookupPk" map-name="parameters"/>
+        <find-by-primary-key entity-name="OrderItemShipGrpInvRes" map-name="orderItemShipGrpInvResLookupPk" value-name="orderItemShipGrpInvRes"/>      
+        <get-related-one to-value-name="inventoryItem" relation-name="InventoryItem" value-name="orderItemShipGrpInvRes"/>
+        <if-compare-field operator="not-equals" field-name="inventoryItem.serialNumber" to-field-name="parameters.serialNumber">            
+            <!-- The inventory that we have reserved is not what we shipped. Lets reReserve, this time we'll get what we want -->
+            <set-service-fields map-name="parameters" to-map-name="reserveAnInventoryItemCtx" service-name="reserveAnInventoryItem"/>
+            <call-service service-name="reserveAnInventoryItem" in-map-name="reserveAnInventoryItemCtx"/>
+        </if-compare-field>
+        <!-- get InventoryItem issued to shipment -->
+        <log level="verbose" message="Item Map : ${itemMap}"/>
+        <clear-field field-name="issueContext"/>
+        <set from-field="parameters.shipmentId" field="issueContext.shipmentId"/>
+        <set from-field="parameters.inventoryItemId" field="issueContext.inventoryItemId"/>
+        <set from-field="parameters.orderId" field="issueContext.orderId"/>
+        <set from-field="parameters.shipGroupSeqId" field="issueContext.shipGroupSeqId"/>
+        <set from-field="parameters.orderItemSeqId" field="issueContext.orderItemSeqId"/>
+        <set from-field="parameters.inventoryItemId" field="issueContext.inventoryItemId"/>
+        <set from-field="parameters.quantity" field="issueContext.quantity"/>
+        <call-service service-name="issueOrderItemShipGrpInvResToShipment" in-map-name="issueContext">
+            <result-to-field result-name="itemIssuanceId" field-name="parameters.itemIssuanceId"/>
+        </call-service>
+        <!-- place all issued items into a unique package per tracking num -->                
+            <log level="info" message="QuickShipOrderByItem grouping by tracking number : ${parameters.trackingNum}"/>
+
+            <entity-one entity-name="ItemIssuance" value-name="itemIssuance">
+                <field-map field-name="itemIssuanceId" env-name="parameters.itemIssuanceId"/>
+            </entity-one>
+
+            <clear-field field-name="shipItemContext"/>
+            <set from-field="packageMap.${itemMap.trackingNum}" field="shipItemContext.shipmentPackageSeqId"/>
+            <if-empty field-name="shipItemContext.shipmentPackageSeqId">
+                <set value="New" field="shipItemContext.shipmentPackageSeqId"/>
+            </if-empty>
+            <log level="info" message="Package SeqID : ${shipItemContext.shipmentPackageSeqId}"/>
+
+            <set from-field="itemIssuance.shipmentId" field="shipItemContext.shipmentId"/>
+            <set from-field="itemIssuance.shipmentItemSeqId" field="shipItemContext.shipmentItemSeqId"/>
+            <set from-field="itemIssuance.quantity" field="shipItemContext.quantity"/>
+            <call-service service-name="addShipmentContentToPackage" in-map-name="shipItemContext">
+                <result-to-field result-name="shipmentPackageSeqId" field-name="packageMap.${parameters.trackingNum}"/>
+                <result-to-field result-name="shipmentPackageSeqId" map-name="routeSegLookup"/>
+            </call-service>
+
+            <if-not-empty field-name="shipmentPackageSeqId" map-name="routeSegLookup">
+                <set from-field="itemIssuance.shipmentId" field="routeSegLookup.shipmentId"/>
+                <!-- quick ship orders should only have one route segment -->
+                <set value="00001" field="routeSegLookup.shipmentRouteSegmentId"/>
+                <find-by-primary-key entity-name="ShipmentPackageRouteSeg" map-name="routeSegLookup" value-name="packageRouteSegment"/>
+
+                <if-not-empty field-name="packageRouteSegment">
+                    <set from-field="parameters.trackingNum" field="packageRouteSegment.trackingCode"/>
+                    <store-value value-name="packageRouteSegment"/>
+                </if-not-empty>
+                <if-empty field-name="packageRouteSegment">
+                    <log level="warning" message="No route segment found : ${routeSegLookup}"/>
+                </if-empty>
+            </if-not-empty>
+            <if-empty field-name="routeSegLookup.shipmentPackageSeqId">
+                <log level="warning" message="No shipment package ID found; cannot update RouteSegment"/>
+            </if-empty>
+      
+        <!-- update the shipment status to packed -->
+        <set from-field="shipment.shipmentId" field="packedContext.shipmentId"/>
+        <set value="SHIPMENT_PACKED" field="packedContext.statusId"/>
+        <call-service service-name="updateShipment" in-map-name="packedContext"/>
+
+        <!-- update the shipment status to shipped -->
+        <if-empty field-name="parameters.setPackedOnly">
+            <set from-field="shipment.shipmentId" field="packedContext.shipmentId"/>
+            <set value="SHIPMENT_SHIPPED" field="packedContext.statusId"/>
+            <call-service service-name="updateShipment" in-map-name="packedContext"/>
+        </if-empty>
+
+    </simple-method>
+
+    
     <simple-method method-name="quickShipOrderByItem" short-description="Quick ships order based on item list">
         <!-- quick ship order using multiple packages per tracking number -->
         <!-- Parameters coming in: orderId, shipGroupSeqId,itemShipList, originFacilityId, setPackedOnly -->
@@ -1437,7 +1520,7 @@
             <set from-field="itemIssuance.shipmentId" field="shipItemContext.shipmentId"/>
             <set from-field="itemIssuance.shipmentItemSeqId" field="shipItemContext.shipmentItemSeqId"/>
             <set from-field="itemIssuance.quantity" field="shipItemContext.quantity"/>
-            <call-service service-name="3ContentToPackage" in-map-name="shipItemContext">
+            <call-service service-name="addShipmentContentToPackage" in-map-name="shipItemContext">
                 <result-to-field result-name="shipmentPackageSeqId" field-name="packageMap.${itemMap.trackingNum}"/>
                 <result-to-field result-name="shipmentPackageSeqId" map-name="routeSegLookup"/>
             </call-service>
@@ -1702,4 +1785,5 @@
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
 -->
+
 

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?view=diff&rev=551610&r1=551609&r2=551610
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Thu Jun 28 09:17:27 2007
@@ -230,6 +230,22 @@
         <attribute name="priorityOrderItemSeqId" type="String" mode="IN" optional="true"/>
     </service>
 
+    <service name="reserveAnInventoryItem" engine="simple"
+            location="org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveAnInventoryItem" auth="true">
+        <description></description>
+        <attribute name="inventoryItemId" type="String" mode="IN" optional="false"/>
+        <attribute name="productId" type="String" mode="IN" optional="false"/>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="quantity" type="Double" mode="IN" optional="false"/>
+        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="requireInventory" type="String" mode="IN" optional="false"/>
+        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="false"/>
+        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
+        <attribute name="quantityNotReserved" type="Double" mode="INOUT" optional="false"/>
+    </service>
+                
     <service name="reserveProductInventory" engine="simple"
             location="org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveProductInventory" auth="true">
         <description>Reserve Inventory for a Product.
@@ -272,7 +288,7 @@
             availableToPromise will be used to track quantity ordered beyond what is in stock.
         </description>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
-        <attribute name="containerId" type="String" mode="IN" optional="false"/>
+        <attribute name="containerId" type="String" mode="IN" optional="false"/>        
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
         <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/>
         <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=551610&r1=551609&r2=551610
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Thu Jun 28 09:17:27 2007
@@ -661,5 +661,24 @@
         <attribute name="currencyUomId" type="String" mode="IN" optional="false"/>
         <attribute name="packageValue" type="BigDecimal" mode="OUT" optional="true"/>
     </service>
-
+    
+    <service name="issueSerializedInvToShipmentPackageAndSetTracking" engine="simple"
+            location="org/ofbiz/shipment/shipment/ShipmentServices.xml" invoke="issueSerializedInvToShipmentPackageAndSetTracking" auth="true">
+        <description></description>
+        <attribute name="inventoryItemId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipmentId" type="String" mode="IN" optional="false"/>
+        <attribute name="productId" type="String" mode="IN" optional="true"/>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>        
+        <attribute name="quantity" type="Double" mode="IN" optional="true"/>
+        <attribute name="reservedDatetime" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="requireInventory" type="String" mode="IN" optional="true"/>
+        <attribute name="reserveOrderEnumId" type="String" mode="IN" optional="true"/>
+        <attribute name="sequenceId" type="Long" mode="IN" optional="true"/>
+        <attribute name="serialNumber" type="String" mode="IN" optional="true"/>
+        <attribute name="trackingNum" type="String" mode="IN" optional="true"/>
+        <attribute name="originFacilityId" type="String" mode="IN" optional="true"/>
+        <attribute name="quantityNotReserved" type="Double" mode="IN" optional="false"/>
+    </service>
 </services>

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=551610&r1=551609&r2=551610
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Thu Jun 28 09:17:27 2007
@@ -164,88 +164,63 @@
             
             /*Code for Issuing the Items*/
             List orderItemShipGrpInvReservations = FastList.newInstance();            
-            Map reserveOrderItemInventoryCtx = FastMap.newInstance();
+            Map iSITSPASTCtx = FastMap.newInstance();
             Map result = null;
             //GenericValue inventoryItem = null;
             try {                
                 GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", documentId));                
-                String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId");
-                
-                List shipmentItems = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", documentId, "productId",invItemItem));
-                GenericValue shipmentItem =  EntityUtil.getFirst(shipmentItems);
-                String shipmentItemSeqId = shipmentItem.getString("shipmentItemSeqId");
+                String shipGroupSeqId = shipment.getString("primaryShipGroupSeqId");                
+                String originFacilityId = shipment.getString("originFacilityId");                              
+                List shipmentItems = delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", documentId, "productId",invItemItem));                
+                GenericValue shipmentItem =  EntityUtil.getFirst(shipmentItems);                
+                String shipmentItemSeqId = shipmentItem.getString("shipmentItemSeqId");                
                 //Now we have enough keys to lookup the right OrderShipment
-                List orderShipments = delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", documentId, "shipmentItemSeqId",shipmentItemSeqId));
-                GenericValue orderShipment =   EntityUtil.getFirst(orderShipments);
-                String orderId = orderShipment.getString("orderId");
-                String orderItemSeqId = orderShipment.getString("orderItemSeqId");
-                
+                List orderShipments = delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", documentId, "shipmentItemSeqId",shipmentItemSeqId));                
+                GenericValue orderShipment =   EntityUtil.getFirst(orderShipments);                
+                String orderId = orderShipment.getString("orderId");                
+                String orderItemSeqId = orderShipment.getString("orderItemSeqId");                
+                GenericValue product = delegator.findByPrimaryKey("Product",UtilMisc.toMap("productId",invItemItem));                
+                String requireInventory = product.getString("requireInventory");
+                if(requireInventory == null) {
+                    requireInventory = "N";
+                }                
                 // Look for reservations in some status.
-                orderItemShipGrpInvReservations = delegator.findByAnd("OrderItemShipGrpInvRes", UtilMisc.toMap("orderId", orderId,"orderItemSeqId",orderItemSeqId,"shipGroupSeqId",shipGroupSeqId));                
-                GenericValue orderItemShipGrpInvReservation =   EntityUtil.getFirst(orderItemShipGrpInvReservations);
-                GenericValue inventoryItem = delegator.findByPrimaryKey("InventoryItem", UtilMisc.toMap("inventoryItemId",orderItemShipGrpInvReservation.get("inventoryItemId")));
+                orderItemShipGrpInvReservations = delegator.findByAnd("OrderItemShipGrpInvRes", UtilMisc.toMap("orderId", orderId,"orderItemSeqId",orderItemSeqId,"shipGroupSeqId",shipGroupSeqId));              
+                GenericValue orderItemShipGrpInvReservation =   EntityUtil.getFirst(orderItemShipGrpInvReservations);                
+                GenericValue inventoryItem = delegator.findByPrimaryKey("InventoryItem", UtilMisc.toMap("inventoryItemId",orderItemShipGrpInvReservation.get("inventoryItemId")));                
+                String serialNumber = inventoryItem.getString("serialNumber");                
                 
+                iSITSPASTCtx.put("orderId", orderId);
+                iSITSPASTCtx.put("shipGroupSeqId", shipGroupSeqId);
+                iSITSPASTCtx.put("orderItemSeqId", orderItemSeqId);                
+                iSITSPASTCtx.put("quantity", shipmentItem.get("quantity"));
+                iSITSPASTCtx.put("quantityNotReserved", shipmentItem.get("quantity"));
+                iSITSPASTCtx.put("productId", invItemItem);
+                iSITSPASTCtx.put("reservedDatetime", orderItemShipGrpInvReservation.get("reservedDatetime"));
+                iSITSPASTCtx.put("requireInventory", requireInventory);
+                iSITSPASTCtx.put("reserveOrderEnumId", orderItemShipGrpInvReservation.get("reserveOrderEnumId"));
+                iSITSPASTCtx.put("sequenceId", orderItemShipGrpInvReservation.get("sequenceId"));
+                iSITSPASTCtx.put("originFacilityId", originFacilityId);
+                iSITSPASTCtx.put("userLogin", userLogin);
+                iSITSPASTCtx.put("serialNumber", invDetailSerialNum);
+                iSITSPASTCtx.put("trackingNum", shipUnitTrackingId);
+                iSITSPASTCtx.put("inventoryItemId", orderItemShipGrpInvReservation.get("inventoryItemId"));                
+                iSITSPASTCtx.put("shipmentId", documentId);                                
                 // Check if the inventory Item we reserved is same as Item shipped
-                // If not then reserve Inventory Item
-                String serialNumber = inventoryItem.getString("serialNumber");
-                if(invDetailSerialNum != null) {
-                    //The if codition is for chacking serialized Inventory.
-                    if(!serialNumber.equals(invDetailSerialNum)) {
-                        // Check if the Inventory we want is available
-                        inventoryItem = EntityUtil.getFirst(delegator.findByAnd("InventoryItem", UtilMisc.toMap("productId", invItemItem, "serialNumber", invDetailSerialNum)));
-                        Debug.logInfo("======== InventoryItem In Else ========="+inventoryItem, module);
-                        reserveOrderItemInventoryCtx.put("inventoryItemId", inventoryItem.getString("inventoryItemId"));
-                        result = dispatcher.runSync("reserveAnInventoryItem", reserveOrderItemInventoryCtx);
-                        
-                        Debug.logInfo("========reserveOrderItemInventory ========="+result, module);
-                    }                    
+                // If not then reserve Inventory Item                              
+                try {                    
+                    result = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", iSITSPASTCtx);                                      
+                } catch(Exception e) {
+                    Debug.logInfo("========In catch =========", module);
+                    return ServiceUtil.returnError("return error"+e);
                 }
-                Map orderItemShipGrpInvResCtx = FastMap.newInstance(); // This Map is for the issueOrderItemShipGrpInvResToShipment service.
-                orderItemShipGrpInvResCtx.put("shipmentId", documentId);
-                orderItemShipGrpInvResCtx.putAll(reserveOrderItemInventoryCtx);                    
-                result = dispatcher.runSync("issueOrderItemShipGrpInvResToShipment", orderItemShipGrpInvResCtx);
-                Debug.logInfo("==============result for issueOrderItemShipGrpInvResToShipment=========="+result, module);
-                
-
-                /*
-                 Here we have to put the code for inserting the Tracking number in ShipmentPackageRouteSegment.
-                 The tracking number is coming from shipUnitTrackingId.
-                */
-                
-                /*
-                //find shipmentRouteSegmentId by the help of shipmentId                
-                GenericValue shipmentRouteSegment = EntityUtil.getFirst(delegator.findByAnd("ShipmentRouteSegment", UtilMisc.toMap("shipmentId",documentId)));              
-                String shipmentRouteSegmentId = (String) shipmentRouteSegment.get("shipmentRouteSegmentId");
-                Debug.logInfo("================shipmentRouteSegmentId============== "+shipmentRouteSegmentId, module);
-              
-                //find shipmentPackageSeqId by the help of shipmentId
-                GenericValue shipmentPackage = EntityUtil.getFirst(delegator.findByAnd("ShipmentPackage", UtilMisc.toMap("shipmentId",documentId)));                
-                String shipmentPackageSeqId = shipmentPackage.getString("shipmentPackageSeqId");
-                Debug.logInfo("==============shipmetPackageSeqId========= "+shipmentPackageSeqId, module);                                    
-                
-                //Code for saving the tracking code..
-                Map map = new FastMap();
-                map.put("shipmentId", documentId);
-                map.put("shipmentRouteSegmentId", shipmentRouteSegmentId);
-                map.put("shipmentPackageSeqId", shipmentPackageSeqId);
-                map.put("trackingCode", shipUnitTrackingId);
-                map.put("userLogin", userLogin);
-                Debug.logInfo("==============ShipmentPackageRouteSeg========= "+map, module);
-                result = dispatcher.runSync("createShipmentPackageRouteSeg", map);
-                Debug.logInfo("==============Here is result========= "+result, module);
-                */
-                
             } catch (Exception e) {
                 return ServiceUtil.returnError("return error"+e);
-              }
+            }
         }catch (Exception e){
             Debug.logError(e, module);
         }
-        PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));
-        writer.println("Service not Implemented");
-        writer.flush();
-        Map result = ServiceUtil.returnError("Service not Implemented");
-        return result;
+        return ServiceUtil.returnError("Service not Implemented");
         
     }
     
@@ -370,7 +345,7 @@
         } catch (Exception e) {
             return ServiceUtil.returnError("error in creating message info" + e.getMessage());
         }
-        return ServiceUtil.returnSuccess();
+        return ServiceUtil.returnSuccess("Service Completed Successfully");
     }
     
     public static Map receiveDelivery(DispatchContext dctx, Map context) {
@@ -478,6 +453,6 @@
                   Debug.logError("Error in Processing" + e.getMessage(), module);
             }
         }
-        return ServiceUtil.returnSuccess("");
+        return ServiceUtil.returnSuccess("Service Completed Successfully");
     }
 }