Author: jacopoc
Date: Mon Mar 26 06:31:57 2007
New Revision: 522510
URL:
http://svn.apache.org/viewvc?view=rev&rev=522510Log:
Now the mrp better handes of cancelled quantities of ship groups
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?view=diff&rev=522510&r1=522509&r2=522510==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Mon Mar 26 06:31:57 2007
@@ -158,7 +158,15 @@
while (iteratorResult.hasNext()) {
genericResult = (GenericValue) iteratorResult.next();
String productId = genericResult.getString("productId");
- Double eventQuantityTmp = new Double(-1.0 * genericResult.getDouble("quantity").doubleValue());
+ Double shipGroupQuantity = genericResult.getDouble("quantity");
+ Double cancelledQuantity = genericResult.getDouble("cancelQuantity");
+ if (UtilValidate.isNotEmpty(cancelledQuantity)) {
+ shipGroupQuantity = new Double(shipGroupQuantity.doubleValue() - cancelledQuantity.doubleValue());
+ }
+ Double eventQuantityTmp = new Double(-1.0 * shipGroupQuantity.doubleValue());
+ if (eventQuantityTmp.doubleValue() == 0) {
+ continue;
+ }
// This is the order in which order dates are considered:
// OrderItemShipGroup.shipByDate
// OrderItemShipGroup.shipAfterDate