Author: jleroux
Date: Sat Jan 14 07:33:13 2012
New Revision: 1231445
URL:
http://svn.apache.org/viewvc?rev=1231445&view=revLog:
A patch from Ankit Jain
https://issues.apache.org/jira/browse/OFBIZ-OFBIZ-4629 "The Status of PicklistItem never changes from PICKITEM_PENDING to PICKITEM_COMPLETED."
Whenever a order is verified picked the status of Picklistitem never changes to "PICKITEM_COMPLETED", even if the order is completed the status always remain as "PICKITEM_PENDING". I think when a PiclistItem is verified the status should change to "PICKITEM_COMPLETED".
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java?rev=1231445&r1=1231444&r2=1231445&view=diff==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java Sat Jan 14 07:33:13 2012
@@ -307,6 +307,21 @@ public class VerifyPickSession implement
this.issueItemsToShipment(shipmentId, locale);
this.updateProduct();
+ // Set PicklistItem to Complete
+ List<GenericValue> picklistItems = this.getDelegator().findByAnd("PicklistItem", UtilMisc.toMap("orderId", orderId));
+ for (GenericValue item : picklistItems) {
+ Map<String, Object> setPicklistItemToCompleteCtx = FastMap.newInstance();
+ setPicklistItemToCompleteCtx.put("picklistBinId", item.get("picklistBinId"));
+ setPicklistItemToCompleteCtx.put("orderId", orderId);
+ setPicklistItemToCompleteCtx.put("orderItemSeqId", item.get("orderItemSeqId"));
+ setPicklistItemToCompleteCtx.put("shipGroupSeqId", item.get("shipGroupSeqId"));
+ setPicklistItemToCompleteCtx.put("inventoryItemId", item.get("inventoryItemId"));
+ setPicklistItemToCompleteCtx.put("quantity", item.get("quantity"));
+ setPicklistItemToCompleteCtx.put("itemStatusId", "PICKITEM_COMPLETED");
+ setPicklistItemToCompleteCtx.put("userLogin", this.getUserLogin());
+ this.getDispatcher().runSync("setPicklistItemToComplete", setPicklistItemToCompleteCtx);
+ }
+
// Update the shipment status to Picked, this will trigger createInvoicesFromShipment and finally a invoice will be created
Map<String, Object> updateShipmentCtx = FastMap.newInstance();
updateShipmentCtx.put("shipmentId", shipmentId);