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;
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;
}
}

View File

@ -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)
{