Package org.compiere.util

Examples of org.compiere.util.KeyNamePair


        line.add(new Boolean(false)); // 0-Selection
        BigDecimal qtyInvoiced = rs.getBigDecimal(1);
        BigDecimal multiplier = rs.getBigDecimal(2);
        BigDecimal qtyEntered = qtyInvoiced.multiply(multiplier);
        line.add(qtyEntered); // 1-Qty
        KeyNamePair pp = new KeyNamePair(rs.getInt(3), rs.getString(4).trim());
        line.add(pp); // 2-UOM
        // Add locator
        line.add(getLocatorKeyNamePair(rs.getInt(5))); // 3-Locator
        pp = new KeyNamePair(rs.getInt(7), rs.getString(8));
        line.add(pp); // 4-Product
        line.add(rs.getString(9));        // 5-VendorProductNo
        int C_OrderLine_ID = rs.getInt(12);
        if (rs.wasNull())
          line.add(null); // 6-Order
        else
          line.add(new KeyNamePair(C_OrderLine_ID, "."));
        line.add(null); // 7-Ship
        pp = new KeyNamePair(rs.getInt(10), rs.getString(11));
        line.add(pp); // 8-Invoice
        data.add(line);
      }
    }
    catch (SQLException e)
View Full Code Here


    if (locator == null || locator.getM_Warehouse_ID() != getM_Warehouse_ID())
    {
      locator = MWarehouse.get(Env.getCtx(), getM_Warehouse_ID()).getDefaultLocator();
    }
   
    KeyNamePair pp = null ;
    if (locator != null)
    {
      pp = new KeyNamePair(locator.get_ID(), locator.getValue());
    }
    return pp;
  }
