Package org.compiere.util

Examples of org.compiere.util.KeyNamePair


  private void initBPRMADetails(int C_BPartner_ID)
  {
      rmaField.removeActionListener(this);
      rmaField.removeAllItems();
      //  None
      KeyNamePair pp = new KeyNamePair(0,"");
      rmaField.addItem(pp);
     
      ArrayList<KeyNamePair> list = loadRMAData(C_BPartner_ID);
    for(KeyNamePair knp : list)
      rmaField.addItem(knp);
View Full Code Here


   *
   */
  private int findProductRow(int M_Product_ID)
  {
    DefaultTableModel model = (DefaultTableModel)dialog.getMiniTable().getModel();
    KeyNamePair kp;
    for (int i=0; i<model.getRowCount(); i++) {
      kp = (KeyNamePair)model.getValueAt(i, 4);
      if (kp.getKey()==M_Product_ID) {
        return(i);
      }
    }
    return(-1);
  }
View Full Code Here

   */
  private void fillComboReport(int AD_PrintFormat_ID)
  {
    comboReport.removeActionListener(this);
    comboReport.removeAllItems();
    KeyNamePair selectValue = null;
    //  fill Report Options
    String sql = MRole.getDefault().addAccessSQL(
      "SELECT AD_PrintFormat_ID, Name, Description "
        + "FROM AD_PrintFormat "
        + "WHERE AD_Table_ID=? "
        //Added Lines by Armen
        + "AND IsActive='Y' "
        //End of Added Lines
        + "ORDER BY Name",
      "AD_PrintFormat", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
    int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID();
    try
    {
      PreparedStatement pstmt = DB.prepareStatement(sql, null);
      pstmt.setInt(1, AD_Table_ID);
      ResultSet rs = pstmt.executeQuery();
      while (rs.next())
      {
        KeyNamePair pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
        comboReport.addItem(pp);
        if (rs.getInt(1) == AD_PrintFormat_ID)
          selectValue = pp;
      }
      rs.close();
      pstmt.close();
    }
    catch (SQLException e)
    {
      log.log(Level.SEVERE, sql, e);
    }
    StringBuffer sb = new StringBuffer("** ").append(Msg.getMsg(m_ctx, "NewReport")).append(" **");
    KeyNamePair pp = new KeyNamePair(-1, sb.toString());
    comboReport.addItem(pp);
    if (selectValue != null)
      comboReport.setSelectedItem(selectValue);
    comboReport.addActionListener(this);
  //  fillComboReport
View Full Code Here

  /**
   *   Report Combo - Start other Report or create new one
   */
  private void cmd_report()
  {
    KeyNamePair pp = (KeyNamePair)comboReport.getSelectedItem();
    if (pp == null)
      return;
    //
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    MPrintFormat pf = null;
    int AD_PrintFormat_ID = pp.getKey();

    //  create new
    if (AD_PrintFormat_ID == -1)
    {
      int AD_ReportView_ID = m_reportEngine.getPrintFormat().getAD_ReportView_ID();
View Full Code Here

      while (rs.next())
      {
        Vector<Object> line = new Vector<Object>(6);
        line.add(new Boolean(false));       //  0-Selection
        line.add(rs.getTimestamp(1));       //  1-DateTrx
        KeyNamePair pp = new KeyNamePair(rs.getInt(2), rs.getString(3));
        line.add(pp);                       //  2-C_Payment_ID
        pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
        line.add(pp);                       //  3-Currency
        line.add(rs.getBigDecimal(6));      //  4-PayAmt
        line.add(rs.getBigDecimal(7));      //  5-Conv Amt
        line.add(rs.getString(8));        //  6-BParner
        data.add(line);
View Full Code Here

    for (int i = 0; i < miniTable.getRowCount(); i++)
    {
      if (((Boolean)miniTable.getValueAt(i, 0)).booleanValue())
      {
        Timestamp trxDate = (Timestamp)miniTable.getValueAt(i, 1)//  1-DateTrx
        KeyNamePair pp = (KeyNamePair)miniTable.getValueAt(i, 2);   //  2-C_Payment_ID
        int C_Payment_ID = pp.getKey();
        pp = (KeyNamePair)miniTable.getValueAt(i, 3);               //  3-Currency
        int C_Currency_ID = pp.getKey();
        BigDecimal TrxAmt = (BigDecimal)miniTable.getValueAt(i, 5); //  5- Conv Amt

        log.fine("Line Date=" + trxDate
          + ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt);
        // 
View Full Code Here

    try {
      pstmt = DB.prepareStatement(sqlStmt, null);
      pstmt.setInt(1, C_BPartner_ID);
      ResultSet rs = pstmt.executeQuery();
      while (rs.next()) {
        list.add(new KeyNamePair(rs.getInt(1), rs.getString(2)));
      }
      rs.close();
    } catch (SQLException e) {
      log.log(Level.SEVERE, sqlStmt.toString(), e);
    } finally {
View Full Code Here

      pstmt.setInt(1, C_BPartner_ID);
      pstmt.setInt(2, C_BPartner_ID);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        list.add(new KeyNamePair(rs.getInt(1), rs.getString(2)));
      }
      rs.close();
      pstmt.close();
    }
    catch (SQLException e)
View Full Code Here

        line.add(new Boolean(false));           //  0-Selection
        BigDecimal qtyOrdered = rs.getBigDecimal(1);
        BigDecimal multiplier = rs.getBigDecimal(2);
        BigDecimal qtyEntered = qtyOrdered.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
        // Add product
        pp = new KeyNamePair(rs.getInt(7), rs.getString(8));
        line.add(pp);                           //  4-Product
        line.add(rs.getString(9));        // 5-VendorProductNo
        pp = new KeyNamePair(rs.getInt(10), rs.getString(11));
        line.add(pp);                           //  6-OrderLine
        line.add(null);                         //  7-Ship
        line.add(null);                         //  8-Invoice
        data.add(line);
      }
View Full Code Here

          while (rs.next())
            {
              Vector<Object> line = new Vector<Object>(7);
              line.add(new Boolean(false));   // 0-Selection
              line.add(rs.getBigDecimal(3))// 1-Qty
              KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7));
              line.add(pp); // 2-UOM
        line.add(getLocatorKeyNamePair(0));
              pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
        line.add(pp); // 4-Product
        line.add(null); //5-Vendor Product No
                // 25-09-2009 rgliddon: Orderline is now retrieved and added to line
                pp = new KeyNamePair(rs.getInt(8), rs.getString(9));
                line.add(pp); //6-Order
        pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
        line.add(pp);   //7-RMA
        line.add(null); //8-invoice
              data.add(line);
            }
      }
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.