public boolean hasInvoices(){
  boolean retValue=false;
  String sql="SELECT COUNT(*) FROM C_DunningRunLine WHERE C_DunningRunEntry_ID=? AND C_Invoice_ID IS NOT NULL";
  PreparedStatement pstmt=null;
  try {
    pstmt=DB.prepareStatement(sql,get_TrxName());
    pstmt.setInt(1,get_ID());
    ResultSet rs=pstmt.executeQuery();
    if (rs.next()) {
      if (rs.getInt(1) > 0)       retValue=true;
    }
    rs.close();
    pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    s_log.log(Level.SEVERE,sql,e);
  }
  try {
    if (pstmt != null)     pstmt.close();
    pstmt=null;
  }
 catch (  Exception e) {
    pstmt=null;
  }
  return retValue;
}

public boolean hasInvoices ( ) { boolean retValue = false ; String sql = "SELECT COUNT(*) FROM C_DunningRunLine WHERE C_DunningRunEntry_ID=? AND C_Invoice_ID IS NOT NULL" ; PreparedStatement pstmt = null ; try { pstmt = DB . prepareStatement ( sql , get_TrxName ( ) ) ; pstmt . setInt ( 1 , get_ID ( ) ) ; ResultSet rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) { if ( rs . getInt ( 1 ) > 0 ) retValue = true ; } rs . close ( ) ; pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { s_log . log ( Level . SEVERE , sql , e ) ; } try { if ( pstmt != null ) pstmt . close ( ) ; pstmt = null ; } catch ( Exception e ) { pstmt = null ; } return retValue ; }
check whether has invoices
