Commit 5f23e66b authored by ssalve's avatar ssalve

Sarita : Done changes to show error message on approve in indent sataus is A =...

Sarita : Done changes to show error message on approve in indent sataus is A = Approved , O = Ordered , C = Closed , L = Completed and X = Cancelled on 07 JUN 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186129 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 054e8fe8
......@@ -115,7 +115,40 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
rs = null;
}
if("U".equalsIgnoreCase(mstatus))
//Added by sarita on 07 JUN 2018 to show error message if status is A=Approved , O=Ordered , C=Close , L=Complete and X=Cancelled [START]
if("A".equalsIgnoreCase(mstatus))
{
errCode = "VTINDCNF01"; //Indent is Already Approved , Cannot Approve Again.
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if ("O".equalsIgnoreCase(mstatus))
{
errCode = "VTINDCNF02"; //Selected Indent is Ordered , Cannot Approved.
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if("C".equalsIgnoreCase(mstatus))
{
errCode = "VTINDCNF03"; //Select Indent is Closed , Cannot Approve.
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if("L".equalsIgnoreCase(mstatus))
{
errCode = "VTINDCNF04"; //Select Indent is Completed , Cannot Approve.
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else if("X".equalsIgnoreCase(mstatus))
{
errCode = "VTINDCNF05"; //Selected Indent is Cancelled , Cannot Approve.
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
//Added by sarita on 07 JUN 2018 to show error message if status is A=Approved , O=Ordered , C=Close , L=Complete and X=Cancelled [END]
//if("U".equalsIgnoreCase(mstatus))
else if("U".equalsIgnoreCase(mstatus))
{
sql = "SELECT EMP_CODE, USR_LEV FROM USERS WHERE CODE = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -147,8 +180,8 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
//ls_errcode = 'VTNOAPRRHT~t'+'Not Authorised For Approval or Indent Approver is null'
}*/
//commented by Nandkumar gadkari on 26/03/18 To remove mandatory purchaser and approver employee code------------end-------------
}
//Added by sarita as this code is aaplicable only for mstatus = 'U' hense shifted in this condition on 07 JUN 2018 [START]
sql = "SELECT EMP_CODE FROM USERS WHERE CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId);
......@@ -171,6 +204,60 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
{
mstatus = "A";
}
if(errCode.length() == 0)
{ // CHANGES IN IF CONDITION by Nandkumar gadkari on 26/03/18 ---
if((ls_emp_code__iapr.length() > 0 && li_level.length() > 0 )&& !ls_login_emp.equalsIgnoreCase(ls_emp_code__iapr))
{
errCode = roleUser(ls_sitecode, ls_itemcode, userId, "IND", ls_runopt, conn);
}
}
if(errCode.length() == 0)
{
errCode = approveIndent(tranId, "1", userId, xtraParams, conn);
}
if(errCode.length() != 0)
{
isError = true;
}
else if(errCode.length() == 0)
{
isError = false;
//Changed by wasim on 13-JUN-17 to change proper messages code.
//errCode = "CONFSUCESS";
errCode = "VTINDAPR";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
//Added by sarita as this code is aplicable only for mstatus = 'U' hense shifted in this condition on 07 JUN 2018 [END]
}
//Commented by sarita as this code is aplicable only for mstatus = 'U' hense shifted in particular 'else if("U".equalsIgnoreCase(mstatus))' condition on 07 JUN 2018 [START]
/*sql = "SELECT EMP_CODE FROM USERS WHERE CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId);
rs = pstmt.executeQuery();
if(rs.next())
{
ls_ecode = checkNullAndTrim(rs.getString("EMP_CODE"));
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(ls_ecode.equalsIgnoreCase(ls_emp_code__iapr))
{
mstatus = "A";
}*/
//Commented by sarita as this code is aplicable only for mstatus = 'U' hense shifted in particular 'else if("U".equalsIgnoreCase(mstatus))' condition on 07 JUN 2018 [END]
//commented by Nandkumar gadkari on 26/03/18 To remove mandatory purchaser and approver employee code------------Start-------------
/*else
......@@ -181,7 +268,8 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
}*/
//commented by Nandkumar gadkari on 26/03/18 To remove mandatory purchaser and approver employee code------------end-------------
if(errCode.length() == 0)
//Commented by sarita as this code is aaplication only for mstatus = 'U' hense shifted in particular 'else if("U".equalsIgnoreCase(mstatus))' condition on 07 JUN 2018 [START]
/*if(errCode.length() == 0)
{ // CHANGES IN IF CONDITION by Nandkumar gadkari on 26/03/18 ---
if((ls_emp_code__iapr.length() > 0 && li_level.length() > 0 )&& !ls_login_emp.equalsIgnoreCase(ls_emp_code__iapr))
{
......@@ -206,8 +294,8 @@ public class IndentConf extends ActionHandlerEJB implements IndentConfLocal, Ind
errCode = "VTINDAPR";
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
}*/
//Commented by sarita as this code is aplicable only for mstatus = 'U' hense shifted in particular 'else if("U".equalsIgnoreCase(mstatus))' condition on 07 JUN 2018 [END]
int errListSize = errList.size();
cnt = 0;
String errFldName = null;
......
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