Commit 92fe6c12 authored by ssalve's avatar ssalve

Sarita : Done changes to get available from invstat using loc code and check...

Sarita : Done changes to get available from invstat using loc code and check before splitting the records on 30 OCT 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192466 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4e2745e9
...@@ -122,6 +122,9 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -122,6 +122,9 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
//changes by sarita 19MARCH2018 //changes by sarita 19MARCH2018
String statusSrl = ""; String statusSrl = "";
int cnt = 0; int cnt = 0;
//Added by sarita on 29 OCT 2018 [START]
String avalibleFrLocCode = "";
//Added by sarita on 29 OCT 2018 [END]
try try
{ {
//conn = getConnection(); //conn = getConnection();
...@@ -178,7 +181,17 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -178,7 +181,17 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
//Added by sarita on 14APR2018 [end]to validate item_code as inv_srno_reqd is 'Y' or 'N' //Added by sarita on 14APR2018 [end]to validate item_code as inv_srno_reqd is 'Y' or 'N'
//Showing Error Message Transaction Splitted Already.[end] //Showing Error Message Transaction Splitted Already.[end]
sql = "select count(*) as cnt from stock where ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND quantity > 0"; //Commented & Added by sarita to perform validation on location as location should not be GIT Location on 29 OCT 2018 [START]
//sql = "select count(*) as cnt from stock where ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND quantity > 0";
sql = "select count(*) as cnt , a.available "
+ "from invstat a , Location b , Stock c "
+ "where a.inv_stat = b.inv_stat "
+ "AND b.loc_code = c.loc_code "
+ "AND c.ITEM_CODE = ? "
+ "AND c.LOT_NO = ? "
+ "AND c.LOT_SL = ? "
+ "AND c.quantity > 0 "
+ "group by a.available";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCodeHdr); pstmt.setString(1, itemCodeHdr);
pstmt.setString(2, lotNoHdr); pstmt.setString(2, lotNoHdr);
...@@ -187,8 +200,9 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -187,8 +200,9 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
if(rs.next()) if(rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
System.out.println("Total Records of Stock ::"+cnt); avalibleFrLocCode = rs.getString("available");
} }
System.out.println("[SRLContainerSplit] Count is ["+cnt+"] && Available in invstat is ["+avalibleFrLocCode+"]");
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
...@@ -217,6 +231,16 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -217,6 +231,16 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
isError = true; isError = true;
return retSting; return retSting;
} }
else if("N".equalsIgnoreCase(avalibleFrLocCode))
{
System.out.println("COUNT if available is N ["+cnt+"]");
retSting = itmDBAccessEJB.getErrorString("", "VTINVGIT", "", "", conn);//Please check the GIT Location Code, it does not exists or not for internal use.
isError = true;
return retSting;
}
//Commented & Added by sarita to perform validation on location as location should not be GIT Location on 29 OCT 2018 [START]
//changes by sarita (quantity > 0) on 18MARCH 2018 //changes by sarita (quantity > 0) on 18MARCH 2018
sql = "SELECT SITE_CODE , LOC_CODE , ITEM_SER, QUANTITY, UNIT, GRADE , CREA_DATE , EXP_DATE , LTRAN_DATE , REMARKS , INV_STAT ," + sql = "SELECT SITE_CODE , LOC_CODE , ITEM_SER, QUANTITY, UNIT, GRADE , CREA_DATE , EXP_DATE , LTRAN_DATE , REMARKS , INV_STAT ," +
"ALLOC_QTY , PACK_CODE , MFG_DATE , SITE_CODE__MFG , POTENCY_PERC , LAST_RCP_DATE , LAST_ISS_DATE , RATE , LAST_PHYC_DATE , " + "ALLOC_QTY , PACK_CODE , MFG_DATE , SITE_CODE__MFG , POTENCY_PERC , LAST_RCP_DATE , LAST_ISS_DATE , RATE , LAST_PHYC_DATE , " +
...@@ -279,7 +303,6 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -279,7 +303,6 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
considerAllocate = checkNull(rsStock.getString("consider_allocate")); considerAllocate = checkNull(rsStock.getString("consider_allocate"));
System.out.println("Value of Quantity is :: ["+quantity+"]"); System.out.println("Value of Quantity is :: ["+quantity+"]");
if(!issueCondition && !(quantity==0)) if(!issueCondition && !(quantity==0))
{ {
...@@ -748,8 +771,6 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS ...@@ -748,8 +771,6 @@ public class SRLContainerSplit extends ActionHandlerEJB implements SRLContainerS
try try
{ {
CommonDBAccessEJB dbAccessRemote = new CommonDBAccessEJB(); CommonDBAccessEJB dbAccessRemote = new CommonDBAccessEJB();
UserInfoBean userInfo = dbAccessRemote.createUserInfo(userId); UserInfoBean userInfo = dbAccessRemote.createUserInfo(userId);
......
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