Commit 767a10b8 authored by ppatro's avatar ppatro

Pick Issue Bug as found


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92387 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8f8b1707
...@@ -67,7 +67,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -67,7 +67,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
String pickOrder = ""; String pickOrder = "";
String ptcn = ""; String ptcn = "";
String dExpLev = ""; String dExpLev = "";
String sql = ""; String sql = "",sSQL = "";
String updateSql = ""; String updateSql = "";
java.sql.Timestamp expDate = null; java.sql.Timestamp expDate = null;
...@@ -122,9 +122,11 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -122,9 +122,11 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
PreparedStatement pstmtIss = null; PreparedStatement pstmtIss = null;
PreparedStatement pstmtStock = null; PreparedStatement pstmtStock = null;
PreparedStatement pstmtUpd = null; PreparedStatement pstmtUpd = null;
PreparedStatement pstmtSord = null;
ResultSet rsStock = null; ResultSet rsStock = null;
ResultSet rs = null; ResultSet rs = null;
ResultSet rsIss = null; ResultSet rsIss = null;
ResultSet rsSord = null;
boolean isError = false; boolean isError = false;
PreparedStatement pstmtUpdPickOrdDet =null; PreparedStatement pstmtUpdPickOrdDet =null;
...@@ -594,6 +596,86 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -594,6 +596,86 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
System.out.println("manohar 18/09/12 sordalloc inserted updCnt [" + updCnt + "]"); System.out.println("manohar 18/09/12 sordalloc inserted updCnt [" + updCnt + "]");
} }
else else
{
//Changed By Pragyan19/12/12.start
sSQL = "SELECT COUNT(*) AS COUNT FROM SORDALLOC WHERE "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? ";
int count = 0;
pstmtSord = conn.prepareStatement(sSQL);
pstmtSord.setString(1, saleOrder);
pstmtSord.setString(2, lineNoSord);
pstmtSord.setString(3, itemCode);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpd.setString(4, stagingLoc);
}
else
{
pstmtUpd.setString(4, locCodeTo);
}
pstmtSord.setString(5, lotNo);
pstmtSord.setString(6, lotSl);
rsSord = pstmtSord.executeQuery();
if(rsSord.next())
{
count = rsSord.getInt(1);
}
if(count > 0)
{
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC - ? " //LOC_CODE = ? ,LOT_SL = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, itemCode);
pstmtUpd.setString(5, locCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate();
System.out.println("manohar 19/12/12 sordalloc If alrady exist Location Update updCnt1st [" + updCnt + "]");
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?"
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpd.setString(1, stagingLoc);
}
else
{
pstmtUpd.setString(1, locCodeTo);
}
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, itemCode);
pstmtUpd.setString(5, locCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate();
System.out.println("Pragyan 19/12/12 sordalloc If alrady exist Location Update updCnt2nd [" + updCnt + "]");
}
else
{ {
updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? " updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? " + " WHERE SALE_ORDER = ? AND LINE_NO = ? "
...@@ -619,6 +701,36 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P ...@@ -619,6 +701,36 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
pstmtUpd.setString(7, lotSl); pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
}
//Changed By Pragyan19/12/12.end
/* updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpd.setString(1, stagingLoc);
}
else
{
pstmtUpd.setString(1, locCodeTo);
}
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, itemCode);
pstmtUpd.setString(5, locCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate();*/
System.out.println("manohar 18/09/12 sordalloc Update updCnt [" + updCnt + "]"); System.out.println("manohar 18/09/12 sordalloc Update updCnt [" + updCnt + "]");
} }
......
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