BF1980627 BOM and Formula Info- Product lookup

This commit is contained in:
tspc 2008-06-02 06:51:01 +00:00
parent 7c2f3bb968
commit 2e6a2306ca
2 changed files with 34 additions and 32 deletions

View File

@ -767,10 +767,12 @@ public class VLookup extends JComponent
int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), m_lookup.getWindowNo(), "M_Warehouse_ID"); int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), m_lookup.getWindowNo(), "M_Warehouse_ID");
int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), m_lookup.getWindowNo(), "M_PriceList_ID"); int M_PriceList_ID = Env.getContextAsInt(Env.getCtx(), m_lookup.getWindowNo(), "M_PriceList_ID");
if(m_mField != null)
{
int AD_Table_ID = MColumn.getTable_ID(Env.getCtx(), m_mField.getAD_Column_ID(), null); int AD_Table_ID = MColumn.getTable_ID(Env.getCtx(), m_mField.getAD_Column_ID(), null);
multipleSelection = (MOrderLine.Table_ID == AD_Table_ID) || (MInvoiceLine.Table_ID == AD_Table_ID) || (MPPProductBOMLine.Table_ID == AD_Table_ID) || (MProductPrice.Table_ID == AD_Table_ID); multipleSelection = (MOrderLine.Table_ID == AD_Table_ID) || (MInvoiceLine.Table_ID == AD_Table_ID) || (MPPProductBOMLine.Table_ID == AD_Table_ID) || (MProductPrice.Table_ID == AD_Table_ID);
}
// Show Info // Show Info
InfoProduct ip = new InfoProduct (frame, true, m_lookup.getWindowNo(), InfoProduct ip = new InfoProduct (frame, true, m_lookup.getWindowNo(),
M_Warehouse_ID, M_PriceList_ID, queryValue, multipleSelection, whereClause); M_Warehouse_ID, M_PriceList_ID, queryValue, multipleSelection, whereClause);

View File

