Commit 12cdd594 authored by caluka's avatar caluka

On clicking confirmation sumitied transactions only confirm


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101509 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1afb1ddd
......@@ -59,8 +59,8 @@ public class EmpTravelInfoConf extends ActionHandlerEJB implements EmpTravelInfo
String userId="",empCode="",status="";
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); System.out.println("--login code--"+userId);
sql = " select count(*) from emp_travel_info where tran_id = ? and emp_code in (SELECT EMP_CODE FROM USERS WHERE CODE = ?)";
//changed by chandrashekar on 05-05-2016
/*sql = " select count(*) from emp_travel_info where tran_id = ? and emp_code in (SELECT EMP_CODE FROM USERS WHERE CODE = ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, userId);
......@@ -76,7 +76,7 @@ public class EmpTravelInfoConf extends ActionHandlerEJB implements EmpTravelInfo
System.out.println("same employee not eligiable to confirme");
retString = itmDBAccess.getErrorString("","VTNTCNF1","");
return retString;
}
}*/
//changes done by Chandrashekar on 15-may-2014
sql = " select status from emp_travel_info where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -92,6 +92,10 @@ public class EmpTravelInfoConf extends ActionHandlerEJB implements EmpTravelInfo
{ System.out.println("Travel information Cancelled");
retString = itmDBAccess.getErrorString("","VTNOTCONF3","");
return retString;
}else if("O".equalsIgnoreCase(status))
{ System.out.println("Travel information not submitted");
retString = itmDBAccess.getErrorString("","VTNOTSUB2","");
return retString;
}
else
{
......@@ -112,17 +116,38 @@ public class EmpTravelInfoConf extends ActionHandlerEJB implements EmpTravelInfo
}
else
{
sql = " update emp_travel_info set confirmed = 'Y' , conf_date = ? where tran_id = ? ";
sql = " select count(*) from emp_travel_info where tran_id = ? and emp_code in (SELECT EMP_CODE FROM USERS WHERE CODE = ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, new java.sql.Timestamp( System.currentTimeMillis() ) );
pstmt.setString(2, tranId);
upd = pstmt.executeUpdate();
pstmt.setString(1, tranId);
pstmt.setString(2, userId);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println(" confirmed transaction:: "+upd);
if(upd > 0)
if(count > 0 )
{
retString = "confirmed";
System.out.println(" transaction confirmed::");
System.out.println("same employee not eligiable to confirm");
retString = itmDBAccess.getErrorString("","VTNTCNF1","");
return retString;
}
else
{
sql = " update emp_travel_info set confirmed = 'Y' , conf_date = ? where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setString(2, tranId);
upd = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println(" confirmed transaction:: " + upd);
if (upd > 0)
{
retString = "confirmed";
System.out.println(" transaction confirmed::");
}
}
}
......@@ -515,6 +540,10 @@ public class EmpTravelInfoConf extends ActionHandlerEJB implements EmpTravelInfo
{ System.out.println("Travel information Cancelled");
retString = itmDBAccess.getErrorString("","VTNOTCONF3","");
return retString;
}else if("O".equalsIgnoreCase(status))
{ System.out.println("Travel information not submitted");
retString = itmDBAccess.getErrorString("","VTNOTSUB2","");
return retString;
}else
{
sql = " select count(*) from emp_travel_info where tran_id = ? and (case when confirmed is null then 'N' else confirmed end = 'Y') ";
......
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