Package org.compiere.util

Examples of org.compiere.util.KeyNamePair


  public ArrayList<KeyNamePair> getBPartnerData()
  {
    ArrayList<KeyNamePair> data = new ArrayList<KeyNamePair>();
   
    //  Optional BusinessPartner with unpaid AP Invoices
    KeyNamePair pp = new KeyNamePair(0, "");
    data.add(pp);
   
    String sql = MRole.getDefault().addAccessSQL(
      "SELECT bp.C_BPartner_ID, bp.Name FROM C_BPartner bp", "bp",
      MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)
      + " AND EXISTS (SELECT * FROM C_Invoice i WHERE bp.C_BPartner_ID=i.C_BPartner_ID"
      //  X_C_Order.PAYMENTRULE_DirectDebit
        + " AND (i.IsSOTrx='N' OR (i.IsSOTrx='Y' AND i.PaymentRule='D'))"
        + " AND i.IsPaid<>'Y') "
      + "ORDER BY 2";

    try
    {
      PreparedStatement pstmt = DB.prepareStatement(sql, null);
      ResultSet rs = pstmt.executeQuery();
      while (rs.next())
      {
        pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
        data.add(pp);
      }
      rs.close();
      pstmt.close();
    }
View Full Code Here


    {
      sql = MRole.getDefault().addAccessSQL(
        "SELECT doc.c_doctype_id,doc.name FROM c_doctype doc WHERE doc.ad_client_id = ? AND doc.docbasetype in ('API','APC') ORDER BY 2", "doc",
        MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);

      KeyNamePair dt = new KeyNamePair(0, "");
      data.add(dt);
      PreparedStatement pstmt = DB.prepareStatement(sql, null);
      pstmt.setInt(1, m_AD_Client_ID);    //  Client
      ResultSet rs = pstmt.executeQuery();

      while (rs.next())
      {
        dt = new KeyNamePair(rs.getInt(1), rs.getString(2));
        data.add(dt);
      }
      rs.close();
      pstmt.close();
    }
View Full Code Here

    }/*CHANGES END HERE Dominic Tarr 20080318*/
    //
    if (onlyDue)
      sql += " AND paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) <= ?";
    //
    KeyNamePair pp = bpartner;
    int C_BPartner_ID = pp.getKey();
    if (C_BPartner_ID != 0)
      sql += " AND i.C_BPartner_ID=?";
    //Document Type
    KeyNamePair dt = docType;
    int c_doctype_id  = dt.getKey();
    if (c_doctype_id   != 0)
      sql += " AND i.c_doctype_id =?";
    sql += " ORDER BY 2,3";

    log.finest(sql + " - C_Currency_ID=" + bi.C_Currency_ID + ", C_BPartner_ID=" + C_BPartner_ID + ", C_doctype_id=" + c_doctype_id  );
View Full Code Here

    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                 
View Full Code Here

    line.add( new Boolean(false))//  0 Select
    line.add( new Boolean(true));   //  1 IsActive
    line.add( 0); // 2 Line               
    line.add( null); //  3 ValidDrom
    line.add( null); //  4 ValidTo
    KeyNamePair pp = new KeyNamePair(0,"TOTAL");
    line.add(pp); //  5 M_Product_ID
    KeyNamePair uom = new KeyNamePair(0,"");
    line.add(uom); //  6 C_UOM_ID
    line.add(new Boolean(false)); //  7 IsQtyPercentage
    line.add(BigDecimal.ZERO)//  8 BatchPercent
    line.add(BigDecimal.ZERO)//  9 QtyBom
    line.add(Boolean.FALSE); //  10 IsCritical      
View Full Code Here

      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(component.getM_Product_ID(),component.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 IsQtyPercentage
      line.add((BigDecimal) bomline.getQtyBatch())//  8 BatchPercent

      /*CHANGES START HERE 20081114*/
 
View Full Code Here

            data = new Integer(rs.getInt(colIndex));
          else if (c == KeyNamePair.class)
          {
            String display = rs.getString(colIndex);
            int key = rs.getInt(colIndex+1);
            data = new KeyNamePair(key, display);
            colOffset++;
          }
          else
          {
            String s = rs.getString(colIndex);
View Full Code Here

    m_actionActive = true;
    log.config("Action=" + e.getActionCommand());
    //  Order
    if (e.getSource().equals(orderField))
    {
      KeyNamePair pp = (KeyNamePair)orderField.getSelectedItem();
      int C_Order_ID = 0;
      if (pp != null)
        C_Order_ID = pp.getKey();
      //  set Invoice, RMA and Shipment to Null
      rmaField.setSelectedIndex(-1);
      invoiceField.setSelectedIndex(-1);
      loadOrder(C_Order_ID, false, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0);
    }
    //  Invoice
    else if (e.getSource().equals(invoiceField))
    {
      KeyNamePair pp = (KeyNamePair)invoiceField.getSelectedItem();
      int C_Invoice_ID = 0;
      if (pp != null)
        C_Invoice_ID = pp.getKey();
      //  set Order, RMA to Null
      orderField.setSelectedIndex(-1);
      rmaField.setSelectedIndex(-1);
      loadInvoice(C_Invoice_ID, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0);
    }
    //  RMA
    else if (e.getSource().equals(rmaField))
    {
        KeyNamePair pp = (KeyNamePair)rmaField.getSelectedItem();
        int M_RMA_ID = 0;
        if (pp != null)
            M_RMA_ID = pp.getKey();
        //  set Order and Invoice to Null
        orderField.setSelectedIndex(-1);
        invoiceField.setSelectedIndex(-1);
        loadRMA(M_RMA_ID, locatorField.getValue()!=null?((Integer)locatorField.getValue()).intValue():0);
    }
View Full Code Here

   @param forInvoice for invoice
   */
  protected void initBPOrderDetails (int C_BPartner_ID, boolean forInvoice)
  {
    log.config("C_BPartner_ID=" + C_BPartner_ID);
    KeyNamePair pp = new KeyNamePair(0,"");
    //  load PO Orders - Closed, Completed
    orderField.removeActionListener(this);
    orderField.removeAllItems();
    orderField.addItem(pp);
   
View Full Code Here

    //  load Shipments (Receipts) - Completed, Closed
    invoiceField.removeActionListener(this);
    invoiceField.removeAllItems();
    //  None
    KeyNamePair pp = new KeyNamePair(0,"");
    invoiceField.addItem(pp);
   
    ArrayList<KeyNamePair> list = loadInvoiceData(C_BPartner_ID);
    for(KeyNamePair knp : list)
      invoiceField.addItem(knp);
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.