svn commit: r573406 - /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: r573406 - /ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java

jonesde
Author: jonesde
Date: Thu Sep  6 15:55:11 2007
New Revision: 573406

URL: http://svn.apache.org/viewvc?rev=573406&view=rev
Log:
Fixed issue where a quantity less than the shipment item quantity was ignored and the full shipment item quantity was used; also added comment about what to do to see if shipment is complete and should be marked shipped, if that is a good idea

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?rev=573406&r1=573405&r2=573406&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Thu Sep  6 15:55:11 2007
@@ -407,7 +407,14 @@
                                 }
                                 
                                 // just receive quantity for this ShipmentItem
-                                int quantityLeft = shipmentItem.getDouble("quantity").intValue();
+                                int quantityLeft;
+                                int shipmentItemQuantity = shipmentItem.getDouble("quantity").intValue();
+                                if (shipmentItemQuantity <= messageQuantity.intValue()) {
+                                    quantityLeft = shipmentItemQuantity;
+                                } else {
+                                    quantityLeft = messageQuantity.intValue();
+                                }
+                                
                                 
                                 Iterator serialNumberIter = serialNumberList.iterator();
                                 Iterator orderItemShipGrpInvReservationIter = orderItemShipGrpInvReservationList.iterator();
@@ -493,6 +500,12 @@
                 }
                 
                 if (errorMapList.size() == 0) {
+                    // TODOLATER: to support mulitple and partial Show Shipment messages per shipment:
+                    //check here if the entire shipment has been issues, ie there should be sufficient
+                    //ItemIssuance quantities for the ShipmentItem quantities
+                    // NOTE ON THIS DEJ20070906: this is actually really bad because it implies the shipment
+                    //has been split and that isn't really allowed; maybe better to return an error!
+                    // TODO: if shipment is not completely fulfilled here return an error
                     Map resultMap = dispatcher.runSync("setShipmentStatusPackedAndShipped", UtilMisc.toMap("shipmentId", shipmentId, "userLogin", userLogin));              
                     if (ServiceUtil.isError(resultMap)) {
                         String errMsg = ServiceUtil.getErrorMessage(resultMap);