You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/05/03 10:14:32 UTC
svn commit: r534751 -
/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
Author: jacopoc
Date: Thu May 3 01:14:31 2007
New Revision: 534751
URL: http://svn.apache.org/viewvc?view=rev&rev=534751
Log:
Modified the bom node's isManufactured() method to return false is there is a SupplierProduct record for the 'main' supplier.
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?view=diff&rev=534751&r1=534750&r2=534751
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Thu May 3 01:14:31 2007
@@ -621,7 +621,14 @@
}
public boolean isManufactured() {
- return childrenNodes.size() > 0;
+ List supplierProducts = null;
+ try {
+ supplierProducts = product.getRelated("SupplierProduct", UtilMisc.toMap("supplierPrefOrderId", "10_MAIN_SUPPL"), UtilMisc.toList("minimumOrderQuantity"));
+ } catch(GenericEntityException gee) {
+ Debug.logError("Problem in BOMNode.isManufactured()", module);
+ }
+ supplierProducts = EntityUtil.filterByDate(supplierProducts, UtilDateTime.nowTimestamp(), "availableFromDate", "availableThruDate", true);
+ return childrenNodes.size() > 0 && UtilValidate.isEmpty(supplierProducts);
}
public boolean isVirtual() {