From 73bdebd6c224f91a50b07d711d5acf5c7cc15316 Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Thu, 26 Nov 2009 23:46:27 +0000 Subject: [PATCH] fix BOM back compatibility https://sourceforge.net/tracker/?func=detail&aid=2904737&group_id=176962&atid=879332 --- .../eevolution/model/MPPProductBOMLine.java | 23 ++++++++++++++++++- .../src/org/compiere/apps/form/VBOMDrop.java | 16 ++++++------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/base/src/org/eevolution/model/MPPProductBOMLine.java b/base/src/org/eevolution/model/MPPProductBOMLine.java index 4c88574dcf..0eeccd8e6a 100644 --- a/base/src/org/eevolution/model/MPPProductBOMLine.java +++ b/base/src/org/eevolution/model/MPPProductBOMLine.java @@ -52,7 +52,8 @@ public class MPPProductBOMLine extends X_PP_Product_BOMLine * */ private static final long serialVersionUID = -6729103151164195906L; - + MPPProductBOM m_bom = null; + /** * Default Constructor * @param ctx context @@ -96,6 +97,24 @@ public class MPPProductBOMLine extends X_PP_Product_BOMLine return new ProductLowLevelCalculator(getCtx(), get_TrxName()).getLowLevel(getM_Product_ID()); } + /** + * get Parent BOM + * @return + */ + public MPPProductBOM getParent() + { + if(m_bom == null) + { + m_bom = new MPPProductBOM (getCtx(), this.getPP_Product_BOM_ID(), get_TrxName()); + } + return m_bom; + } + + public MProduct getProduct() + { + return MProduct.get(getCtx(), getM_Product_ID()); + } + /** * Calculate Low Level of a Product * @param ID Product @@ -388,4 +407,6 @@ class ProductLowLevelCalculator tableproduct.put(M_Product_ID, PP_Product_BOM_ID); return false; } + + } diff --git a/client/src/org/compiere/apps/form/VBOMDrop.java b/client/src/org/compiere/apps/form/VBOMDrop.java index ba7f7521a0..a9cba41828 100644 --- a/client/src/org/compiere/apps/form/VBOMDrop.java +++ b/client/src/org/compiere/apps/form/VBOMDrop.java @@ -357,7 +357,7 @@ public class VBOMDrop extends CPanel addBOMLines (product, lineQty); // recursive else addDisplay (line.getM_Product_ID(), - product.getM_Product_ID(), bomType, product.getName(), lineQty); + product.getM_Product_ID(), bomType, product.getName(), line.getFeature(), lineQty); } // addBOMLine @@ -370,9 +370,9 @@ public class VBOMDrop extends CPanel * @param lineQty qty */ private void addDisplay (int parentM_Product_ID, - int M_Product_ID, String bomType, String name, BigDecimal lineQty) + int M_Product_ID, String bomType, String name, String feature , BigDecimal lineQty) { - log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty); + log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",feature=" + feature + ",Qty=" + lineQty); // boolean selected = true; if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) @@ -387,8 +387,8 @@ public class VBOMDrop extends CPanel } else if (MPPProductBOMLine.COMPONENTTYPE_Option.equals(bomType)) { - String title = Msg.getMsg(Env.getCtx(), "Optional"); - JCheckBox cb = new JCheckBox(title); + //String title = Msg.getMsg(Env.getCtx(), "Optional"); + JCheckBox cb = new JCheckBox(feature); cb.setSelected(false); selected = false; cb.addActionListener(this); @@ -397,9 +397,9 @@ public class VBOMDrop extends CPanel } else if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType)) { - String title = Msg.getMsg(Env.getCtx(), "Variant") + " " + bomType; - JRadioButton b = new JRadioButton(title); - String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType; + //String title = Msg.getMsg(Env.getCtx(), "Variant") + " " + bomType; + JRadioButton b = new JRadioButton(feature); + String groupName = feature + "_" + String.valueOf(parentM_Product_ID) + "_" + bomType; ButtonGroup group = (ButtonGroup)m_buttonGroups.get(groupName); if (group == null) {