Author: jacopoc
Date: Fri Apr 20 06:29:33 2007
New Revision: 530801
URL:
http://svn.apache.org/viewvc?view=rev&rev=530801Log:
Fix for the method that computes the requirement start date for wip based boms in the mrp.
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java?view=diff&rev=530801&r1=530800&r2=530801==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Fri Apr 20 06:29:33 2007
@@ -565,9 +565,9 @@
return productionRunId;
}
- public Timestamp getStartDate(String facilityId, Timestamp requiredBydate) {
+ public Timestamp getStartDate(String facilityId, Timestamp requiredBydate, boolean allNodes) {
Timestamp minStartDate = requiredBydate;
- if ("WIP".equals(getProduct().getString("productTypeId"))) {
+ if ("WIP".equals(getProduct().getString("productTypeId")) || allNodes) {
ProposedOrder proposedOrder = new ProposedOrder(getProduct(), facilityId, facilityId, true, requiredBydate, getQuantity());
proposedOrder.calculateStartDate(0, null, delegator, dispatcher, userLogin);
Timestamp startDate = proposedOrder.getRequirementStartDate();
@@ -575,7 +575,7 @@
for (int i = 0; i < childrenNodes.size(); i++) {
BOMNode oneChildNode = (BOMNode)childrenNodes.get(i);
if (oneChildNode != null) {
- Timestamp childStartDate = oneChildNode.getStartDate(facilityId, startDate);
+ Timestamp childStartDate = oneChildNode.getStartDate(facilityId, startDate, false);
if (childStartDate.compareTo(minStartDate) < 0) {
minStartDate = childStartDate;
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java?view=diff&rev=530801&r1=530800&r2=530801==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java Fri Apr 20 06:29:33 2007
@@ -230,7 +230,7 @@
if (isBuilt) {
try {
BOMTree tree = new BOMTree(productId, "MANUF_COMPONENT", null, BOMTree.EXPLOSION_MANUFACTURING, delegator, dispatcher, userLogin);
- requirementStartDate = tree.getRoot().getStartDate(manufacturingFacilityId, requiredByDate);
+ requirementStartDate = tree.getRoot().getStartDate(manufacturingFacilityId, requiredByDate, true);
} catch (Exception e) {
Debug.logError(e,"Error : computing the requirement start date. " + e.getMessage(), module);
}