private void statInit(){
  labelValue.setText(Msg.getMsg(Env.getCtx(),"Value"));
  fieldValue.setBackground(AdempierePLAF.getInfoBackground());
  fieldValue.addActionListener(this);
  labelName.setText(Msg.getMsg(Env.getCtx(),"Name"));
  fieldName.setBackground(AdempierePLAF.getInfoBackground());
  fieldName.addActionListener(this);
  labelUPC.setText(Msg.translate(Env.getCtx(),"UPC"));
  fieldUPC.setBackground(AdempierePLAF.getInfoBackground());
  fieldUPC.addActionListener(this);
  labelSKU.setText(Msg.translate(Env.getCtx(),"SKU"));
  fieldSKU.setBackground(AdempierePLAF.getInfoBackground());
  fieldSKU.addActionListener(this);
  labelWarehouse.setText(Msg.getMsg(Env.getCtx(),"Warehouse"));
  fWarehouse_ID=new VLookup("M_Warehouse_ID",false,false,true,MLookupFactory.get(Env.getCtx(),p_WindowNo,0,MColumn.getColumn_ID(MWarehouse.Table_Name,MWarehouse.COLUMNNAME_M_Warehouse_ID),DisplayType.TableDir));
  fWarehouse_ID.setBackground(AdempierePLAF.getInfoBackground());
  fWarehouse_ID.addActionListener(this);
  checkOnlyStock.setText(Msg.getMsg(Env.getCtx(),"OnlyStock"));
  checkOnlyStock.setName("OnlyStock");
  checkOnlyStock.setToolTipText(Msg.getMsg(Env.getCtx(),"OnlyStockTip"));
  checkOnlyStock.setSelected(false);
  checkOnlyStock.addActionListener(this);
  checkShowDetail.setText(Msg.getMsg(Env.getCtx(),"ShowDetail"));
  checkShowDetail.setName("ShowDetail");
  checkShowDetail.setToolTipText(Msg.getMsg(Env.getCtx(),"ShowAttributeDetails"));
  checkShowDetail.setSelected(false);
  checkShowDetail.setEnabled(false);
  checkShowDetail.addActionListener(this);
  checkAND.setText(Msg.getMsg(Env.getCtx(),"SearchAND"));
  checkAND.setName("SearchAND");
  checkAND.setToolTipText(Msg.getMsg(Env.getCtx(),"SearchANDInfo"));
  checkAND.setSelected(true);
  checkAND.addActionListener(this);
  labelPriceList.setText(Msg.getMsg(Env.getCtx(),"PriceListVersion"));
  fPriceList_ID=new VLookup("M_PriceList_Version_ID",false,false,true,MLookupFactory.get(Env.getCtx(),p_WindowNo,0,MColumn.getColumn_ID(MPriceListVersion.Table_Name,MPriceListVersion.COLUMNNAME_M_PriceList_Version_ID),DisplayType.TableDir));
  fPriceList_ID.setBackground(AdempierePLAF.getInfoBackground());
  fPriceList_ID.addActionListener(this);
  labelProductCategory.setText(Msg.translate(Env.getCtx(),"M_Product_Category_ID"));
  fProductCategory_ID=new VLookup("M_Product_Category_ID",false,false,true,MLookupFactory.get(Env.getCtx(),p_WindowNo,0,MColumn.getColumn_ID(MProductCategory.Table_Name,MProductCategory.COLUMNNAME_M_Product_Category_ID),DisplayType.TableDir));
  fProductCategory_ID.setBackground(AdempierePLAF.getInfoBackground());
  fProductCategory_ID.addActionListener(this);
  labelAS.setText(Msg.translate(Env.getCtx(),"M_AttributeSet_ID"));
  fAS_ID=new VLookup("M_AttributeSet_ID",false,false,true,MLookupFactory.get(Env.getCtx(),p_WindowNo,0,MColumn.getColumn_ID(MAttributeSet.Table_Name,MAttributeSet.COLUMNNAME_M_AttributeSet_ID),DisplayType.TableDir));
  fAS_ID.setBackground(AdempierePLAF.getInfoBackground());
  fAS_ID.addActionListener(this);
  labelASI.setText(Msg.translate(Env.getCtx(),"M_AttributeSetInstance_ID"));
  MPAttributeLookup mpaLookup=new MPAttributeLookup(Env.getCtx(),p_WindowNo);
  fASI_ID=new VPAttribute((GridTab)null,false,false,true,p_WindowNo,mpaLookup,true);
  fASI_ID.setBackground(AdempierePLAF.getInfoBackground());
  fASI_ID.addActionListener(this);
  labelVendor.setText(Msg.translate(Env.getCtx(),"Vendor"));
  fVendor_ID=new VLookup("C_BPartner_ID",false,false,true,MLookupFactory.get(Env.getCtx(),p_WindowNo,0,MColumn.getColumn_ID(MProductPO.Table_Name,MProductPO.COLUMNNAME_C_BPartner_ID),DisplayType.Search));
  fVendor_ID.setBackground(AdempierePLAF.getInfoBackground());
  fVendor_ID.addActionListener(this);
  fVendor_ID.setIsSOTrx(true,false);
  p_criteriaGrid.add(labelValue,new ALayoutConstraint(0,0));
  p_criteriaGrid.add(fieldValue,null);
  p_criteriaGrid.add(labelWarehouse,null);
  p_criteriaGrid.add(fWarehouse_ID,null);
  p_criteriaGrid.add(checkOnlyStock,new ALayoutConstraint(0,5));
  p_criteriaGrid.add(labelName,new ALayoutConstraint(1,0));
  p_criteriaGrid.add(fieldName,null);
  p_criteriaGrid.add(labelPriceList,null);
  p_criteriaGrid.add(fPriceList_ID,null);
  p_criteriaGrid.add(labelAS,null);
  p_criteriaGrid.add(fAS_ID,null);
  p_criteriaGrid.add(labelUPC,new ALayoutConstraint(2,0));
  p_criteriaGrid.add(fieldUPC,null);
  p_criteriaGrid.add(labelProductCategory,null);
  p_criteriaGrid.add(fProductCategory_ID,null);
  p_criteriaGrid.add(labelASI,null);
  p_criteriaGrid.add(fASI_ID,null);
  p_criteriaGrid.add(labelSKU,new ALayoutConstraint(3,0));
  p_criteriaGrid.add(fieldSKU,null);
  p_criteriaGrid.add(labelVendor,null);
  p_criteriaGrid.add(fVendor_ID,null);
  p_criteriaGrid.add(checkAND,new ALayoutConstraint(3,5));
  m_PAttributeButton=ConfirmPanel.createPAttributeButton(true);
  confirmPanel.addButton(m_PAttributeButton);
  m_PAttributeButton.addActionListener(this);
  m_PAttributeButton.setEnabled(false);
  fieldDescription.setBackground(AdempierePLAF.getInfoBackground());
  fieldDescription.setEditable(false);
  fieldDescription.setPreferredSize(new Dimension(INFO_WIDTH - 100,100));
  fieldPAttributes.setBackground(AdempierePLAF.getInfoBackground());
  fieldPAttributes.setEditable(false);
  fieldPAttributes.setPreferredSize(new Dimension(INFO_WIDTH - 100,100));
  ColumnInfo[] s_layoutWarehouse=new ColumnInfo[]{new ColumnInfo(" ","M_Warehouse_ID",IDColumn.class),new ColumnInfo(Msg.translate(Env.getCtx(),"WarehouseName"),"WarehouseName",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyAvailable"),"sum(QtyAvailable)",Double.class,true,true,null),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyOnHand"),"sum(QtyOnHand)",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyReserved"),"sum(QtyReserved)",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyOrdered"),"sum(QtyOrdered)",Double.class)};
  String s_sqlFrom=" M_PRODUCT_STOCK_V ";
  String s_sqlWhere="(QtyOnHand <> 0 OR QtyAvailable <> 0 OR QtyReserved <> 0 OR QtyOrdered <> 0) AND M_Product_ID = ?";
  m_sqlWarehouse=warehouseTbl.prepareTable(s_layoutWarehouse,s_sqlFrom,s_sqlWhere,false,"M_PRODUCT_STOCK_V");
  m_sqlWarehouse+=" Group By M_Warehouse_ID, WarehouseName ";
  m_sqlWarehouse+=" Order By sum(QtyOnHand) DESC, WarehouseName ";
  warehouseTbl.setRowSelectionAllowed(true);
  warehouseTbl.setMultiSelection(false);
  warehouseTbl.addMouseListener(this);
  warehouseTbl.setShowTotals(true);
  warehouseTbl.autoSize();
  ColumnInfo[] s_layoutSubstitute=new ColumnInfo[]{new ColumnInfo(Msg.translate(Env.getCtx(),"Warehouse"),"orgname",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Description"),"description",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Value"),"value",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Name"),"Name",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyAvailable"),"QtyAvailable",Double.class,true,true,null),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyOnHand"),"QtyOnHand",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyReserved"),"QtyReserved",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"PriceStd"),"PriceStd",Double.class)};
  s_sqlFrom="M_PRODUCT_SUBSTITUTERELATED_V";
  s_sqlWhere="M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'";
  m_sqlSubstitute=substituteTbl.prepareTable(s_layoutSubstitute,s_sqlFrom,s_sqlWhere,false,"M_PRODUCT_SUBSTITUTERELATED_V");
  substituteTbl.setRowSelectionAllowed(false);
  substituteTbl.setMultiSelection(false);
  substituteTbl.addMouseListener(this);
  substituteTbl.setShowTotals(false);
  substituteTbl.autoSize();
  ColumnInfo[] s_layoutRelated=new ColumnInfo[]{new ColumnInfo(Msg.translate(Env.getCtx(),"Warehouse"),"orgname",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Description"),"description",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Value"),"value",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Name"),"Name",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyAvailable"),"QtyAvailable",Double.class,true,true,null),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyOnHand"),"QtyOnHand",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"QtyReserved"),"QtyReserved",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"PriceStd"),"PriceStd",Double.class)};
  s_sqlFrom="M_PRODUCT_SUBSTITUTERELATED_V";
  s_sqlWhere="M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'";
  m_sqlRelated=relatedTbl.prepareTable(s_layoutRelated,s_sqlFrom,s_sqlWhere,false,"M_PRODUCT_SUBSTITUTERELATED_V");
  relatedTbl.setRowSelectionAllowed(false);
  relatedTbl.setMultiSelection(false);
  relatedTbl.addMouseListener(this);
  relatedTbl.setShowTotals(false);
  relatedTbl.autoSize();
  initAtpTab();
  m_tableAtp.setRowSelectionAllowed(false);
  m_tableAtp.setMultiSelection(false);
  ColumnInfo[] s_layoutVendor=new ColumnInfo[]{new ColumnInfo(Msg.translate(Env.getCtx(),"Vendor"),"(SELECT bp.Name FROM C_BPartner bp WHERE bp.C_BPartner_ID = M_PRODUCT_PO.C_BPartner_ID)",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"IsCurrentVendor"),"IsCurrentVendor",Boolean.class),new ColumnInfo(Msg.translate(Env.getCtx(),"C_UOM_ID"),"(SELECT Name FROM C_UOM WHERE C_UOM_ID = M_PRODUCT_PO.C_UOM_ID)",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"C_Currency_ID"),"(SELECT iso_code FROM C_Currency WHERE C_Currency_ID = M_PRODUCT_PO.C_Currency_ID)",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"PriceList"),"PriceList",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"PricePO"),"PricePO",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"VendorProductNo"),"VendorProductNo",String.class),new ColumnInfo(Msg.translate(Env.getCtx(),"Order_Min"),"Order_Min",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"DeliveryTime_Promised"),"DeliveryTime_Promised",Double.class),new ColumnInfo(Msg.translate(Env.getCtx(),"DeliveryTime_Actual"),"DeliveryTime_Actual",Double.class)};
  s_sqlFrom="M_PRODUCT_PO";
  s_sqlWhere="M_Product_ID = ?";
  m_sqlVendor=vendorTbl.prepareTable(s_layoutVendor,s_sqlFrom,s_sqlWhere,false,"M_PRODUCT_PO");
  vendorTbl.setRowSelectionAllowed(false);
  vendorTbl.setMultiSelection(false);
  vendorTbl.addMouseListener(this);
  vendorTbl.setShowTotals(false);
  vendorTbl.autoSize();
  jTab.addTab(Msg.translate(Env.getCtx(),"Warehouse"),new JScrollPane(warehouseTbl));
  jTab.setPreferredSize(new Dimension(INFO_WIDTH,SCREEN_HEIGHT > 600 ? 250 : 105));
  jTab.addTab(Msg.translate(Env.getCtx(),"Description"),new JScrollPane(fieldDescription));
  jTab.addTab(Msg.translate(Env.getCtx(),"ProductAttribute"),new JScrollPane(fieldPAttributes));
  jTab.addTab(Msg.translate(Env.getCtx(),"Substitute_ID"),new JScrollPane(substituteTbl));
  jTab.addTab(Msg.translate(Env.getCtx(),"RelatedProduct_ID"),new JScrollPane(relatedTbl));
  jTab.addTab(Msg.getMsg(Env.getCtx(),"ATP"),new JScrollPane(m_tableAtp));
  jTab.addTab(Msg.translate(Env.getCtx(),"Vendor"),new JScrollPane(vendorTbl));
  jTab.addChangeListener(this);
  tablePanel.setPreferredSize(new Dimension(INFO_WIDTH,SCREEN_HEIGHT > 600 ? 255 : 110));
  tablePanel.setLayout(new BorderLayout());
  tablePanel.add(jTab,BorderLayout.CENTER);
  p_detailTaskPane.setTitle(Msg.translate(Env.getCtx(),"WarehouseStock"));
  p_detailTaskPane.add(checkShowDetail,BorderLayout.NORTH);
  p_detailTaskPane.add(tablePanel,BorderLayout.CENTER);
  p_detailTaskPane.setVisible(true);
}

