vpj-cd 2009-11-26 23:46:27 +00:00
parent 48627d255e
commit 73bdebd6c2
2 changed files with 30 additions and 9 deletions

View File

@ -52,7 +52,8 @@ public class MPPProductBOMLine extends X_PP_Product_BOMLine
* *
*/ */
private static final long serialVersionUID = -6729103151164195906L; private static final long serialVersionUID = -6729103151164195906L;
MPPProductBOM m_bom = null;
/** /**
* Default Constructor * Default Constructor
* @param ctx context * @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()); 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 * Calculate Low Level of a Product
* @param ID Product * @param ID Product
@ -388,4 +407,6 @@ class ProductLowLevelCalculator
tableproduct.put(M_Product_ID, PP_Product_BOM_ID); tableproduct.put(M_Product_ID, PP_Product_BOM_ID);
return false; return false;
} }
} }

View File

@ -357,7 +357,7 @@ public class VBOMDrop extends CPanel
addBOMLines (product, lineQty); // recursive addBOMLines (product, lineQty); // recursive
else else
addDisplay (line.getM_Product_ID(), addDisplay (line.getM_Product_ID(),
product.getM_Product_ID(), bomType, product.getName(), lineQty); product.getM_Product_ID(), bomType, product.getName(), line.getFeature(), lineQty);
} // addBOMLine } // addBOMLine
@ -370,9 +370,9 @@ public class VBOMDrop extends CPanel
* @param lineQty qty * @param lineQty qty
*/ */
private void addDisplay (int parentM_Product_ID, 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; boolean selected = true;
if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType))
@ -387,8 +387,8 @@ public class VBOMDrop extends CPanel
} }
else if (MPPProductBOMLine.COMPONENTTYPE_Option.equals(bomType)) else if (MPPProductBOMLine.COMPONENTTYPE_Option.equals(bomType))
{ {
String title = Msg.getMsg(Env.getCtx(), "Optional"); //String title = Msg.getMsg(Env.getCtx(), "Optional");
JCheckBox cb = new JCheckBox(title); JCheckBox cb = new JCheckBox(feature);
cb.setSelected(false); cb.setSelected(false);
selected = false; selected = false;
cb.addActionListener(this); cb.addActionListener(this);
@ -397,9 +397,9 @@ public class VBOMDrop extends CPanel
} }
else if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType)) else if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType))
{ {
String title = Msg.getMsg(Env.getCtx(), "Variant") + " " + bomType; //String title = Msg.getMsg(Env.getCtx(), "Variant") + " " + bomType;
JRadioButton b = new JRadioButton(title); JRadioButton b = new JRadioButton(feature);
String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType; String groupName = feature + "_" + String.valueOf(parentM_Product_ID) + "_" + bomType;
ButtonGroup group = (ButtonGroup)m_buttonGroups.get(groupName); ButtonGroup group = (ButtonGroup)m_buttonGroups.get(groupName);
if (group == null) if (group == null)
{ {