Commit 6416559e authored by wansari's avatar wansari

W16IBAS005 updated source to check retRep flag if type is changed to P in edit...

W16IBAS005 updated source to check retRep flag if type is changed to P in edit mode then only allow to deallocate.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43862 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 42a38358
...@@ -79,6 +79,7 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn ...@@ -79,6 +79,7 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
InvAllocTraceBean invAllocTrace = new InvAllocTraceBean(); InvAllocTraceBean invAllocTrace = new InvAllocTraceBean();
NodeList parentNodeList = null; NodeList parentNodeList = null;
Node parentNode = null; Node parentNode = null;
String retRepFlag = "";//Added by wasim on 19-MAY-17
try try
{ {
distStkUpd = getComponent("DistStkUpd"); distStkUpd = getComponent("DistStkUpd");
...@@ -106,7 +107,8 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn ...@@ -106,7 +107,8 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
retFlg = genericUtility.getColumnValueFromNode("ret_rep_flag",currDetail); retFlg = genericUtility.getColumnValueFromNode("ret_rep_flag",currDetail);
if (retFlg.equalsIgnoreCase("P")) //Changed by wasim on 19-MAY-2017 to comment this condition as retFlag will be checked below from database, if P-->Deallocate else if R-->bypass
//if (retFlg.equalsIgnoreCase("P"))
{ {
lineNo = genericUtility.getColumnValueFromNode("line_no",currDetail); lineNo = genericUtility.getColumnValueFromNode("line_no",currDetail);
itemCode = genericUtility.getColumnValueFromNode("item_code",currDetail); itemCode = genericUtility.getColumnValueFromNode("item_code",currDetail);
...@@ -115,8 +117,14 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn ...@@ -115,8 +117,14 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
lotSl = genericUtility.getColumnValueFromNode("lot_sl",currDetail); lotSl = genericUtility.getColumnValueFromNode("lot_sl",currDetail);
stmt = conn.createStatement(); stmt = conn.createStatement();
//Changed by wasim on 19-May-2017 for checking ret_rep_flag if it is R(Return) present in database then not allow to deallocate [START]
/*
sqlStr = "SELECT QUANTITY,item_code,loc_code,lot_no,lot_sl FROM SRETURNDET WHERE TRAN_ID = '"+tranId+"'" + sqlStr = "SELECT QUANTITY,item_code,loc_code,lot_no,lot_sl FROM SRETURNDET WHERE TRAN_ID = '"+tranId+"'" +
" AND LINE_NO = "+lineNo+""; //Omited the single quotes as it is not working in DB2 //Gulzar 09-01-07 " AND LINE_NO = "+lineNo+""; //Omited the single quotes as it is not working in DB2 //Gulzar 09-01-07
*/
sqlStr = "SELECT QUANTITY,ITEM_CODE,LOC_CODE,LOT_NO,LOT_SL,RET_REP_FLAG FROM SRETURNDET WHERE TRAN_ID = '"+tranId+"'" +
" AND LINE_NO = "+lineNo+"";
//Changed by wasim on 19-May-2017 for checking ret_rep_flag if it is R(Return) present in database then not allow to deallocate [END]
System.out.println("sqlStr :: " + sqlStr); System.out.println("sqlStr :: " + sqlStr);
rs = stmt.executeQuery(sqlStr); rs = stmt.executeQuery(sqlStr);
if(rs.next()) if(rs.next())
...@@ -126,13 +134,23 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn ...@@ -126,13 +134,23 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
locCode = rs.getString("loc_code"); locCode = rs.getString("loc_code");
lotNo = rs.getString("lot_no"); lotNo = rs.getString("lot_no");
lotSl = rs.getString("lot_sl"); lotSl = rs.getString("lot_sl");
//Added by wasim on 19-May-2017
retRepFlag = rs.getString("RET_REP_FLAG");
} }
rs.close(); rs.close();
rs = null; rs = null;
stmt.close(); stmt.close();
stmt = null; stmt = null;
//Changed by wasim on 19-May-2017 for checking ret_rep_flag if it is R(Return) present in database then not allow to deallocate [START]
System.out.println("Database Old ReturnFlag ["+retRepFlag+"]");
if("R".equalsIgnoreCase(retRepFlag))
{
System.out.println("Previous return type was R (Return) so stock will not be De-allocated");
}
else //Old logic inside else
{
//Changed by wasim on 19-May-2017 for checking ret_rep_flag if it is R(Return) present in database then not allow to deallocate [END]
lineNo =" " + lineNo; lineNo =" " + lineNo;
System.out.println("Line No : lineNo := "+lineNo); System.out.println("Line No : lineNo := "+lineNo);
quantity = Double.parseDouble(qtyStr); quantity = Double.parseDouble(qtyStr);
...@@ -185,7 +203,7 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn ...@@ -185,7 +203,7 @@ public class SReturnPrs extends ValidatorEJB implements SReturnPrsLocal, SReturn
{ {
throw new Exception ("Exception while deallocating old allocation"); throw new Exception ("Exception while deallocating old allocation");
} }
}
} }
} }
} }
......
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