public DefaultMutableTreeNode parent(MPPProductBOMLine bomline)
{
log.info("Parent(bomline) " );
//System.out.println("-------------------------Parent:" + bom.getName());
MProduct M_Product = MProduct.get(getCtx(), bomline.getM_Product_ID());
MPPProductBOM bomproduct = new MPPProductBOM(getCtx(), bomline.getPP_Product_BOM_ID(), null);
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(productSummary(M_Product, false));
Vector<Object> line = new Vector<Object>(17);
line.add( new Boolean(false)); // 0 Select
line.add( new Boolean(true)); // 1 IsActive
line.add( new Integer(bomline.getLine())); // 2 Line
line.add( (Timestamp) bomline.getValidFrom()); // 3 ValidDrom
line.add( (Timestamp) bomline.getValidTo()); // 4 ValidTo
KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(),M_Product.getName());
line.add(pp); // 5 M_Product_ID
KeyNamePair uom = new KeyNamePair(bomline.getC_UOM_ID(),bomline.getC_UOM().getUOMSymbol());
line.add(uom); // 6 C_UOM_ID
line.add(new Boolean(bomline.isQtyPercentage())); // 7 IsQtyPorcentage
line.add((BigDecimal) bomline.getQtyBatch()); // 8 BatchPercent
line.add((BigDecimal) ((bomline.getQtyBOM()!=null) ? bomline.getQtyBOM() : new BigDecimal(0))); // 9 QtyBOM
line.add(new Boolean(bomline.isCritical())); // 10 IsCritical
line.add( (Integer) bomline.getLeadTimeOffset()); // 11 LTOffSet
line.add( (BigDecimal) bomline.getAssay()); // 12 Assay
line.add( (BigDecimal) (bomline.getScrap())); // 13 Scrap
line.add( (String) bomline.getIssueMethod()); // 14 IssueMethod
line.add( (String) bomline.getBackflushGroup()); // 15 BackflushGroup
line.add( (BigDecimal) bomline.getForecast()); // 16 Forecast
/*CHANGES START HERE DOMINIC TARR 20081110*/
MCost cost = getCostForBomLine(bomline);
line.add( (BigDecimal) cost.getCurrentCostPrice()); //17 standard cost ***
line.add( (BigDecimal) cost.getCurrentCostPriceLL()); //18 rolled up cost ***
line.add( (BigDecimal) cost.getFutureCostPrice()); //19 future cost ***
line.add( (BigDecimal.ZERO)); //20 standard cost ***
line.add( (BigDecimal.ZERO)); //21 rolled up cost ***
line.add( (BigDecimal.ZERO)); //22 future cost ***
/*CHANGES END HERE DOMINIC TARR 20081110*/
dataBOM.add(line);
for (MPPProductBOM bom : getBOMs(bomproduct.getM_Product_ID(), false))
{
MProduct component = MProduct.get(getCtx(), bom.getM_Product_ID());
return component(component, BigDecimal.ONE);
}
return parent;