Commit 36e7e47f authored by rbhogale's avatar rbhogale

Changed by Rohan on 29-03-13 for setting actual qty zero impact on wave generation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92894 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ac8de50d
...@@ -78,33 +78,33 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -78,33 +78,33 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//double qtyStduom = 0.0; //double qtyStduom = 0.0;
//double qtyAlloc = 0.0; //double qtyAlloc = 0.0;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
Statement stmt = null,stmt1 = null; //Statement stmt = null,stmt1 = null;
String updateStatus = ""; //String updateStatus = "";
String sqlRepl = ""; //String sqlRepl = "";
String replOrd = ""; //String replOrd = "";
String lineNorepl = ""; //String lineNorepl = "";
String sqlPick = ""; //String sqlPick = "";
String sqlItem = ""; //String sqlItem = "";
String sqlPickUpt = ""; //String sqlPickUpt = "";
String invStat = ""; //String invStat = "";
String casePickLoc = ""; //String casePickLoc = "";
String resrvLoc = ""; //String resrvLoc = "";
String sqlReplOrd1 = ""; //String sqlReplOrd1 = "";
String sqlSordAlloc = "", sqlSord = "", sqlSordItem = "", line = ""; String sqlSordAlloc = "", sqlSord = "", sqlSordItem = "", line = "";
DistCommon discommon = new DistCommon(); DistCommon discommon = new DistCommon();
double qtyAlloc = 0d, qtyStduom = 0d; double qtyAlloc = 0d, qtyStduom = 0d;
int updateCnt = 0, retVal = 0, count =0; int updateCnt = 0, retVal = 0, count =0;
HashMap strAllocate = new HashMap(); HashMap strAllocate = new HashMap();
DistStkUpdLocal distStkUpd = null; DistStkUpdLocal distStkUpd = null;
String sqlReplCase = ""; //String sqlReplCase = "";
String itemCodeOrd = ""; //String itemCodeOrd = "";
String siteCode = ""; String siteCode = "";
java.sql.Date tranDate = null; java.sql.Date tranDate = null;
double caseSize = 0d; //double caseSize = 0d;
String sqlReplUpt = ""; //String sqlReplUpt = "";
double domQty = 0.0; //double domQty = 0.0;
ResultSet rs1 = null; //ResultSet rs1 = null;
PreparedStatement pstmtWave = null; PreparedStatement pstmtWave = null;
ResultSet rsWave = null; ResultSet rsWave = null;
String status = ""; String status = "";
...@@ -118,9 +118,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -118,9 +118,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String sqlUpdate = ""; String sqlUpdate = "";
String pickOrder = ""; String pickOrder = "";
String pickLineNo = ""; String pickLineNo = "";
String sqlpickDet = ""; //String sqlpickDet = "";
String locCodeTo = ""; String locCodeTo = "";
String locCode1 = ""; //String locCode1 = "";
String dockLoc = ""; String dockLoc = "";
//String sqlreplDet = ""; //String sqlreplDet = "";
//Changed by Rohan on 21-09-12 for wave generation reversal.end //Changed by Rohan on 21-09-12 for wave generation reversal.end
...@@ -159,6 +159,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -159,6 +159,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.start //Changed by Rohan on 22-01-13 to cancle independent Repanishment.start
String replOrdOrg = ""; String replOrdOrg = "";
String replLineOrg = ""; String replLineOrg = "";
String invStatLoc = "";
String invPndReserve = "";
String sqlLoc = "";
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end //Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
PreparedStatement pstmtTask = null; PreparedStatement pstmtTask = null;
ResultSet rsTask = null; ResultSet rsTask = null;
...@@ -169,8 +173,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -169,8 +173,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
PreparedStatement pstmtDesp = null; PreparedStatement pstmtDesp = null;
PreparedStatement pstmtReplDet = null; PreparedStatement pstmtReplDet = null;
PreparedStatement pstmtPickIss = null; //PreparedStatement pstmtPickIss = null;
ResultSet rsPickIss = null; //ResultSet rsPickIss = null;
ResultSet rsDesp = null; ResultSet rsDesp = null;
boolean isDespatch = true; boolean isDespatch = true;
...@@ -204,11 +208,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -204,11 +208,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//Changed by Rohan on 10-05-12 to get disparm variable //Changed by Rohan on 10-05-12 to get disparm variable
stagingLoc = discommon.getDisparams( "999999", "STAGING_LOC", conn ); stagingLoc = discommon.getDisparams( "999999", "STAGING_LOC", conn );
stagingLocMpick = discommon.getDisparams( "999999", "STAGING_LOC_MPK", conn ); stagingLocMpick = discommon.getDisparams( "999999", "STAGING_LOC_MPK", conn );
dsoInvstat = discommon.getDisparams( "999999", "DEEP_STORE_INVSTAT", conn ); dsoInvstat = discommon.getDisparams( "999999", "DEEP_STORE_INVSTAT", conn );
invPndReserve = discommon.getDisparams("999999","PND_INVSTAT",conn);
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
java.sql.Timestamp currDate = new java.sql.Timestamp( System.currentTimeMillis() ); //java.sql.Timestamp currDate = new java.sql.Timestamp( System.currentTimeMillis() );
distStkUpd = getComponent("DistStkUpd"); distStkUpd = getComponent("DistStkUpd");
//Changed by Rohan on 21-09-12 for wave generation reversal.start //Changed by Rohan on 21-09-12 for wave generation reversal.start
...@@ -399,7 +403,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -399,7 +403,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
//to update actual quantity in replanishment //to update actual quantity in replanishment
//Changed by Rohan on 22-01-13 to cancle independent Repanishment //Changed by Rohan on 22-01-13 to cancle independent Repanishment
//updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,conn); //updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,conn);
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,waveID,replOrdOrg,replLineOrg,conn); //Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm
//updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,waveID,replOrdOrg,replLineOrg,conn);
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,waveID,replOrdOrg,replLineOrg,conn);
if(updateRecord > 0) if(updateRecord > 0)
{ {
...@@ -508,8 +514,36 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -508,8 +514,36 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{ {
//Changed by Rohan on 22-01-13 to cancle independent Repanishment //Changed by Rohan on 22-01-13 to cancle independent Repanishment
//updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,conn); //updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,conn);
System.out.println("*#$S#$#$#$#$#$#$#$#$#$#$#$#$#$"); //Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,waveID,replOrdOrg,replLineOrg,conn); //updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,true,waveID,replOrdOrg,replLineOrg,conn);
//Changed by Rohan on 26-03-13 not allow to deallocate form pnd location.start
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,waveID,replOrdOrg,replLineOrg,conn);
/*
sqlLoc = "SELECT INV_STAT FROM LOCATION WHERE LOC_CODE = ? ";
pstmtDesp = conn.prepareStatement(sqlLoc);
pstmtDesp.setString(1,locCode);
rsDesp = pstmtDesp.executeQuery();
if(rsDesp.next())
{
invStatLoc = rsDesp.getString("INV_STAT");
}
if(pstmtDesp != null)
{
pstmtDesp.close();
pstmtDesp = null;
}
if(rsDesp != null)
{
rsDesp.close();
rsDesp = null;
}
if(!invStatLoc.trim().equals(invPndReserve.trim()))
{
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,waveID,replOrdOrg,replLineOrg,conn);
}
*/
//Changed by Rohan on 26-03-13 not allow to deallocate form pnd location.end
} }
//Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.end //Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.end
//Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start //Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start
...@@ -561,7 +595,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -561,7 +595,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{ {
//Changed by Rohan on 22-01-13 to cancle independent Repanishment //Changed by Rohan on 22-01-13 to cancle independent Repanishment
//updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,false,conn); //updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,false,conn);
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,false,waveID,replOrdOrg,replLineOrg,conn); //Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm
//updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,false,waveID,replOrdOrg,replLineOrg,conn);
updateRecord = updateReplanishment(replOrder,replLineNo,pickOrder,pickLineNo,quantity,waveID,replOrdOrg,replLineOrg,conn);
} }
//Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.start //Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.start
//Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start //Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start
...@@ -622,7 +658,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -622,7 +658,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{ {
//Changed by Rohan on 22-01-13 to cancle independent Repanishment //Changed by Rohan on 22-01-13 to cancle independent Repanishment
//updateRecord = updateReplanishment(replPickOrder,replPickLineNo,pickOrder,pickLineNo,quantity,false,conn); //updateRecord = updateReplanishment(replPickOrder,replPickLineNo,pickOrder,pickLineNo,quantity,false,conn);
updateRecord = updateReplanishment(replPickOrder,replPickLineNo,pickOrder,pickLineNo,quantity,false,waveID,replOrdOrg,replLineOrg,conn); //Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm
//updateRecord = updateReplanishment(replPickOrder,replPickLineNo,pickOrder,pickLineNo,quantity,false,waveID,replOrdOrg,replLineOrg,conn);
updateRecord = updateReplanishment(replPickOrder,replPickLineNo,pickOrder,pickLineNo,quantity,waveID,replOrdOrg,replLineOrg,conn);
} }
//Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.end //Changed by Rohan on 03/12/11 not update repanishment in case of stock to dock.end
//Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start //Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.start
...@@ -632,10 +670,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -632,10 +670,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
updateCancelMode(replPickOrder, replPickLineNo,"N",conn); updateCancelMode(replPickOrder, replPickLineNo,"N",conn);
} }
//Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.end //Changed by Rohan on 30-01-13 to set wave cancel mode Y in case of stock to dock.end
/*
if(updateRecord > 0) if(updateRecord > 0)
{ {
System.out.println("Replenishment updated with actual quantity "+quantity+" For replenishment oder :"+replPickOrder +" and line no :"+replPickLineNo); System.out.println("Replenishment updated with actual quantity "+quantity+" For replenishment oder :"+replPickOrder +" and line no :"+replPickLineNo);
} }
*/
break; break;
} }
...@@ -644,7 +684,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -644,7 +684,12 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
while(!"".equalsIgnoreCase(replPickOrder) && !"".equalsIgnoreCase(replPickLineNo)); while(!"".equalsIgnoreCase(replPickOrder) && !"".equalsIgnoreCase(replPickLineNo));
System.out.println("Final location code*****"+locCode+"LoT Sl***"+lotSl); System.out.println("Final location code*****"+locCode+"LoT Sl***"+lotSl);
//Changed by Rohan on 26-03-13 not allow to deallocate form pnd location.end
//if(!invStatLoc.trim().equals(invPndReserve.trim()))
//{
lineNoSord = " " + lineNoSord; lineNoSord = " " + lineNoSord;
sql = "SELECT QTY_ALLOC AS COUNT FROM SORDALLOC " sql = "SELECT QTY_ALLOC AS COUNT FROM SORDALLOC "
...@@ -680,6 +725,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -680,6 +725,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
// 22/02/10 manoharan if allocation found in sordalloc then deallocate // 22/02/10 manoharan if allocation found in sordalloc then deallocate
//if (count > 0 ) // 04/04/12 manoharan //if (count > 0 ) // 04/04/12 manoharan
System.out.println("qtyAlloc["+qtyAlloc+"]");
if (qtyAlloc > 0) // 04/04/12 manoharan if (qtyAlloc > 0) // 04/04/12 manoharan
{ {
if (qtyAlloc - qtyStduom <= 0) if (qtyAlloc - qtyStduom <= 0)
...@@ -775,7 +821,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -775,7 +821,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{ {
System.out.println("distStkUpd.UpdAllocTrace(hashMap) : Sucessuful!"); System.out.println("distStkUpd.UpdAllocTrace(hashMap) : Sucessuful!");
} }
//Changed by Rohna on 26-03-13 for update wave cancel at end.start
/*
sqlUpdate = "UPDATE WAVE_TASK SET CANCEL ='Y' WHERE WAVE_ID = ?" ; sqlUpdate = "UPDATE WAVE_TASK SET CANCEL ='Y' WHERE WAVE_ID = ?" ;
pstmtUpd = conn.prepareStatement(sqlUpdate); pstmtUpd = conn.prepareStatement(sqlUpdate);
pstmtUpd.setString(1, waveID); pstmtUpd.setString(1, waveID);
...@@ -795,11 +842,26 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -795,11 +842,26 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }
*/
}//qty allocate > 0 }//qty allocate > 0
//Changed by Rohna on 26/03/13 for wave Cancellation error if qty <= 0.start
//else
//{
//retString = itmDBAccess.getErrorString("","NTWAVEREV","");
//}
//Changed by Rohna on 26/03/13 for wave Cancellation error if qty <= 0.end
} }
else
}
}
}//while close
//changed by Rohan on 26/03/13 for updating wave status.start
System.out.println("Error in wave Cancel"+retString);
if(("".equalsIgnoreCase(retString) || retString != null) && retString.trim().length() == 0)
{ {
sqlUpdate = "UPDATE WAVE_TASK SET CANCEL ='Y' WHERE WAVE_ID = ?" ; sqlUpdate = "UPDATE WAVE_TASK SET CANCEL ='Y' WHERE WAVE_ID = ?" ;
pstmtUpd = conn.prepareStatement(sqlUpdate); pstmtUpd = conn.prepareStatement(sqlUpdate);
...@@ -820,12 +882,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -820,12 +882,10 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }
}
}
}
}//while close
}
//changed by Rohan on 26/03/13 for updating wave status.end
} }
catch(Exception e) catch(Exception e)
...@@ -856,17 +916,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -856,17 +916,6 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmtReplDet = null; pstmtReplDet = null;
} }
System.out.println("status"+status+"retString"+retString);
if("Y".equalsIgnoreCase(status))
{
retString = itmDBAccess.getErrorString("","WAVENTREV","");
}
if("".equalsIgnoreCase(retString) && retString.trim().length() == 0)
{
System.out.println("Enter Here in Wave CAncelllation c");
retString = itmDBAccess.getErrorString("","WAVEREV","");
}
} }
else if (isError && connStatus) else if (isError && connStatus)
{ {
...@@ -1140,7 +1189,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1140,7 +1189,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
//Changed by Rohan on 22-01-13 to cancle independent Repanishment //Changed by Rohan on 22-01-13 to cancle independent Repanishment
//public int updateReplanishment(String replOrder,String lineNo,String pickOrder,String lineNoPick,double quantity,boolean confirm,Connection conn)throws Exception //public int updateReplanishment(String replOrder,String lineNo,String pickOrder,String lineNoPick,double quantity,boolean confirm,Connection conn)throws Exception
public int updateReplanishment(String replOrder,String lineNo,String pickOrder,String lineNoPick,double quantity,boolean confirm,String waveID,String replOrdOrg,String replLineOrg,Connection conn)throws Exception //Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm
//public int updateReplanishment(String replOrder,String lineNo,String pickOrder,String lineNoPick,double quantity,boolean confirm,String waveID,String replOrdOrg,String replLineOrg,Connection conn)throws Exception
public int updateReplanishment(String replOrder,String lineNo,String pickOrder,String lineNoPick,double quantity,String waveID,String replOrdOrg,String replLineOrg,Connection conn)throws Exception
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -1175,12 +1226,15 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1175,12 +1226,15 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String replOrdDepLine = ""; String replOrdDepLine = "";
int cnt = 0; int cnt = 0;
String sqlDep1 = ""; String sqlDep1 = "";
//Changed by Rohan on 11-02-13 for define variables //Changed by Rohan on 11-02-13 for define variables
double shipperSize = 0.0; double shipperSize = 0.0;
//Chnaged by Rohan on 08-03-13 for define variables
boolean isReplConf = false;
PreparedStatement pstmt2 = null; PreparedStatement pstmt2 = null;
ResultSet rs2 = null; ResultSet rs2 = null;
boolean isDepRepl = false; boolean isDepRepl = false;
boolean isPndRepl = false;
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end //Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
//Changed by Rohan on 18-02-13 for checking repanishment confirm.start //Changed by Rohan on 18-02-13 for checking repanishment confirm.start
String sqlReplConf = ""; String sqlReplConf = "";
...@@ -1224,7 +1278,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1224,7 +1278,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
rs2 = null; rs2 = null;
} }
System.out.println("repl type:::"+replType);
//Changed by Rohan on 18-02-13 for checking repanishment confirm.start //Changed by Rohan on 18-02-13 for checking repanishment confirm.start
//sqlReplConf = "SELECT COUNT(*) AS COUNT FROM REPL_ISS_DET WHERE REPL_ORDER = ? AND LINE_NO__ORD = ?"; //sqlReplConf = "SELECT COUNT(*) AS COUNT FROM REPL_ISS_DET WHERE REPL_ORDER = ? AND LINE_NO__ORD = ?";
sqlReplConf = "SELECT COUNT(*) AS COUNT FROM REPL_ISS_HDR WHERE REPL_ORDER = ? AND CONFIRMED = 'Y' "; sqlReplConf = "SELECT COUNT(*) AS COUNT FROM REPL_ISS_HDR WHERE REPL_ORDER = ? AND CONFIRMED = 'Y' ";
...@@ -1240,7 +1294,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1240,7 +1294,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
replLine1 = replLineOrg; replLine1 = replLineOrg;
do do
{ {
//Changed by Rohan on 26-03-13 for p
//isReplConf = false;
pstmt2.setString(1, replOrd1); pstmt2.setString(1, replOrd1);
//pstmt2.setString(2, replLine1); //pstmt2.setString(2, replLine1);
rs2 = pstmt2.executeQuery(); rs2 = pstmt2.executeQuery();
...@@ -1250,8 +1305,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1250,8 +1305,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
if(cnt > 0) if(cnt > 0)
{ {
//Changed by Rohan on 08-03-13 for checking replanishment confirm or not.start
/*
isDepRepl = true; isDepRepl = true;
break; break;
*/
isReplConf = true;
//isPndRepl = false;
System.out.println("is pnd false and is repl conf");
break;
//Changed by Rohan on 08-03-13 for checking replanishment confirm or not.end
} }
//to check dso-pnd repanishment exist.start //to check dso-pnd repanishment exist.start
pstmt1.setString(1, replOrd1); pstmt1.setString(1, replOrd1);
...@@ -1268,11 +1331,21 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1268,11 +1331,21 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
//to check dso-pnd repanishment exist.end //to check dso-pnd repanishment exist.end
//Changed by Rohan on 08-03-13 for checking replanishment confirm or not.start
System.out.println("checkInvStat"+checkInvStat+"pndLoc"+pndLoc);
if(!"".trim().equalsIgnoreCase(replOrd1) && checkInvStat.trim().equalsIgnoreCase(pndLoc.trim()))
{
isPndRepl = true;
System.out.println("isPndRepl["+isPndRepl+"]");
}
//Changed by Rohan on 08-03-13 for checking replanishment confirm or not.end
pstmt1.clearParameters(); pstmt1.clearParameters();
pstmt2.clearParameters(); pstmt2.clearParameters();
} }
while(!"".equalsIgnoreCase(replOrd1) && checkInvStat.trim().equalsIgnoreCase(pndLoc.trim())); //Chnaged by Rohan on 29-03-13 for check invstat not null
while(!"".equalsIgnoreCase(replOrd1) && !"".equalsIgnoreCase(checkInvStat) && checkInvStat.trim().equalsIgnoreCase(pndLoc.trim()));
if(pstmt1 != null) if(pstmt1 != null)
{ {
...@@ -1357,10 +1430,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1357,10 +1430,13 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
//Changed by Rohan on 04-03-13 for check Depended repanishment.start //Changed by Rohan on 04-03-13 for check Depended repanishment.start
System.out.println("Repanishement Confirm["+isReplConf+"]Is pick dependent["+isDepRepl+"]"+"isPndRepl]"+isPndRepl);
if(isDepRepl) if(isDepRepl)
{ {
//Changed by Rohan on 23-02-13 for not updating actual qty if repanishment is confirm.start
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.end //Changed by Rohan on 22-01-13 to cancle independent Repanishment.end
/*
if(confirm) if(confirm)
{ {
//if(!"C".equalsIgnoreCase(orderType)) //if(!"C".equalsIgnoreCase(orderType))
...@@ -1400,6 +1476,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1400,6 +1476,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
+" WHERE REPL_ORDER = ? AND LINE_NO = ? " +" WHERE REPL_ORDER = ? AND LINE_NO = ? "
+ " AND L.LOC_CODE = D.LOC_CODE "; + " AND L.LOC_CODE = D.LOC_CODE ";
*/ */
/*
getActualQty ="SELECT D.ACTUAL_QTY,L.INV_STAT,D.PICK_ORDER,D.LINE_NO__PICK,I.SHIPPER_SIZE " getActualQty ="SELECT D.ACTUAL_QTY,L.INV_STAT,D.PICK_ORDER,D.LINE_NO__PICK,I.SHIPPER_SIZE "
+" FROM REPL_ORD_DET D,LOCATION L,ITEM_LOT_PACKSIZE I " +" FROM REPL_ORD_DET D,LOCATION L,ITEM_LOT_PACKSIZE I "
+" WHERE REPL_ORDER = ? AND LINE_NO = ? " +" WHERE REPL_ORDER = ? AND LINE_NO = ? "
...@@ -1471,6 +1548,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1471,6 +1548,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY - ?" updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY - ?"
+" WHERE REPL_ORDER = ? AND LINE_NO = ? "; +" WHERE REPL_ORDER = ? AND LINE_NO = ? ";
*/ */
/*
updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?" updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?"
+" WHERE REPL_ORDER = ? AND LINE_NO = ? "; +" WHERE REPL_ORDER = ? AND LINE_NO = ? ";
} }
...@@ -1482,6 +1560,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1482,6 +1560,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET" +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET"
+" WHERE REPL_ORDER = ? AND LINE_NO = ?)"; +" WHERE REPL_ORDER = ? AND LINE_NO = ?)";
*/ */
/*
updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?" updateSql= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?"
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET" +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET"
+" WHERE REPL_ORDER = ? AND LINE_NO = ?)"; +" WHERE REPL_ORDER = ? AND LINE_NO = ?)";
...@@ -1535,7 +1614,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1535,7 +1614,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
}//confirm }//confirm
else else
{ {
ArrayList ReplActQty = updateReplActQty(pickOrder,lineNoPick,conn); */
//}
System.out.println("isReplConf[[["+isReplConf+"]isPndRepl["+isPndRepl);
//Changed by rohan on 28/03/13 for updating actaul qty if dso-pnd repanishmnet sacn
//if(isReplConf)
if(!isReplConf || isPndRepl)
{
ArrayList ReplActQty = updateReplActualQty(pickOrder,lineNoPick,conn);
if(ReplActQty.size() > 0) if(ReplActQty.size() > 0)
{ {
replOrdList = checkNull((String)ReplActQty.get(0)); replOrdList = checkNull((String)ReplActQty.get(0));
...@@ -1546,8 +1634,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1546,8 +1634,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
replOrder = replOrdList; replOrder = replOrdList;
lineNo = replLineNoList; lineNo = replLineNoList;
} }
}
System.out.println("Updating Final Repl Order:::::"+replOrder+"ANd Line No"+lineNo);
sql= "UPDATE REPL_ORD_DET SET ACTUAL_QTY = CASE WHEN ACTUAL_QTY IS NULL THEN 0 ELSE ACTUAL_QTY END + ?" + sql= "UPDATE REPL_ORD_DET SET ACTUAL_QTY = CASE WHEN ACTUAL_QTY IS NULL THEN 0 ELSE ACTUAL_QTY END + ?" +
" WHERE REPL_ORDER = ? AND LINE_NO = ?" ; " WHERE REPL_ORDER = ? AND LINE_NO = ?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1555,6 +1643,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1555,6 +1643,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmt.setString(2, replOrder); pstmt.setString(2, replOrder);
pstmt.setString(3, lineNo); pstmt.setString(3, lineNo);
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
}
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.start //Changed by Rohan on 22-01-13 to cancle independent Repanishment.start
} }
else else
...@@ -1563,6 +1652,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1563,6 +1652,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
sql= "UPDATE REPL_ORD_DET SET ACTUAL_QTY = 0,CANCEL_MODE = 'Y'" + sql= "UPDATE REPL_ORD_DET SET ACTUAL_QTY = 0,CANCEL_MODE = 'Y'" +
" WHERE REPL_ORDER = ? AND LINE_NO = ?" ; " WHERE REPL_ORDER = ? AND LINE_NO = ?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
System.out.println("repl type:::"+replType);
if("Q".equalsIgnoreCase(replType)) if("Q".equalsIgnoreCase(replType))
{ {
pstmt.setString(1, replOrdOrg); pstmt.setString(1, replOrdOrg);
...@@ -1574,11 +1665,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1574,11 +1665,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmt.setString(2, lineNo); pstmt.setString(2, lineNo);
} }
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
System.out.println("replOrdOrg>>"+replOrdOrg+"replLineOrg<<<"+replLineOrg);
if(!"Q".equalsIgnoreCase(replType) && !"C".equalsIgnoreCase(replType)) if(!"Q".equalsIgnoreCase(replType) && !"C".equalsIgnoreCase(replType))
{ {
//Update dependent Repl //Update dependent Repl
updateCancelMode(replOrder,lineNo,"Y",conn); updateCancelMode(replOrdOrg,replLineOrg,"Y",conn);
} }
else if("Q".equalsIgnoreCase(replType)) else if("Q".equalsIgnoreCase(replType))
{ {
...@@ -1625,7 +1716,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1625,7 +1716,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
return count; return count;
} }
//updateReplActQty(pickOrder,lineNoPick,conn); //updateReplActQty(pickOrder,lineNoPick,conn);
public ArrayList updateReplActQty(String pickOrder,String lineNoPick,Connection conn) throws Exception public ArrayList updateReplActualQty(String pickOrder,String lineNoPick,Connection conn) throws Exception
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -1903,15 +1994,21 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1903,15 +1994,21 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
String lineNoRepl = ""; String lineNoRepl = "";
String invStat = ""; String invStat = "";
String sqlPnd = ""; String sqlPnd = "";
String invStatDso ="";
String updateSql = "";
double shipperSize = 0.0; double shipperSize = 0.0;
DistCommon discommon = new DistCommon(); DistCommon discommon = new DistCommon();
//String pndLoc = discommon.getDisparams("999999","PND_INVSTAT",conn); String pndLoc = discommon.getDisparams("999999","PND_INVSTAT",conn);
String deepStoreLoc = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn); String deepStoreLoc = discommon.getDisparams("999999","DEEP_STORE_INVSTAT",conn);
String psoLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn); String psoLoc = discommon.getDisparams("999999","RESERV_LOCATION",conn);
PreparedStatement pstmtRepl = null; PreparedStatement pstmtRepl = null;
PreparedStatement pstmtUpadte = null; PreparedStatement pstmtUpadte = null;
PreparedStatement pstmtUpadtePnd = null;
ResultSet rs = null; ResultSet rs = null;
try try
...@@ -1941,7 +2038,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1941,7 +2038,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
System.out.println("Repanishment Cancle for "+replOrder+" and Repl line no "+replLineNo); System.out.println("Repanishment Cancle for "+replOrder+" and Repl line no "+replLineNo);
} }
sqlReplOrd = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? "; //sqlReplOrd = "SELECT D.PICK_ORDER,D.LINE_NO__PICK FROM REPL_ORD_DET D WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sqlReplOrd = "SELECT D.PICK_ORDER,D.LINE_NO__PICK,L.INV_STAT FROM REPL_ORD_DET D,LOCATION L"
+" WHERE D.REPL_ORDER = ? AND D.LINE_NO = ? AND D.LOC_CODE = L.LOC_CODE ";
pstmtRepl = conn.prepareStatement(sqlReplOrd); pstmtRepl = conn.prepareStatement(sqlReplOrd);
pstmtRepl.setString(1, replOrder); pstmtRepl.setString(1, replOrder);
pstmtRepl.setString(2, replLineNo); pstmtRepl.setString(2, replLineNo);
...@@ -1950,6 +2051,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1950,6 +2051,7 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
{ {
replOrd = checkNull(rs.getString("PICK_ORDER")); replOrd = checkNull(rs.getString("PICK_ORDER"));
lineNoRepl = checkNull(rs.getString("LINE_NO__PICK")); lineNoRepl = checkNull(rs.getString("LINE_NO__PICK"));
invStatDso = checkNull(rs.getString("INV_STAT"));
} }
if(!"".equalsIgnoreCase(replOrd) && replOrd.trim().length() > 0) if(!"".equalsIgnoreCase(replOrd) && replOrd.trim().length() > 0)
{ {
...@@ -1962,6 +2064,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1962,6 +2064,16 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
System.out.println("Repanishment Cancle for "+replOrd+" and Repl line no "+lineNoRepl); System.out.println("Repanishment Cancle for "+replOrd+" and Repl line no "+lineNoRepl);
} }
} }
else if(invStatDso.trim().equalsIgnoreCase(deepStoreLoc.trim()))
{
updateSql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y', ACTUAL_QTY = 0 WHERE PICK_ORDER = ? AND LINE_NO__PICK = ?";
pstmtUpadtePnd = conn.prepareStatement(updateSql);
pstmtUpadtePnd.setString(1, replOrder);
pstmtUpadtePnd.setString(2, replLineNo);
pstmtUpadtePnd.executeUpdate();
}
} }
else if("Y".equalsIgnoreCase(depRepl)) else if("Y".equalsIgnoreCase(depRepl))
{ {
...@@ -2019,6 +2131,20 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2019,6 +2131,20 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
lineNoRepl = checkNull(rs.getString("LINE_NO")); lineNoRepl = checkNull(rs.getString("LINE_NO"));
} }
} }
else if(pndLoc.trim().equalsIgnoreCase(invStat.trim()))
{
System.out.println("Enetr in Pnd Repanishemrnt zero");
//set cancel mode Y and actual qty 0 of an pnd repl repanishment
pstmtUpadte.clearParameters();
pstmtUpadte.setString(1, replOrder);
pstmtUpadte.setString(2, replLineNo);
int cntUpdte1 = pstmtUpadte.executeUpdate();
if(cntUpdte1 > 0)
{
System.out.println("Repanishment Cancle for "+replOrder+" and Repl line no "+replLineNo);
}
}
if(!"".equalsIgnoreCase(replOrd.trim())) if(!"".equalsIgnoreCase(replOrd.trim()))
{ {
pstmtUpadte.clearParameters(); pstmtUpadte.clearParameters();
...@@ -2033,6 +2159,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2033,6 +2159,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
else if("Q".equalsIgnoreCase(depRepl)) else if("Q".equalsIgnoreCase(depRepl))
{ {
//Changed by rohan on 23-03-13 for not update actual qty zero if parent repanishment is scan.start
sqlReplOrd = "";
//Changed by rohan on 23-03-13 for not update actual qty zero if parent repanishment is scan.end
sqlReplOrd = "SELECT L.INV_STAT,I.SHIPPER_SIZE FROM REPL_ORD_DET D,LOCATION L,ITEM_LOT_PACKSIZE I " sqlReplOrd = "SELECT L.INV_STAT,I.SHIPPER_SIZE FROM REPL_ORD_DET D,LOCATION L,ITEM_LOT_PACKSIZE I "
+" WHERE (REPL_ORDER,LINE_NO) IN (SELECT PICK_ORDER,LINE_NO__PICK " +" WHERE (REPL_ORDER,LINE_NO) IN (SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?) " +" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?) "
...@@ -2064,10 +2193,17 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2064,10 +2193,17 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
/*updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?" /*updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?"
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK " +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ) ";*/ +" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ) ";*/
/*
updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ? " updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ? "
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK " +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ) " +" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ) "
+" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' "; +" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' ";
*/
updateReplOrd= " UPDATE REPL_ORD_DET D SET ACTUAL_QTY = ACTUAL_QTY + ? "
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ) "
+" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' "
+" AND D.REPL_ORDER NOT IN (SELECT REPL_ORDER FROM REPL_ISS_HDR WHERE CONFIRMED = 'Y')";
} }
else else
...@@ -2076,11 +2212,20 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2076,11 +2212,20 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK " +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE (REPL_ORDER,LINE_NO) " + +" FROM REPL_ORD_DET WHERE (REPL_ORDER,LINE_NO) " +
" IN (SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?)) ";*/ " IN (SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?)) ";*/
/*
updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?" updateReplOrd= " UPDATE REPL_ORD_DET SET ACTUAL_QTY = ACTUAL_QTY + ?"
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK " +" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE (REPL_ORDER,LINE_NO) " + +" FROM REPL_ORD_DET WHERE (REPL_ORDER,LINE_NO) " +
" IN (SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?)) " " IN (SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?)) "
+" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' "; +" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' ";
*/
updateReplOrd= " UPDATE REPL_ORD_DET D SET ACTUAL_QTY = ACTUAL_QTY + ?"
+" WHERE (REPL_ORDER,LINE_NO) IN(SELECT PICK_ORDER,LINE_NO__PICK "
+" FROM REPL_ORD_DET WHERE (REPL_ORDER,LINE_NO) " +
" IN (SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ?)) "
+" AND CASE WHEN CANCEL_MODE IS NULL THEN 'N' ELSE CANCEL_MODE END <> 'Y' "
+" AND D.REPL_ORDER NOT IN (SELECT REPL_ORDER FROM REPL_ISS_HDR WHERE CONFIRMED = 'Y')";
} }
pstmtUpadte = conn.prepareStatement(updateReplOrd); pstmtUpadte = conn.prepareStatement(updateReplOrd);
...@@ -2115,6 +2260,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -2115,6 +2260,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
pstmtUpadte.close(); pstmtUpadte.close();
pstmtUpadte = null; pstmtUpadte = null;
} }
if(pstmtUpadtePnd != null)
{
pstmtUpadtePnd.close();
pstmtUpadtePnd = null;
}
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
......
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