View Full Code Here

    for (int i = 0; i < miniTable.getRowCount(); i++)
    {
      if (((Boolean)miniTable.getValueAt(i, 0)).booleanValue()) {
        // variable values
        BigDecimal QtyEntered = (BigDecimal) miniTable.getValueAt(i, 1); // Qty
        KeyNamePair pp = (KeyNamePair) miniTable.getValueAt(i, 2); // UOM
        int C_UOM_ID = pp.getKey();
        pp = (KeyNamePair) miniTable.getValueAt(i, 3); // Locator
        // If a locator is specified on the product, choose that otherwise default locator
        M_Locator_ID = pp!=null && pp.getKey()!=0 ? pp.getKey() : defaultLocator_ID;

        pp = (KeyNamePair) miniTable.getValueAt(i, 4); // Product
        int M_Product_ID = pp.getKey();
        int C_OrderLine_ID = 0;
        pp = (KeyNamePair) miniTable.getValueAt(i, 6); // OrderLine
        if (pp != null)
          C_OrderLine_ID = pp.getKey();
        int M_RMALine_ID = 0;
        pp = (KeyNamePair) miniTable.getValueAt(i, 7); // RMA
        // If we have RMA
        if (pp != null)
          M_RMALine_ID = pp.getKey();
        int C_InvoiceLine_ID = 0;
        MInvoiceLine il = null;
        pp = (KeyNamePair) miniTable.getValueAt(i, 8); // InvoiceLine
        if (pp != null)
          C_InvoiceLine_ID = pp.getKey();
        if (C_InvoiceLine_ID != 0)
          il = new MInvoiceLine (Env.getCtx(), C_InvoiceLine_ID, trxName);
        //boolean isInvoiced = (C_InvoiceLine_ID != 0);
        //  Precision of Qty UOM
        int precision = 2;
View Full Code Here

      ResultSet rs = pstmt.executeQuery();
      int i = 0;
     
      while (rs.next())
      {
        listModel[i++] = new KeyNamePair(rs.getInt(1), rs.getString(2));
      }
     
      rs.close();
      pstmt.close();
     
View Full Code Here

   */
  private void setWarehouse(int M_Warehouse_ID)
  {
    for (int i = 0; i < pickWarehouse.getItemCount(); i++)
    {
      KeyNamePair kn = (KeyNamePair)pickWarehouse.getItemAt(i);
      if (kn.getKey() == M_Warehouse_ID)
      {
        pickWarehouse.setSelectedIndex(i);
        return;
      }
    }
View Full Code Here

  private void setPriceListVersion(int M_PriceList_Version_ID)
  {
    log.config("M_PriceList_Version_ID=" + M_PriceList_Version_ID);
    for (int i = 0; i < pickPriceList.getItemCount(); i++)
    {
      KeyNamePair kn = (KeyNamePair)pickPriceList.getItemAt(i);
      if (kn.getKey() == M_PriceList_Version_ID)
      {
        pickPriceList.setSelectedIndex(i);
        return;
      }
    }
View Full Code Here

  {
    StringBuffer where = new StringBuffer();
   
    //  Optional PLV
    int M_PriceList_Version_ID = 0;
    KeyNamePair pl = (KeyNamePair)pickPriceList.getSelectedItem();
    if (pl != null)
      M_PriceList_Version_ID = pl.getKey();

    // 24/07/2009 rgliddon: Added product price check to ensure no zero standard
    // prices make it into the selection.  We are not interested in seeing zero
    // priced products when a price list has been selected.
    if (M_PriceList_Version_ID != 0)
View Full Code Here

  {
    int index = 1;

    //  => Warehouse
    int M_Warehouse_ID = 0;
    KeyNamePair wh = (KeyNamePair)pickWarehouse.getSelectedItem();
    if (wh != null)
      M_Warehouse_ID = wh.getKey();
    if (!forCount//  parameters in select
    {
      for (int i = 0; i < p_layout.length; i++)
      {
        if (p_layout[i].getColSQL().indexOf('?') != -1)
          pstmt.setInt(index++, M_Warehouse_ID);
      }
    }
    log.fine("M_Warehouse_ID=" + M_Warehouse_ID + " (" + (index-1) + "*)");

    //  => PriceList
    int M_PriceList_Version_ID = 0;
    KeyNamePair pl = (KeyNamePair)pickPriceList.getSelectedItem();
    if (pl != null)
      M_PriceList_Version_ID = pl.getKey();
    if (M_PriceList_Version_ID != 0)
    {
      pstmt.setInt(index++, M_PriceList_Version_ID);
      log.fine("M_PriceList_Version_ID=" + M_PriceList_Version_ID);
    }
View Full Code Here

    int row = p_table.getSelectedRow();
    if (e.getSource().equals(m_PAttributeButton) && row != -1)
    {
      Integer productInteger = getSelectedRowKey();
      String productName = (String)p_table.getValueAt(row, INDEX_NAME);
      KeyNamePair warehouse = (KeyNamePair)pickWarehouse.getSelectedItem();
      if (productInteger == null || productInteger.intValue() == 0 || warehouse == null)
        return;
      String title = warehouse.getName() + " - " + productName;
      PAttributeInstance pai = new PAttributeInstance (this, title,
        warehouse.getKey(), 0, productInteger.intValue(), m_C_BPartner_ID);
      m_M_AttributeSetInstance_ID = pai.getM_AttributeSetInstance_ID();
      m_M_Locator_ID = pai.getM_Locator_ID();
      if (m_M_AttributeSetInstance_ID != -1)
        dispose(true);
      return;     
View Full Code Here

  {
    log.info("");
    Integer M_Product_ID = getSelectedRowKey();
    if (M_Product_ID == null)
      return;
    KeyNamePair kn = (KeyNamePair)pickWarehouse.getSelectedItem();
    int M_Warehouse_ID = kn.getKey();
    int M_AttributeSetInstance_ID = m_M_AttributeSetInstance_ID;
    if (m_M_AttributeSetInstance_ID < -1//  not selected
      M_AttributeSetInstance_ID = 0;
    //
    InvoiceHistory ih = new InvoiceHistory (this, 0,
View Full Code Here

TOP

Related Classes of org.compiere.util.KeyNamePair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.