mirror of
https://github.com/dyiop/astute.git
synced 2025-04-06 21:30:20 -04:00
Add files via upload
This commit is contained in:
parent
4cd83d18b6
commit
f1c7a94e42
|
@ -110,11 +110,11 @@ public abstract class DAO {
|
||||||
|
|
||||||
public abstract List<InvoiceDetail> getInvoiceDetail(String invoiceNum, int lineItemNo) throws AstuteException;
|
public abstract List<InvoiceDetail> getInvoiceDetail(String invoiceNum, int lineItemNo) throws AstuteException;
|
||||||
|
|
||||||
public abstract void updateInvoiceMaster(String invoiceNum, java.sql.Date invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) throws AstuteException;
|
public abstract void updateInvoiceMaster(String invoiceNum, String invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) throws AstuteException;
|
||||||
|
|
||||||
public abstract void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId) throws AstuteException;
|
public abstract void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId) throws AstuteException;
|
||||||
|
|
||||||
public abstract void createInvoiceMaster(String invoiceNum, java.sql.Date invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) throws AstuteException;
|
public abstract void createInvoiceMaster(String invoiceNum, String invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) throws AstuteException, ParseException;
|
||||||
|
|
||||||
public abstract void createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId) throws AstuteException;
|
public abstract void createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId) throws AstuteException;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class SqlDAO extends DAO {
|
||||||
} else if (contractNum != null && !contractNum.isEmpty()) {
|
} else if (contractNum != null && !contractNum.isEmpty()) {
|
||||||
sql += "WHERE UPPER(contract_num) = '" + contractNum.toUpperCase()+ "'";
|
sql += "WHERE UPPER(contract_num) = '" + contractNum.toUpperCase()+ "'";
|
||||||
} else if (PODate != null) {
|
} else if (PODate != null) {
|
||||||
sql += "WHERE PO_date = STR_TO_DATE('" + PODate + "', '%m-%d-%Y')";
|
sql += "WHERE PO_date = STR_TO_DATE('" + PODate + "', '%Y-%m-%d')";
|
||||||
} else if (astuteProjectNumber!= null && !astuteProjectNumber.isEmpty() ) {
|
} else if (astuteProjectNumber!= null && !astuteProjectNumber.isEmpty() ) {
|
||||||
sql += "WHERE UPPER(astute_project_num) = '" + astuteProjectNumber.toUpperCase()+ "'";
|
sql += "WHERE UPPER(astute_project_num) = '" + astuteProjectNumber.toUpperCase()+ "'";
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ public class SqlDAO extends DAO {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateClause = updateClause + " contract_num = '" + contractNum + "',";
|
updateClause = updateClause + " contract_num = '" + contractNum + "',";
|
||||||
updateClause = updateClause + " PO_Date = STR_TO_DATE('" + PODate + "', '%m/%d/%y')" + ",";
|
updateClause = updateClause + " PO_Date = STR_TO_DATE('" + PODate + "', '%Y-%m-%d')" + ",";
|
||||||
updateClause = updateClause + " contract_amt = " + contractAmt+ ",";
|
updateClause = updateClause + " contract_amt = " + contractAmt+ ",";
|
||||||
updateClause = updateClause + " astute_project_num = '" + astuteProjectNumber +"',";
|
updateClause = updateClause + " astute_project_num = '" + astuteProjectNumber +"',";
|
||||||
updateClause = updateClause + " title = '" + title +"'";
|
updateClause = updateClause + " title = '" + title +"'";
|
||||||
|
@ -199,8 +199,12 @@ public class SqlDAO extends DAO {
|
||||||
|
|
||||||
public void createPOMaster(String PONum, String contractNum, String PODate, Double contractAmt, String customerId, String astuteProjectNumber, String title) throws AstuteException, ParseException {
|
public void createPOMaster(String PONum, String contractNum, String PODate, Double contractAmt, String customerId, String astuteProjectNumber, String title) throws AstuteException, ParseException {
|
||||||
try {
|
try {
|
||||||
java.util.Date date= new SimpleDateFormat("yyyy-mm-dd").parse(PODate);
|
java.util.Date date = null;
|
||||||
java.sql.Date poDate = new java.sql.Date(date.getTime());
|
java.sql.Date poDate = null;
|
||||||
|
if (PODate!= null && !PODate.isEmpty()) {
|
||||||
|
date = new SimpleDateFormat("yyyy-MM-dd").parse(PODate);
|
||||||
|
poDate = new java.sql.Date(date.getTime());
|
||||||
|
}
|
||||||
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?,?)}");
|
CallableStatement stmt = conn.prepareCall("{call create_PO(?,?,?,?,?,?,?)}");
|
||||||
stmt.setString(1, PONum);
|
stmt.setString(1, PONum);
|
||||||
stmt.setString(2, contractNum);
|
stmt.setString(2, contractNum);
|
||||||
|
@ -315,7 +319,7 @@ public class SqlDAO extends DAO {
|
||||||
ResultSet rs = stmt.executeQuery(sql);
|
ResultSet rs = stmt.executeQuery(sql);
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
String invNo = rs.getString(1);
|
String invNo = rs.getString(1);
|
||||||
Date invdDate = rs.getDate(2);
|
String invdDate = rs.getString(2);
|
||||||
String PONo = rs.getString(3);
|
String PONo = rs.getString(3);
|
||||||
int paymentStatus = rs.getInt(4);
|
int paymentStatus = rs.getInt(4);
|
||||||
Double billAmt = rs.getDouble(5);
|
Double billAmt = rs.getDouble(5);
|
||||||
|
@ -373,7 +377,7 @@ public class SqlDAO extends DAO {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateInvoiceMaster(String invoiceNum, Date invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus)throws AstuteException {
|
public void updateInvoiceMaster(String invoiceNum, String invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus)throws AstuteException {
|
||||||
try {
|
try {
|
||||||
String sql = "UPDATE INVOICE ";
|
String sql = "UPDATE INVOICE ";
|
||||||
String updateClause = " SET ";
|
String updateClause = " SET ";
|
||||||
|
@ -383,8 +387,7 @@ public class SqlDAO extends DAO {
|
||||||
} else {
|
} else {
|
||||||
whereClause = " WHERE UPPER(inv_no) ='" + invoiceNum.toUpperCase() + "'";
|
whereClause = " WHERE UPPER(inv_no) ='" + invoiceNum.toUpperCase() + "'";
|
||||||
}
|
}
|
||||||
|
updateClause = updateClause + " inv_date = STR_TO_DATE('" + invoiceDate + "', '%Y-%m-%d')" + ",";
|
||||||
updateClause = updateClause + " inv_date = " + invoiceDate + ",";
|
|
||||||
updateClause = updateClause + " PO_num = '" + PONum + "',";
|
updateClause = updateClause + " PO_num = '" + PONum + "',";
|
||||||
updateClause = updateClause + " pmt_status = " + pmtStatus + ",";
|
updateClause = updateClause + " pmt_status = " + pmtStatus + ",";
|
||||||
updateClause = updateClause + " bill_amt = " + billAmt + ",";
|
updateClause = updateClause + " bill_amt = " + billAmt + ",";
|
||||||
|
@ -454,13 +457,19 @@ public class SqlDAO extends DAO {
|
||||||
throw new AstuteException(DB_ERROR,e.getMessage());
|
throw new AstuteException(DB_ERROR,e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void createInvoiceMaster(String invoiceNum, Date invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus)throws AstuteException {
|
public void createInvoiceMaster(String invoiceNum, String invoiceDate, String PONum, int pmtStatus, Double billAmt, String specialNotes, String certification, int invoiceStatus) throws AstuteException, ParseException {
|
||||||
try {
|
try {
|
||||||
|
java.util.Date date = null;
|
||||||
|
java.sql.Date invDate = null;
|
||||||
|
if (invoiceDate != null) {
|
||||||
|
date= new SimpleDateFormat("yyyy-MM-dd").parse(invoiceDate);
|
||||||
|
invDate = new java.sql.Date(date.getTime());
|
||||||
|
}
|
||||||
System.out.println("Calling create_invoice Procedure");
|
System.out.println("Calling create_invoice Procedure");
|
||||||
System.out.println("invoiceNum is "+invoiceNum);
|
System.out.println("invoiceNum is "+invoiceNum);
|
||||||
CallableStatement stmt = conn.prepareCall("{call create_invoice(?,?,?,?,?,?,?,?)}");
|
CallableStatement stmt = conn.prepareCall("{call create_invoice(?,?,?,?,?,?,?,?)}");
|
||||||
stmt.setString(1, invoiceNum);
|
stmt.setString(1, invoiceNum);
|
||||||
stmt.setDate(2, invoiceDate);
|
stmt.setDate(2, invDate);
|
||||||
stmt.setString(3, PONum);
|
stmt.setString(3, PONum);
|
||||||
stmt.setInt(4, pmtStatus);
|
stmt.setInt(4, pmtStatus);
|
||||||
stmt.setDouble(5, billAmt);
|
stmt.setDouble(5, billAmt);
|
||||||
|
@ -501,7 +510,7 @@ public class SqlDAO extends DAO {
|
||||||
if (InvoiceNumber == null || InvoiceNumber.isEmpty()) {
|
if (InvoiceNumber == null || InvoiceNumber.isEmpty()) {
|
||||||
throw new AstuteException(0, "Invoice Number should not be null!");
|
throw new AstuteException(0, "Invoice Number should not be null!");
|
||||||
} else {
|
} else {
|
||||||
String sql = "UPDATE INVOICE SET INV_STATUS = 2 WHERE UPPER(INV_NO) = 'UPPER('" + InvoiceNumber + "')";
|
String sql = "UPDATE INVOICE SET INV_STATUS = 2 WHERE UPPER(INV_NO) = UPPER('" + InvoiceNumber + "')";
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
stmt.executeUpdate(sql);
|
stmt.executeUpdate(sql);
|
||||||
}
|
}
|
||||||
|
@ -516,7 +525,7 @@ public class SqlDAO extends DAO {
|
||||||
if (InvoiceNumber == null || InvoiceNumber.isEmpty()) {
|
if (InvoiceNumber == null || InvoiceNumber.isEmpty()) {
|
||||||
throw new AstuteException(0, "Invoice Number should not be null!");
|
throw new AstuteException(0, "Invoice Number should not be null!");
|
||||||
} else {
|
} else {
|
||||||
String sql = "UPDATE INVOICE SET INV_STATUS = 3 WHERE UPPER(INV_NO) = 'UPPER('" + InvoiceNumber + "')";
|
String sql = "UPDATE INVOICE SET INV_STATUS = 3 WHERE UPPER(INV_NO) = UPPER('" + InvoiceNumber + "')";
|
||||||
Statement stmt = conn.createStatement();
|
Statement stmt = conn.createStatement();
|
||||||
stmt.executeUpdate(sql);
|
stmt.executeUpdate(sql);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user