Commit 27bddce1 authored by ssalve's avatar ssalve

Sarita : Done changes to add tax_amt as column in query. get current date as...

Sarita : Done changes to add tax_amt as column in query. get current date as today and format it as dbdateformat and added in setTimestamp on 06 JUN 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186091 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c3234907
...@@ -94,6 +94,7 @@ AssetSalesConfLocal,AssetSalesConfRemote ...@@ -94,6 +94,7 @@ AssetSalesConfLocal,AssetSalesConfRemote
InitialContext ctx = null; InitialContext ctx = null;
StringBuffer xmlBuff = new StringBuffer(); StringBuffer xmlBuff = new StringBuffer();
String xmlString=""; String xmlString="";
java.sql.Timestamp currentDate = null,today = null;//added by sarita on 06 JUN 2018
try try
{ {
ConnDriver connDriver = null; ConnDriver connDriver = null;
...@@ -107,9 +108,15 @@ conn = getConnection(); ...@@ -107,9 +108,15 @@ conn = getConnection();
System.out.println("loginEmpCode---->>["+loginEmpCode+"]"); System.out.println("loginEmpCode---->>["+loginEmpCode+"]");
sql = "select a.confirmed, a.tran_date, a.sale_amt, a.tran_type, a.curr_code," //Commented and Added by sarita to add column tax_amt on 06 JUN 2018
/*sql = "select a.confirmed, a.tran_date, a.sale_amt, a.tran_type, a.curr_code,"
+ " b.asset_code,b.acct_code__pl, b.cctr_code__pl, b.acct_code__loss, " + " b.asset_code,b.acct_code__pl, b.cctr_code__pl, b.acct_code__loss, "
+ "b.cctr_code__loss, b.line_no from asset_sales_hdr a,asset_sales_det b " + "b.cctr_code__loss, b.line_no from asset_sales_hdr a,asset_sales_det b "
+ "where a.tran_id = b.tran_id and b.tran_id = ?";*/
sql = "select a.confirmed, a.tran_date, a.sale_amt, a.tran_type, a.curr_code,"
+ " b.asset_code,b.acct_code__pl, b.cctr_code__pl, b.acct_code__loss, "
+ "b.cctr_code__loss, b.line_no,b.tax_amt from asset_sales_hdr a,asset_sales_det b "
+ "where a.tran_id = b.tran_id and b.tran_id = ?"; + "where a.tran_id = b.tran_id and b.tran_id = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
...@@ -129,12 +136,20 @@ conn = getConnection(); ...@@ -129,12 +136,20 @@ conn = getConnection();
acctCdLoss = rs.getString(9) == null ? "":rs.getString(9); acctCdLoss = rs.getString(9) == null ? "":rs.getString(9);
cctrCdLoss = rs.getString(10) == null ? "":rs.getString(10); cctrCdLoss = rs.getString(10) == null ? "":rs.getString(10);
lineNo = rs.getString(11) == null ? "":rs.getString(11); lineNo = rs.getString(11) == null ? "":rs.getString(11);
//Added by sarita to get tax_amt on 06 JUN 2018
taxAmt = rs.getDouble(12);
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
currDate = new java.sql.Timestamp(System.currentTimeMillis()) ; currDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
currAppdate = sdf.format(currDate); currAppdate = sdf.format(currDate);
//Added by sarita to get Current Date in dbformat [START]
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
currentDate = java.sql.Timestamp.valueOf(sdf1.format(today) + " 00:00:00.000");
System.out.println("Current Date is :::["+currentDate+"]"); //Current Date is :::[2018-06-06 00:00:00.0]
//Added by sarita to get Current Date in dbformat [END]
if(confirmed == "" || confirmed.equalsIgnoreCase("N")) if(confirmed == "" || confirmed.equalsIgnoreCase("N"))
{ {
...@@ -151,7 +166,7 @@ conn = getConnection(); ...@@ -151,7 +166,7 @@ conn = getConnection();
itmCode = rs.getString(2) == null ? "":rs.getString(2); itmCode = rs.getString(2) == null ? "":rs.getString(2);
grpCode = rs.getString(3) == null ? "":rs.getString(3); grpCode = rs.getString(3) == null ? "":rs.getString(3);
siteCode = rs.getString(4) == null ? "":rs.getString(4); siteCode = rs.getString(4) == null ? "":rs.getString(4);
procDate2ts = rs.getTimestamp(5); procDate2ts = rs.getTimestamp(5); // Format procDate2ts :2012-06-01 00:00:00.0
} }
pstmt.close(); pstmt.close();
...@@ -160,7 +175,7 @@ conn = getConnection(); ...@@ -160,7 +175,7 @@ conn = getConnection();
rs = null; rs = null;
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
procDate2d = sdf.format(procDate2ts); procDate2d = sdf.format(procDate2ts); // procDate2d : [01/06/12]
...@@ -188,9 +203,12 @@ conn = getConnection(); ...@@ -188,9 +203,12 @@ conn = getConnection();
if(prdCdUpto == "" || prdCdUpto.trim().length() == 0 ) if(prdCdUpto == "" || prdCdUpto.trim().length() == 0 )
{ {
//changes by sarita on 06 JUNE 2018 to add setTimestamp
sql = "select code from period where '"+procDate2d+"' between fr_date and to_date"; //sql = "select code from period where '"+procDate2d+"' between fr_date and to_date";
sql = "select code from period where ? between fr_date and to_date";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,procDate2ts);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -201,9 +219,12 @@ conn = getConnection(); ...@@ -201,9 +219,12 @@ conn = getConnection();
pstmt = null; pstmt = null;
rs = null; rs = null;
//changes by sarita on 06 JUN 2018 to set current date Timestamp parameter
sql = "select code from period where fr_date = (select fr_date from period where code = (select acct_prd from period where '"+currAppdate+"' between fr_date and to_date))"; //sql = "select code from period where fr_date = (select fr_date from period where code = (select acct_prd from period where '"+currAppdate+"' between fr_date and to_date))";
sql = "select code from period where fr_date = (select fr_date from period where code = (select acct_prd from period where ? between fr_date and to_date))";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,currentDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -226,9 +247,12 @@ conn = getConnection(); ...@@ -226,9 +247,12 @@ conn = getConnection();
} }
//changes by sarita on 06 JUN 2018 to set current date Timestamp parameter
sql = "select code from period where '"+currAppdate+"' between fr_date and to_date"; //sql = "select code from period where '"+currAppdate+"' between fr_date and to_date";
sql = "select code from period where ? between fr_date and to_date";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,currentDate);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -245,7 +269,8 @@ conn = getConnection(); ...@@ -245,7 +269,8 @@ conn = getConnection();
sql = "update asset_register set rem_date = ?,status=?,tran_id__rem=?,tran_ser__rem=?,rem_value=? where asset_code = ?"; sql = "update asset_register set rem_date = ?,status=?,tran_id__rem=?,tran_ser__rem=?,rem_value=? where asset_code = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, currAppdate); //pstmt.setString(1, currAppdate);//Added by sarita to set current date Timestamp parameter on 06 JUN 2018
pstmt.setTimestamp(1, currentDate);
pstmt.setString(2, "S"); pstmt.setString(2, "S");
pstmt.setString(3, tranId); pstmt.setString(3, tranId);
pstmt.setString(4, transer); pstmt.setString(4, transer);
...@@ -350,8 +375,9 @@ conn = getConnection(); ...@@ -350,8 +375,9 @@ conn = getConnection();
totval = totval + revalamt; totval = totval + revalamt;
//ldDate = procdate; //ldDate = procdate;
pdate = formatter.parse(procDate2d); pdate = formatter.parse(procDate2d); //Jun 01 00:00:00 GMT+05:30 18
cdate = formatter.parse(currAppdate); cdate = formatter.parse(currAppdate);
System.out.println("procDate2d : ["+procDate2d+"] \t currAppdate : ["+currAppdate+"] \t pdate : ["+pdate+"] \t cdate ["+cdate+"]");
do { do {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment