Author: sichen
Date: Tue Oct 16 10:00:54 2007
New Revision: 585198
URL:
http://svn.apache.org/viewvc?rev=585198&view=revLog:
Allow a negative scrap factor to function like a salvage factor in BOMs
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.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?rev=585198&r1=585197&r2=585198&view=diff==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Tue Oct 16 10:00:54 2007
@@ -205,9 +205,12 @@
}
try {
double percScrapFactor = node.getDouble("scrapFactor").doubleValue();
- if (percScrapFactor >= 0 && percScrapFactor < 100) {
+
+ // A negative scrap factor is a salvage factor
+ if (percScrapFactor > -100 && percScrapFactor < 100) {
percScrapFactor = 1 + percScrapFactor / 100;
} else {
+ Debug.logWarning("A scrap factor of [" + percScrapFactor + "] was ignored", module);
percScrapFactor = 1;
}
oneChildNode.setScrapFactor(percScrapFactor);