Add files via upload

This commit is contained in:
gopi17701 2018-07-24 12:29:28 -04:00 committed by GitHub
parent a7a8188926
commit 688896ea4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,13 +41,13 @@ public class SqlDAO extends DAO {
List<PO> pos = new ArrayList<>();
Statement stmt = conn.createStatement();
String sql = "SELECT PO_num, contract_num, PO_date, customer_id, contract_amt FROM PO ";
if (PONum != null) {
if (PONum != null && !PONum.isEmpty()) {
sql += "WHERE UPPER(PO_num) = '" + PONum.toUpperCase() + "'";
} else if (contractNum != null) {
} else if (contractNum != null && !contractNum.isEmpty()) {
sql += "WHERE UPPER(contract_num) = '" + contractNum.toUpperCase()+ "'";
} else if (PODate != null) {
sql += "WHERE PO_date = STR_TO_DATE(" + PODate + ", '%Y-%m-%d')";
} else if (astuteProjectNumber!= null) {
} else if (astuteProjectNumber!= null && !astuteProjectNumber.isEmpty() ) {
sql += "WHERE UPPER(astute_project_num) = '" + astuteProjectNumber.toUpperCase()+ "'";
}
@ -282,7 +282,7 @@ public class SqlDAO extends DAO {
String whereClause = " WHERE ";
boolean whereClauseIndicator = false;
String sql = "SELECT inv_no, inv_date, PO_num, change_order_num, pmt_status, bill_amt, special_notes, certification FROM INVOICE ";
if (invoiceNumber != null) {
if (invoiceNumber != null && !invoiceNumber.isEmpty()) {
whereClause = whereClause + " UPPER(inv_no) = '"+ invoiceNumber.toUpperCase() +"'";
whereClauseIndicator = true;
}