@ -29,9 +29,11 @@ import org.compiere.minigrid.MiniTable;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
import org.compiere.model.MProduct;
import org.compiere.model.MUOM; import org.compiere.model.MUOM;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
import org.compiere.model.X_C_UOM; import org.compiere.model.X_C_UOM;
import org.eevolution.model.MPPOrder;
import org.eevolution.model.X_PP_Product_BOM; import org.eevolution.model.X_PP_Product_BOM;
import org.eevolution.model.X_PP_Product_BOMLine; import org.eevolution.model.X_PP_Product_BOMLine;
import org.compiere.model.X_M_Product; import org.compiere.model.X_M_Product;
@ -44,6 +46,7 @@ import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.Language;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -61,6 +64,7 @@ import java.math.BigDecimal;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Iterator; import java.util.Iterator;
import java.util.Properties;
import java.util.Vector; import java.util.Vector;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -115,7 +119,7 @@ public class VTreeBOM extends CPanel
//private CButton bAdd = new CButton (Env.getImageIcon("StepBack24.gif")); //private CButton bAdd = new CButton (Env.getImageIcon("StepBack24.gif"));
//private CButton bDelete = new CButton (Env.getImageIcon("StepForward24.gif")); //private CButton bDelete = new CButton (Env.getImageIcon("StepForward24.gif"));
//private CButton bDeleteAll = new CButton (Env.getImageIcon("FastForward24.gif")); //private CButton bDeleteAll = new CButton (Env.getImageIcon("FastForward24.gif"));
private CCheckBox implosion = new CCheckBox (); private CCheckBox implotion = new CCheckBox ();
private CLabel treeInfo = new CLabel (); private CLabel treeInfo = new CLabel ();
// //
private JSplitPane splitPane = new JSplitPane (); private JSplitPane splitPane = new JSplitPane ();
@ -174,15 +178,15 @@ public class VTreeBOM extends CPanel
/** /**
* Fill Tree Combo * Fill Tree Combo
*/ */
private void preInit() private void preInit() throws Exception
{ {
//KeyNamePair[] trees = DB.getKeyNamePairs(MRole.getDefault().addAccessSQL( Properties ctx = Env.getCtx();
// "SELECT AD_Tree_ID, Name FROM AD_Tree WHERE TreeType NOT IN ('BB','PC') ORDER BY 2", Language language = Language.getLoginLanguage(); // Base Language
// "AD_Tree", MRole.SQL_NOTQUALIFIED, MRole.SQL_RW), false); MLookup m_fieldProduct = MLookupFactory.get(ctx, m_WindowNo,
//treeField = new CComboBox(trees); MColumn.getColumn_ID(MProduct.Table_Name, "M_Product_ID"),
MLookup m_fieldProduct = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, MColumn.getColumn_ID(X_M_Product.Table_Name,"M_Product_ID"), DisplayType.Search); DisplayType.Search, language, MProduct.COLUMNNAME_M_Product_ID, 0, false,
" IsSummary = 'N'");
fieldProduct = new VLookup ("M_Product_ID", false, false, true, m_fieldProduct); fieldProduct = new VLookup ("M_Product_ID", false, false, true, m_fieldProduct);
//fieldProduct.addVetoableChangeListener(this);
fieldProduct.addActionListener(this); fieldProduct.addActionListener(this);
loadTableBOM(); loadTableBOM();
@ -192,12 +196,8 @@ public class VTreeBOM extends CPanel
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(Msg.translate(Env.getCtx(), "BOM")); DefaultMutableTreeNode parent = new DefaultMutableTreeNode(Msg.translate(Env.getCtx(), "BOM"));
m_tree = new JTree(parent); m_tree = new JTree(parent);
splitPane.add (m_tree, JSplitPane.LEFT); splitPane.add (m_tree, JSplitPane.LEFT);
//treeField.addActionListener(this);
//
//centerTree = new VTreePanel (m_WindowNo, false, true);
//centerTree.addPropertyChangeListener(VTreePanel.NODE_SELECTION, this);
} // preInit } // preInit
@ -296,8 +296,8 @@ public class VTreeBOM extends CPanel
//labelECN.setText (Msg.translate(Env.getCtx(), "ECN")); //labelECN.setText (Msg.translate(Env.getCtx(), "ECN"));
labelProduct.setText (Msg.translate(Env.getCtx(), "M_Product_ID")); labelProduct.setText (Msg.translate(Env.getCtx(), "M_Product_ID"));
//implosion.setEnabled (false); //implotion.setEnabled (false);
implosion.setText (Msg.translate(Env.getCtx(), "Implosion")); implotion.setText (Msg.translate(Env.getCtx(), "Implosion"));
//treeInfo.setText (" "); //treeInfo.setText (" ");
//bAdd.setToolTipText("Add to Tree"); //bAdd.setToolTipText("Add to Tree");
//bAddAll.setToolTipText("Add ALL to Tree"); //bAddAll.setToolTipText("Add ALL to Tree");
@ -316,7 +316,7 @@ public class VTreeBOM extends CPanel
northPanel.add (labelProduct, null); northPanel.add (labelProduct, null);
northPanel.add (fieldProduct, null); northPanel.add (fieldProduct, null);
northPanel.add (implosion, null); northPanel.add (implotion, null);
//northPanel.add (cbAllNodes, null); //northPanel.add (cbAllNodes, null);
northPanel.add (treeInfo, null); northPanel.add (treeInfo, null);
@ -438,7 +438,7 @@ public class VTreeBOM extends CPanel
dataBOM.clear(); dataBOM.clear();
if (implosion.isSelected()) if (implotion.isSelected())
{ {
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOMLine"); QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOMLine");
String filter = "M_Product_ID=" + M_Product_ID; String filter = "M_Product_ID=" + M_Product_ID;
@ -581,7 +581,7 @@ public class VTreeBOM extends CPanel
public DefaultMutableTreeNode component(X_M_Product M_Product) public DefaultMutableTreeNode component(X_M_Product M_Product)
{ {
if (implosion.isSelected()) if (implotion.isSelected())
{ {
//vparent.setValue(m_product_id); //vparent.setValue(m_product_id);
//String data = Msg.translate(Env.getCtx(), "PP_ProductBOM_ID") + ":" + Msg.translate(Env.getCtx(), "Search Key") + ":"+ bom.getValue()+ " " + Msg.translate(Env.getCtx(), "Name") + ": " + bom.getName(); //String data = Msg.translate(Env.getCtx(), "PP_ProductBOM_ID") + ":" + Msg.translate(Env.getCtx(), "Search Key") + ":"+ bom.getValue()+ " " + Msg.translate(Env.getCtx(), "Name") + ": " + bom.getName();