public static Timestamp invoiceDueDate(int p_C_Invoice_ID) throws SQLException {
  if (p_C_Invoice_ID == 0)   return null;
  Timestamp DueDate=null;
  String sql="SELECT C_PaymentTerm_ID, DateInvoiced " + "FROM C_Invoice " + "WHERE C_Invoice_ID=?";
  PreparedStatement pstmt=Adempiere.prepareStatement(sql);
  pstmt.setInt(1,p_C_Invoice_ID);
  ResultSet rs=pstmt.executeQuery();
  if (rs.next()) {
    int C_PaymentTerm_ID=rs.getInt(1);
    Timestamp DocDate=rs.getTimestamp(2);
    DueDate=dueDate(C_PaymentTerm_ID,DocDate);
  }
  rs.close();
  pstmt.close();
  return DueDate;
}

public static Timestamp invoiceDueDate ( int p_C_Invoice_ID ) throws SQLException { if ( p_C_Invoice_ID == 0 ) return null ; Timestamp DueDate = null ; String sql = "SELECT C_PaymentTerm_ID, DateInvoiced " + "FROM C_Invoice " + "WHERE C_Invoice_ID=?" ; PreparedStatement pstmt = Adempiere . prepareStatement ( sql ) ; pstmt . setInt ( 1 , p_C_Invoice_ID ) ; ResultSet rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) { int C_PaymentTerm_ID = rs . getInt ( 1 ) ; Timestamp DocDate = rs . getTimestamp ( 2 ) ; DueDate = dueDate ( C_PaymentTerm_ID , DocDate ) ; } rs . close ( ) ; pstmt . close ( ) ; return DueDate ; }
get invoice due date
