protected ArrayList<KeyNamePair> loadRMAData(int C_BPartner_ID){
  ArrayList<KeyNamePair> list=new ArrayList<KeyNamePair>();
  String sqlStmt="SELECT r.M_RMA_ID, r.DocumentNo || '-' || r.Amt from M_RMA r " + "WHERE ISSOTRX='N' AND r.DocStatus in ('CO', 'CL') " + "AND r.C_BPartner_ID=? "+ "AND NOT EXISTS (SELECT * FROM C_Invoice inv "+ "WHERE inv.M_RMA_ID=r.M_RMA_ID AND inv.DocStatus IN ('CO', 'CL'))";
  PreparedStatement pstmt=null;
  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 {
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      Exception ex) {
        log.severe("Could not close prepared statement");
      }
    }
  }
  return list;
}

protected ArrayList < KeyNamePair > loadRMAData ( int C_BPartner_ID ) { ArrayList < KeyNamePair > list = new ArrayList < KeyNamePair > ( ) ; String sqlStmt = "SELECT r.M_RMA_ID, r.DocumentNo || '-' || r.Amt from M_RMA r " + "WHERE ISSOTRX='N' AND r.DocStatus in ('CO', 'CL') " + "AND r.C_BPartner_ID=? " + "AND NOT EXISTS (SELECT * FROM C_Invoice inv " + "WHERE inv.M_RMA_ID=r.M_RMA_ID AND inv.DocStatus IN ('CO', 'CL'))" ; PreparedStatement pstmt = null ; 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 { if ( pstmt != null ) { try { pstmt . close ( ) ; } catch ( Exception ex ) { log . severe ( "Could not close prepared statement" ) ; } } } return list ; }
load pbartner dependent order / invoice / shipment field .
