Commit 72f01044 authored by smanohar's avatar smanohar

loginEmpcode in extraparm is blank in such case emp_code taken from users table

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213892 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8df49002
......@@ -77,7 +77,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
String sql = "",sql1 = "";
PreparedStatement pstmt = null,pstmt1=null;
String errString = null;
String errString = null, userid = "";
String confirm = "",status= "" ,indNo = "",reason = "" ,pordType = "",ediOption = "",userIdOp="",
projCode = "",suppCode= "" , pordSite = "";
String loginEmpCode="";
......@@ -101,58 +101,28 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
conn.setAutoCommit(false);
}
//Changes and Commented By Bhushan on 09-06-2016 :END
System.out.println("PorderConf CONFIRM called xtraParams[" + xtraParams+ "]");
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
if(loginEmpCode == null || loginEmpCode.trim().length() == 0)
{
errString = itmDBAccessLocal.getErrorString("", "EMPAPRV", "","",conn);
return errString;
}
sql = " select confirmed,status,(case when workflow_status is null then '0' else workflow_status end) , pord_type, site_code__bill ," +
" proj_code,tot_amt,ord_amt, tot_amt * exch_rate,supp_code, site_code__dlv from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pOrder);
userid = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
pstmt = conn.prepareStatement("select emp_code from users where code = ?");
pstmt.setString(1, userid);
rs = pstmt.executeQuery();
if (rs.next())
{
confirm = checkNull(rs.getString("confirmed"));
status = checkNull(rs.getString("status"));
//wrkStatus = checkNull(rs.ge tString(3));
pordType = checkNull(rs.getString("pord_type"));
//siteCodeBill = checkNull(rs.getString("site_code__bill"));
projCode = checkNull(rs.getString("proj_code"));
amount = rs.getDouble(7);
suppCode = checkNull(rs.getString("supp_code"));
pordSite = checkNull(rs.getString("site_code__dlv"));
hnetAmt =rs.getDouble("tot_amt");
hordAmt =rs.getDouble("ord_amt");
loginEmpCode = checkNull(rs.getString("emp_code"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
sql = " select confirm_mode,(case when workflow_opt is null then '0' else workflow_opt end), edi_option " +
" from transetup where tran_window = 'w_porder'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next())
{
ediOption = checkNull(rs.getString("edi_option"));
//wrkOpt = checkNull(rs.getString(2));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if("Y".equalsIgnoreCase(confirm))
{
errString = itmDBAccessLocal.getErrorString("", "VTPOCONF", "","",conn);
return errString;
}
else if("C".equalsIgnoreCase(status) || "X".equalsIgnoreCase(status))
if(loginEmpCode == null || loginEmpCode.trim().length() == 0)
{
errString = itmDBAccessLocal.getErrorString("", "VTPOCONF2", "","",conn);
errString = itmDBAccessLocal.getErrorString("", "EMPAPRV", "","",conn);
return errString;
}
......@@ -196,6 +166,14 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
ordQty = rs.getDouble(7);
reason = rs.getString(8);
userIdOp = rs.getString(9);
pstmt1 = conn.prepareStatement("select edi_option from transetup where tran_window = 'w_porder'");
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
ediOption = rs1.getString(1);
}
rs1.close();rs1 = null;
pstmt1.close();pstmt1 = null;
sql1 = " select case when (sum(case when porddet.quantity__stduom is null then 0 else porddet.quantity__stduom end ))" +
" is null then 0 else (sum(case when porddet.quantity__stduom is null then 0 else porddet.quantity__stduom end ))" +
......@@ -765,6 +743,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
System.out.println("errString>>>"+errString);
System.out.println("ediOption"+ediOption);
ediOption = ediOption != null?ediOption:"0";
if (ediOption == null || ediOption.trim().length() == 0 || "null".equals(ediOption))
{
ediOption = "0";
}
int ediOpt = Integer.parseInt(ediOption);
System.out.println("ediOpt"+ediOpt +"ediOption"+ediOption);
if(ediOpt > 0)
......
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