svn commit: r562659 - /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

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

svn commit: r562659 - /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

apatel-2
Author: apatel
Date: Fri Aug  3 21:57:06 2007
New Revision: 562659

URL: http://svn.apache.org/viewvc?view=rev&rev=562659
Log:
little clean up as In ofbiz we expect one serial number per InventoryItem.

Modified:
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

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=562659&r1=562658&r2=562659
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Fri Aug  3 21:57:06 2007
@@ -211,8 +211,7 @@
                                 requireInventory = "N";
                             }                    
                             GenericValue orderItemShipGrpInvReservation = EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGrpInvRes", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId,"shipGroupSeqId",shipGroupSeqId)));              
-                            Map isitspastCtx = FastMap.newInstance();
-                            isitspastCtx = UtilMisc.toMap("orderId", orderId, "shipGroupSeqId", shipGroupSeqId, "orderItemSeqId", orderItemSeqId, "quantity", orderItemShipGrpInvReservation.get("quantity"), "quantityNotReserved", orderItemShipGrpInvReservation.get("quantity"));                
+                            Map isitspastCtx = UtilMisc.toMap("orderId", orderId, "shipGroupSeqId", shipGroupSeqId, "orderItemSeqId", orderItemSeqId, "quantity", orderItemShipGrpInvReservation.get("quantity"), "quantityNotReserved", orderItemShipGrpInvReservation.get("quantity"));                
                             isitspastCtx.put("productId", productId);
                             isitspastCtx.put("reservedDatetime", orderItemShipGrpInvReservation.get("reservedDatetime"));
                             isitspastCtx.put("requireInventory", requireInventory);
@@ -225,11 +224,8 @@
                             isitspastCtx.put("shipmentId", shipmentId);      
                             isitspastCtx.put("shipmentPackageSeqId", shipmentPackageSeqId);
                             isitspastCtx.put("promisedDatetime", orderItemShipGrpInvReservation.get("promisedDatetime"));                    
-                            List invDetailElementList = UtilXml.childElementList(invItemElement, "ns:INVDETAIL"); //n                            
-                            if(UtilValidate.isNotEmpty(invDetailElementList)) {
-                                Iterator invDetailElementItr = invDetailElementList.iterator();
-                                while(invDetailElementItr.hasNext()) {
-                                    Element invDetailElement = (Element) invDetailElementItr.next();
+                            Element invDetailElement = UtilXml.firstChildElement(invItemElement, "ns:INVDETAIL"); //n                            
+                            if(UtilValidate.isNotEmpty(invDetailElement)) {
                                     String serialNumber = UtilXml.childElementValue(invDetailElement, "os:SERIALNUM"); // os                                                                                  
                                     isitspastCtx.put("serialNumber", serialNumber);                                        
                                     isitspastCtx.remove("itemIssuanceId");                            
@@ -245,7 +241,6 @@
                                         String errMsg = "Error executing issueSerializedInvToShipmentPackageAndSetTracking Service: "+e.toString();
                                         errorMapList.add(UtilMisc.toMap("description", errMsg, "reasonCode", "GenericServiceException"));
                                     }
-                                }
                             } else {
                                 try {//TODO: I think this else part is for NON Serialized Inv item. So it will be different service that we need to call here.                    
                                     Map resultMap = dispatcher.runSync("issueSerializedInvToShipmentPackageAndSetTracking", isitspastCtx);