private void statInit ( ) { labelValue . setText ( Msg . getMsg ( Env . getCtx ( ) , "Value" ) ) ; fieldValue . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldValue . addActionListener ( this ) ; labelName . setText ( Msg . getMsg ( Env . getCtx ( ) , "Name" ) ) ; fieldName . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldName . addActionListener ( this ) ; labelUPC . setText ( Msg . translate ( Env . getCtx ( ) , "UPC" ) ) ; fieldUPC . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldUPC . addActionListener ( this ) ; labelSKU . setText ( Msg . translate ( Env . getCtx ( ) , "SKU" ) ) ; fieldSKU . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldSKU . addActionListener ( this ) ; labelWarehouse . setText ( Msg . getMsg ( Env . getCtx ( ) , "Warehouse" ) ) ; fWarehouse_ID = new VLookup ( "M_Warehouse_ID" , false , false , true , MLookupFactory . get ( Env . getCtx ( ) , p_WindowNo , 0 , MColumn . getColumn_ID ( MWarehouse . Table_Name , MWarehouse . COLUMNNAME_M_Warehouse_ID ) , DisplayType . TableDir ) ) ; fWarehouse_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fWarehouse_ID . addActionListener ( this ) ; checkOnlyStock . setText ( Msg . getMsg ( Env . getCtx ( ) , "OnlyStock" ) ) ; checkOnlyStock . setName ( "OnlyStock" ) ; checkOnlyStock . setToolTipText ( Msg . getMsg ( Env . getCtx ( ) , "OnlyStockTip" ) ) ; checkOnlyStock . setSelected ( false ) ; checkOnlyStock . addActionListener ( this ) ; checkShowDetail . setText ( Msg . getMsg ( Env . getCtx ( ) , "ShowDetail" ) ) ; checkShowDetail . setName ( "ShowDetail" ) ; checkShowDetail . setToolTipText ( Msg . getMsg ( Env . getCtx ( ) , "ShowAttributeDetails" ) ) ; checkShowDetail . setSelected ( false ) ; checkShowDetail . setEnabled ( false ) ; checkShowDetail . addActionListener ( this ) ; checkAND . setText ( Msg . getMsg ( Env . getCtx ( ) , "SearchAND" ) ) ; checkAND . setName ( "SearchAND" ) ; checkAND . setToolTipText ( Msg . getMsg ( Env . getCtx ( ) , "SearchANDInfo" ) ) ; checkAND . setSelected ( true ) ; checkAND . addActionListener ( this ) ; labelPriceList . setText ( Msg . getMsg ( Env . getCtx ( ) , "PriceListVersion" ) ) ; fPriceList_ID = new VLookup ( "M_PriceList_Version_ID" , false , false , true , MLookupFactory . get ( Env . getCtx ( ) , p_WindowNo , 0 , MColumn . getColumn_ID ( MPriceListVersion . Table_Name , MPriceListVersion . COLUMNNAME_M_PriceList_Version_ID ) , DisplayType . TableDir ) ) ; fPriceList_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fPriceList_ID . addActionListener ( this ) ; labelProductCategory . setText ( Msg . translate ( Env . getCtx ( ) , "M_Product_Category_ID" ) ) ; fProductCategory_ID = new VLookup ( "M_Product_Category_ID" , false , false , true , MLookupFactory . get ( Env . getCtx ( ) , p_WindowNo , 0 , MColumn . getColumn_ID ( MProductCategory . Table_Name , MProductCategory . COLUMNNAME_M_Product_Category_ID ) , DisplayType . TableDir ) ) ; fProductCategory_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fProductCategory_ID . addActionListener ( this ) ; labelAS . setText ( Msg . translate ( Env . getCtx ( ) , "M_AttributeSet_ID" ) ) ; fAS_ID = new VLookup ( "M_AttributeSet_ID" , false , false , true , MLookupFactory . get ( Env . getCtx ( ) , p_WindowNo , 0 , MColumn . getColumn_ID ( MAttributeSet . Table_Name , MAttributeSet . COLUMNNAME_M_AttributeSet_ID ) , DisplayType . TableDir ) ) ; fAS_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fAS_ID . addActionListener ( this ) ; labelASI . setText ( Msg . translate ( Env . getCtx ( ) , "M_AttributeSetInstance_ID" ) ) ; MPAttributeLookup mpaLookup = new MPAttributeLookup ( Env . getCtx ( ) , p_WindowNo ) ; fASI_ID = new VPAttribute ( ( GridTab ) null , false , false , true , p_WindowNo , mpaLookup , true ) ; fASI_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fASI_ID . addActionListener ( this ) ; labelVendor . setText ( Msg . translate ( Env . getCtx ( ) , "Vendor" ) ) ; fVendor_ID = new VLookup ( "C_BPartner_ID" , false , false , true , MLookupFactory . get ( Env . getCtx ( ) , p_WindowNo , 0 , MColumn . getColumn_ID ( MProductPO . Table_Name , MProductPO . COLUMNNAME_C_BPartner_ID ) , DisplayType . Search ) ) ; fVendor_ID . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fVendor_ID . addActionListener ( this ) ; fVendor_ID . setIsSOTrx ( true , false ) ; p_criteriaGrid . add ( labelValue , new ALayoutConstraint ( 0 , 0 ) ) ; p_criteriaGrid . add ( fieldValue , null ) ; p_criteriaGrid . add ( labelWarehouse , null ) ; p_criteriaGrid . add ( fWarehouse_ID , null ) ; p_criteriaGrid . add ( checkOnlyStock , new ALayoutConstraint ( 0 , 5 ) ) ; p_criteriaGrid . add ( labelName , new ALayoutConstraint ( 1 , 0 ) ) ; p_criteriaGrid . add ( fieldName , null ) ; p_criteriaGrid . add ( labelPriceList , null ) ; p_criteriaGrid . add ( fPriceList_ID , null ) ; p_criteriaGrid . add ( labelAS , null ) ; p_criteriaGrid . add ( fAS_ID , null ) ; p_criteriaGrid . add ( labelUPC , new ALayoutConstraint ( 2 , 0 ) ) ; p_criteriaGrid . add ( fieldUPC , null ) ; p_criteriaGrid . add ( labelProductCategory , null ) ; p_criteriaGrid . add ( fProductCategory_ID , null ) ; p_criteriaGrid . add ( labelASI , null ) ; p_criteriaGrid . add ( fASI_ID , null ) ; p_criteriaGrid . add ( labelSKU , new ALayoutConstraint ( 3 , 0 ) ) ; p_criteriaGrid . add ( fieldSKU , null ) ; p_criteriaGrid . add ( labelVendor , null ) ; p_criteriaGrid . add ( fVendor_ID , null ) ; p_criteriaGrid . add ( checkAND , new ALayoutConstraint ( 3 , 5 ) ) ; m_PAttributeButton = ConfirmPanel . createPAttributeButton ( true ) ; confirmPanel . addButton ( m_PAttributeButton ) ; m_PAttributeButton . addActionListener ( this ) ; m_PAttributeButton . setEnabled ( false ) ; fieldDescription . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldDescription . setEditable ( false ) ; fieldDescription . setPreferredSize ( new Dimension ( INFO_WIDTH - 100 , 100 ) ) ; fieldPAttributes . setBackground ( AdempierePLAF . getInfoBackground ( ) ) ; fieldPAttributes . setEditable ( false ) ; fieldPAttributes . setPreferredSize ( new Dimension ( INFO_WIDTH - 100 , 100 ) ) ; ColumnInfo [ ] s_layoutWarehouse = new ColumnInfo [ ] { new ColumnInfo ( " " , "M_Warehouse_ID" , IDColumn . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "WarehouseName" ) , "WarehouseName" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyAvailable" ) , "sum(QtyAvailable)" , Double . class , true , true , null ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyOnHand" ) , "sum(QtyOnHand)" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyReserved" ) , "sum(QtyReserved)" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyOrdered" ) , "sum(QtyOrdered)" , Double . class ) } ; String s_sqlFrom = " M_PRODUCT_STOCK_V " ; String s_sqlWhere = "(QtyOnHand <> 0 OR QtyAvailable <> 0 OR QtyReserved <> 0 OR QtyOrdered <> 0) AND M_Product_ID = ?" ; m_sqlWarehouse = warehouseTbl . prepareTable ( s_layoutWarehouse , s_sqlFrom , s_sqlWhere , false , "M_PRODUCT_STOCK_V" ) ; m_sqlWarehouse += " Group By M_Warehouse_ID, WarehouseName " ; m_sqlWarehouse += " Order By sum(QtyOnHand) DESC, WarehouseName " ; warehouseTbl . setRowSelectionAllowed ( true ) ; warehouseTbl . setMultiSelection ( false ) ; warehouseTbl . addMouseListener ( this ) ; warehouseTbl . setShowTotals ( true ) ; warehouseTbl . autoSize ( ) ; ColumnInfo [ ] s_layoutSubstitute = new ColumnInfo [ ] { new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Warehouse" ) , "orgname" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Description" ) , "description" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Value" ) , "value" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Name" ) , "Name" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyAvailable" ) , "QtyAvailable" , Double . class , true , true , null ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyOnHand" ) , "QtyOnHand" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyReserved" ) , "QtyReserved" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "PriceStd" ) , "PriceStd" , Double . class ) } ; s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V" ; s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'" ; m_sqlSubstitute = substituteTbl . prepareTable ( s_layoutSubstitute , s_sqlFrom , s_sqlWhere , false , "M_PRODUCT_SUBSTITUTERELATED_V" ) ; substituteTbl . setRowSelectionAllowed ( false ) ; substituteTbl . setMultiSelection ( false ) ; substituteTbl . addMouseListener ( this ) ; substituteTbl . setShowTotals ( false ) ; substituteTbl . autoSize ( ) ; ColumnInfo [ ] s_layoutRelated = new ColumnInfo [ ] { new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Warehouse" ) , "orgname" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Description" ) , "description" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Value" ) , "value" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Name" ) , "Name" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyAvailable" ) , "QtyAvailable" , Double . class , true , true , null ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyOnHand" ) , "QtyOnHand" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "QtyReserved" ) , "QtyReserved" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "PriceStd" ) , "PriceStd" , Double . class ) } ; s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V" ; s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'" ; m_sqlRelated = relatedTbl . prepareTable ( s_layoutRelated , s_sqlFrom , s_sqlWhere , false , "M_PRODUCT_SUBSTITUTERELATED_V" ) ; relatedTbl . setRowSelectionAllowed ( false ) ; relatedTbl . setMultiSelection ( false ) ; relatedTbl . addMouseListener ( this ) ; relatedTbl . setShowTotals ( false ) ; relatedTbl . autoSize ( ) ; initAtpTab ( ) ; m_tableAtp . setRowSelectionAllowed ( false ) ; m_tableAtp . setMultiSelection ( false ) ; ColumnInfo [ ] s_layoutVendor = new ColumnInfo [ ] { new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Vendor" ) , "(SELECT bp.Name FROM C_BPartner bp WHERE bp.C_BPartner_ID = M_PRODUCT_PO.C_BPartner_ID)" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "IsCurrentVendor" ) , "IsCurrentVendor" , Boolean . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "C_UOM_ID" ) , "(SELECT Name FROM C_UOM WHERE C_UOM_ID = M_PRODUCT_PO.C_UOM_ID)" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "C_Currency_ID" ) , "(SELECT iso_code FROM C_Currency WHERE C_Currency_ID = M_PRODUCT_PO.C_Currency_ID)" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "PriceList" ) , "PriceList" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "PricePO" ) , "PricePO" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "VendorProductNo" ) , "VendorProductNo" , String . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "Order_Min" ) , "Order_Min" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "DeliveryTime_Promised" ) , "DeliveryTime_Promised" , Double . class ) , new ColumnInfo ( Msg . translate ( Env . getCtx ( ) , "DeliveryTime_Actual" ) , "DeliveryTime_Actual" , Double . class ) } ; s_sqlFrom = "M_PRODUCT_PO" ; s_sqlWhere = "M_Product_ID = ?" ; m_sqlVendor = vendorTbl . prepareTable ( s_layoutVendor , s_sqlFrom , s_sqlWhere , false , "M_PRODUCT_PO" ) ; vendorTbl . setRowSelectionAllowed ( false ) ; vendorTbl . setMultiSelection ( false ) ; vendorTbl . addMouseListener ( this ) ; vendorTbl . setShowTotals ( false ) ; vendorTbl . autoSize ( ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "Warehouse" ) , new JScrollPane ( warehouseTbl ) ) ; jTab . setPreferredSize ( new Dimension ( INFO_WIDTH , SCREEN_HEIGHT > 600 ? 250 : 105 ) ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "Description" ) , new JScrollPane ( fieldDescription ) ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "ProductAttribute" ) , new JScrollPane ( fieldPAttributes ) ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "Substitute_ID" ) , new JScrollPane ( substituteTbl ) ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "RelatedProduct_ID" ) , new JScrollPane ( relatedTbl ) ) ; jTab . addTab ( Msg . getMsg ( Env . getCtx ( ) , "ATP" ) , new JScrollPane ( m_tableAtp ) ) ; jTab . addTab ( Msg . translate ( Env . getCtx ( ) , "Vendor" ) , new JScrollPane ( vendorTbl ) ) ; jTab . addChangeListener ( this ) ; tablePanel . setPreferredSize ( new Dimension ( INFO_WIDTH , SCREEN_HEIGHT > 600 ? 255 : 110 ) ) ; tablePanel . setLayout ( new BorderLayout ( ) ) ; tablePanel . add ( jTab , BorderLayout . CENTER ) ; p_detailTaskPane . setTitle ( Msg . translate ( Env . getCtx ( ) , "WarehouseStock" ) ) ; p_detailTaskPane . add ( checkShowDetail , BorderLayout . NORTH ) ; p_detailTaskPane . add ( tablePanel , BorderLayout . CENTER ) ; p_detailTaskPane . setVisible ( true ) ; }
static setup - add fields to parameterpanel
