Author: mor
Date: Wed Jul 29 09:59:17 2009
New Revision: 798831
URL: http://svn.apache.org/viewvc?rev=798831&view=rev
Log:
User can only verify and weigh approved items. Items in any other status will
not show up on Verify Pick screen and Packing (Weigh Package Only) Screen.
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java
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/actions/shipment/VerifyPick.groovy
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=798831&r1=798830&r2=798831&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
Wed Jul 29 09:59:17 2009
@@ -347,7 +347,7 @@
BigDecimal verifiedQty = ZERO;
BigDecimal orderedQty = ZERO;
- List<GenericValue> orderItems =
this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
+ List<GenericValue> orderItems =
this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId,
"statusId", "ITEM_APPROVED"));
for (GenericValue orderItem : orderItems) {
orderedQty = orderedQty.add(orderItem.getBigDecimal("quantity"));
}
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=798831&r1=798830&r2=798831&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 Jul 29 09:59:17 2009
@@ -64,7 +64,7 @@
}
try {
// Checked no of packages, it should not be greater than ordered
quantity
- List<GenericValue> orderItems = delegator.findByAnd("OrderItem",
UtilMisc.toMap("orderId", orderId));
+ List<GenericValue> orderItems = delegator.findByAnd("OrderItem",
UtilMisc.toMap("orderId", orderId, "statusId", "ITEM_APPROVED"));
BigDecimal orderedItemQty = ZERO;
for (GenericValue orderItem : orderItems) {
orderedItemQty =
orderedItemQty.add(orderItem.getBigDecimal("quantity"));
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=798831&r1=798830&r2=798831&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 Jul 29 09:59:17 2009
@@ -436,7 +436,7 @@
packedLine.setShipmentItemSeqId(shipmentItem.getString("shipmentItemSeqId"));
}
}
- List<GenericValue> orderItems =
this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
+ List<GenericValue> orderItems =
this.getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId,
"statusId", "ITEM_APPROVED"));
for (GenericValue orderItem : orderItems) {
List<GenericValue> orderItemShipGrpInvReserves =
orderItem.getRelated("OrderItemShipGrpInvRes");
if (UtilValidate.isEmpty(orderItemShipGrpInvReserves)) {
@@ -537,7 +537,7 @@
protected Integer getOrderedQuantity(String orderId) {
BigDecimal orderedQuantity = ZERO;
try {
- List<GenericValue> orderItems =
getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
+ List<GenericValue> orderItems =
getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId,
"statusId", "ITEM_APPROVED"));
for (GenericValue orderItem : orderItems) {
orderedQuantity =
orderedQuantity.add(orderItem.getBigDecimal("quantity"));
}
Modified:
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy?rev=798831&r1=798830&r2=798831&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
(original)
+++
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy
Wed Jul 29 09:59:17 2009
@@ -22,6 +22,8 @@
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.order.order.OrderReadHelper;
import org.ofbiz.shipment.verify.VerifyPickSession;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.entity.condition.EntityOperator;
verifyPickSession = session.getAttribute("verifyPickSession");
if (!verifyPickSession) {
@@ -87,9 +89,11 @@
context.orderId = orderId;
context.orderHeader = orderHeader;
context.orderReadHelper = orh;
+
orderItemShipGroup = orh.getOrderItemShipGroup(shipGroupSeqId);
context.orderItemShipGroup = orderItemShipGroup;
- orderItems = orh.getOrderItems();
+ List exprs = UtilMisc.toList(EntityCondition.makeCondition("statusId",
EntityOperator.EQUALS, "ITEM_APPROVED"));
+ orderItems = orh.getOrderItemsByCondition(exprs);
context.orderItems = orderItems;
if ("ORDER_APPROVED".equals(orderHeader.statusId)) {
context.isOrderStatusApproved = true;