Add files via upload

This commit is contained in:
gopi17701 2018-08-20 22:17:58 -04:00 committed by GitHub
parent a09b960bce
commit ea91c8d756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -111,11 +111,11 @@ public abstract class DAO {
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 updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee) 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 createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee) throws AstuteException;
public abstract void createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId) throws AstuteException;
public abstract String generateInvoiceNumber(String poNum) throws AstuteException;

View File

@ -321,7 +321,7 @@ public class SqlDAO extends DAO {
try {
List<InvoiceDetail> services = new ArrayList<>();
Statement stmt = conn.createStatement();
String sql = "SELECT inv_num, line_item_num, PO_line_item_num, service_type_id, description, percent_completion, hours,amt FROM INVOICE_DETAIL ";
String sql = "SELECT inv_num, line_item_num, PO_line_item_num, service_type_id, description, fee_type_id, fee, qty FROM INVOICE_DETAIL ";
String whereClause = " WHERE ";
boolean whereClauseIndicator = false;
@ -344,9 +344,10 @@ public class SqlDAO extends DAO {
int POLineItemNum = rs.getInt(3);
int serviceTypeId = rs.getInt(4);
String desc = rs.getString(5);
Double qty = rs.getDouble(6);
int feeTypeId = rs.getInt(6);
Double fee = rs.getDouble(7);
InvoiceDetail service = new InvoiceDetail(invNo, lineItemNum, POLineItemNum, serviceTypeId, desc, qty, fee);
Double qty = rs.getDouble(8);
InvoiceDetail service = new InvoiceDetail(invNo, lineItemNum, POLineItemNum, serviceTypeId, desc, qty, fee, feeTypeId);
services.add(service);
}
return services;
@ -384,7 +385,7 @@ public class SqlDAO extends DAO {
}
}
public void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee)throws AstuteException {
public void updateInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId)throws AstuteException {
try {
String sql = "UPDATE INVOICE_DETAIL ";
String updateClause = " SET ";
@ -409,6 +410,9 @@ public class SqlDAO extends DAO {
if(fee > 0) {
updateClause += " fee = " + fee + ",";
}
if(feeTypeId > 0) {
updateClause += " fee_type_id = " + feeTypeId + ",";
}
if (!updateClause.equalsIgnoreCase(" SET ")) {
sql = sql + trimLastCharacter(updateClause,",") + whereClause;
@ -444,11 +448,11 @@ public class SqlDAO extends DAO {
}
public void createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee)throws AstuteException {
public void createInvoiceDetail(String invoiceNum, int lineItemNum, int POLineItemNum, int serviceTypeId, String desc, double qty, double fee, int feeTypeId)throws AstuteException {
try {
System.out.println("Calling create_invoice_detail Procedure");
System.out.println("invoiceNum is "+invoiceNum);
CallableStatement stmt = conn.prepareCall("{call create_invoice_detail(?,?,?,?,?,?,?,?)}");
CallableStatement stmt = conn.prepareCall("{call create_invoice_detail(?,?,?,?,?,?,?,?,?)}");
stmt.setString(1, invoiceNum);
stmt.setInt(2, lineItemNum);
stmt.setInt(3, POLineItemNum);
@ -456,6 +460,7 @@ public class SqlDAO extends DAO {
stmt.setString(5, desc);
stmt.setDouble(6, qty);
stmt.setDouble(7, fee);
stmt.setInt(8, feeTypeId);
stmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();