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
......@@ -63,7 +63,7 @@ AssetSalesConfLocal,AssetSalesConfRemote
String sql = "";
String confirmed="";
String assetCode="",tranType="",acctCdPl="",cctrCdPl="",acctCdLoss="",cctrCdLoss="",itmSer="",itmCode = "",grpCode="",siteCode="",prdCdUpto="",prdCdUpfr="",saleCd="",lineNo="";
java.sql.Timestamp currDate = null;
java.sql.Timestamp currDate = null;
java.sql.Timestamp procDate2ts = null;
java.sql.Timestamp procdatets = null;
String procDate2d = "",procdatetsm = "";
......@@ -94,6 +94,7 @@ AssetSalesConfLocal,AssetSalesConfRemote
InitialContext ctx = null;
StringBuffer xmlBuff = new StringBuffer();
String xmlString="";
java.sql.Timestamp currentDate = null,today = null;//added by sarita on 06 JUN 2018
try
{
ConnDriver connDriver = null;
......@@ -107,10 +108,16 @@ conn = getConnection();
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.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 = ?";
+ "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 = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranId);
......@@ -129,11 +136,19 @@ conn = getConnection();
acctCdLoss = rs.getString(9) == null ? "":rs.getString(9);
cctrCdLoss = rs.getString(10) == null ? "":rs.getString(10);
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());
currDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
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"))
......@@ -151,7 +166,7 @@ conn = getConnection();
itmCode = rs.getString(2) == null ? "":rs.getString(2);
grpCode = rs.getString(3) == null ? "":rs.getString(3);
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();
......@@ -160,7 +175,7 @@ conn = getConnection();
rs = null;
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
procDate2d = sdf.format(procDate2ts);
procDate2d = sdf.format(procDate2ts); // procDate2d : [01/06/12]
......@@ -188,9 +203,12 @@ conn = getConnection();
if(prdCdUpto == "" || prdCdUpto.trim().length() == 0 )
{
sql = "select code from period where '"+procDate2d+"' between fr_date and to_date";
//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 ? between fr_date and to_date";
pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,procDate2ts);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -201,9 +219,12 @@ conn = getConnection();
pstmt = null;
rs = null;
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))";
//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 ? between fr_date and to_date))";
pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,currentDate);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -226,9 +247,12 @@ conn = getConnection();
}
sql = "select code from period where '"+currAppdate+"' between fr_date and to_date";
//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 ? between fr_date and to_date";
pstmt=conn.prepareStatement(sql);
//Added by sarita on 06 JUN 2018
pstmt.setTimestamp(1,currentDate);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -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 = ?";
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(3, tranId);
pstmt.setString(4, transer);
......@@ -350,9 +375,10 @@ conn = getConnection();
totval = totval + revalamt;
//ldDate = procdate;
pdate = formatter.parse(procDate2d);
pdate = formatter.parse(procDate2d); //Jun 01 00:00:00 GMT+05:30 18
cdate = formatter.parse(currAppdate);
System.out.println("procDate2d : ["+procDate2d+"] \t currAppdate : ["+currAppdate+"] \t pdate : ["+pdate+"] \t cdate ["+cdate+"]");
do {
pdate = addMonths(pdate, 3);
......
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