Commit cb0671aa authored by rbhogale's avatar rbhogale

Changed by Rohan on 13-June-13 for shankara changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93214 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6aa39d6f
...@@ -82,6 +82,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -82,6 +82,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
String cartonNo = ""; String cartonNo = "";
String trfStatus = ""; String trfStatus = "";
String supRerplOrder = ""; String supRerplOrder = "";
//chnaged by sankara on 13/06/2013
String unit = "";
String standardUnit = "";
double convQtyStduom = 0.0;
int supReplLine = 0; int supReplLine = 0;
String ptcn = ""; String ptcn = "";
double DeallocQty = 0.0, quantity = 0.0; double DeallocQty = 0.0, quantity = 0.0;
...@@ -172,24 +176,46 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -172,24 +176,46 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
sql = " SELECT DISTINCT D.CARTON_NO, PD.SALE_ORDER , PD.LINE_NO__SORD, PD.ITEM_CODE, PD.EXP_LEV, PD.LOC_CODE__TO, D.LOT_SL, " + sql = " SELECT DISTINCT D.CARTON_NO, PD.SALE_ORDER , PD.LINE_NO__SORD, PD.ITEM_CODE, PD.EXP_LEV, PD.LOC_CODE__TO, D.LOT_SL, " +
//Changed by sumit on 30/03/13 added ptcn column //Changed by sumit on 30/03/13 added ptcn column
//" D.LOC_CODE, PD.LOT_NO, D.QUANTITY, S.CUST_CODE, PH.WAVE_ID, D.PICK_ORDER, D.LINE_NO__PICK, PH.PICK_TYPE " + //" D.LOC_CODE, PD.LOT_NO, D.QUANTITY, S.CUST_CODE, PH.WAVE_ID, D.PICK_ORDER, D.LINE_NO__PICK, PH.PICK_TYPE " +
" D.LOC_CODE, PD.LOT_NO, D.QUANTITY, S.CUST_CODE, PH.WAVE_ID, D.PICK_ORDER, D.LINE_NO__PICK, PH.PICK_TYPE, D.PTCN " + // changed by sankara on 13-06-2013
// " D.LOC_CODE, PD.LOT_NO, D.QUANTITY, S.CUST_CODE, PH.WAVE_ID, D.PICK_ORDER, D.LINE_NO__PICK, PH.PICK_TYPE, D.PTCN "+
" D.LOC_CODE, PD.LOT_NO, D.QUANTITY, S.CUST_CODE, PH.WAVE_ID, D.PICK_ORDER, D.LINE_NO__PICK, PH.PICK_TYPE, D.PTCN,SD.UNIT,SD.UNIT__STD,SD.CONV__QTY_STDUOM " +
//" FROM PICK_ORD_DET PD, PICK_ORD_HDR PH , DEALLOC_ART_DET D, SORDER S , CARTON_MASTER CM " + //" FROM PICK_ORD_DET PD, PICK_ORD_HDR PH , DEALLOC_ART_DET D, SORDER S , CARTON_MASTER CM " +
" FROM PICK_ORD_DET PD, PICK_ORD_HDR PH , DEALLOC_ART_DET D, SORDER S " + // changed by sankara on 13-06-2013
//" FROM PICK_ORD_DET PD, PICK_ORD_HDR PH , DEALLOC_ART_DET D, SORDER S " +
" FROM PICK_ORD_DET PD, PICK_ORD_HDR PH , DEALLOC_ART_DET D, SORDER S,SORDDET SD " +
" WHERE D.TRAN_ID = ? " + " WHERE D.TRAN_ID = ? " +
//" AND D.CARTON_NO = CM.CARTON_NO " + //" AND D.CARTON_NO = CM.CARTON_NO " +
" AND PD.PICK_ORDER = D.PICK_ORDER " + " AND PD.PICK_ORDER = D.PICK_ORDER " +
" AND PD.LINE_NO = D.LINE_NO__PICK " + " AND PD.LINE_NO = D.LINE_NO__PICK " +
" AND PH.PICK_ORDER = PD.PICK_ORDER " + " AND PH.PICK_ORDER = PD.PICK_ORDER " +
" AND PH.SALE_ORDER = S.SALE_ORDER "+ " AND PH.SALE_ORDER = S.SALE_ORDER "+
//changed by sankara on 13-06-2013 start...
" AND PH.SALE_ORDER = SD.SALE_ORDER " +
" AND D.SALE_ORDER = SD.SALE_ORDER " +
" AND PD.LINE_NO__SORD = SD.LINE_NO " +
//changed by sankara on 13-06-2013 end...
" UNION ALL "+ " UNION ALL "+
" SELECT DISTINCT D.CARTON_NO, RD.SALE_ORDER , RD.LINE_NO__SORD, RD.ITEM_CODE, RD.EXP_LEV, RD.LOC_CODE__TO, D.LOT_SL," + " SELECT DISTINCT D.CARTON_NO, RD.SALE_ORDER , RD.LINE_NO__SORD, RD.ITEM_CODE, RD.EXP_LEV, RD.LOC_CODE__TO, D.LOT_SL," +
//Changed by sumit on 30/03/13 added ptcn column //Changed by sumit on 30/03/13 added ptcn column
//" D.LOC_CODE, D.LOT_NO, D.QUANTITY, S.CUST_CODE, D.WAVE_ID, D.PICK_ORDER RDER, D.LINE_NO__PICK, D.PICK_TYPE " + //" D.LOC_CODE, D.LOT_NO, D.QUANTITY, S.CUST_CODE, D.WAVE_ID, D.PICK_ORDER RDER, D.LINE_NO__PICK, D.PICK_TYPE " +
" D.LOC_CODE, D.LOT_NO, D.QUANTITY, S.CUST_CODE, D.WAVE_ID, D.PICK_ORDER RDER, D.LINE_NO__PICK, D.PICK_TYPE, D.PTCN " + // changed by sankara on 13-06-2013
" FROM REPL_ORD_DET RD, REPL_ORD_HDR RH , DEALLOC_ART_DET D, SORDER S " + // " D.LOC_CODE, D.LOT_NO, D.QUANTITY, S.CUST_CODE, D.WAVE_ID, D.PICK_ORDER RDER, D.LINE_NO__PICK, D.PICK_TYPE, D.PTCN "+
" D.LOC_CODE, D.LOT_NO, D.QUANTITY, S.CUST_CODE, D.WAVE_ID, D.PICK_ORDER RDER, D.LINE_NO__PICK, D.PICK_TYPE, D.PTCN,SD.UNIT,SD.UNIT__STD,SD.CONV__QTY_STDUOM " +
// changed by sankara on 13-06-2013
// " FROM REPL_ORD_DET RD, REPL_ORD_HDR RH , DEALLOC_ART_DET D, SORDER S"+
" FROM REPL_ORD_DET RD, REPL_ORD_HDR RH , DEALLOC_ART_DET D, SORDER S, SORDDET SD " +
" WHERE D.TRAN_ID = ? AND RD.REPL_ORDER = D.PICK_ORDER " + " WHERE D.TRAN_ID = ? AND RD.REPL_ORDER = D.PICK_ORDER " +
" AND RD.LINE_NO = D.LINE_NO__PICK AND RH.REPL_ORDER = RD.REPL_ORDER " + " AND RD.LINE_NO = D.LINE_NO__PICK AND RH.REPL_ORDER = RD.REPL_ORDER " +
" AND RH.SALE_ORDER = S.SALE_ORDER "; " AND RH.SALE_ORDER = S.SALE_ORDER" +
// chnaged by sankara on 13-06-2013 start
" AND RH.SALE_ORDER = SD.SALE_ORDER" +
" AND RD.SALE_ORDER = SD.SALE_ORDER " +
" AND RD.LINE_NO__SORD = SD.LINE_NO " +
" AND D.SALE_ORDER = SD.SALE_ORDER " ;
//" AND RD.LINE_NO__SRD = SD.LINE_NO" ;
sql1 = "UPDATE CARTON_MASTER SET STATUS ='R' WHERE CARTON_NO = ? "; sql1 = "UPDATE CARTON_MASTER SET STATUS ='R' WHERE CARTON_NO = ? ";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
...@@ -218,6 +244,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -218,6 +244,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
cartonNo = rs.getString("CARTON_NO"); cartonNo = rs.getString("CARTON_NO");
//Changed by sumit on 30/03/13 //Changed by sumit on 30/03/13
ptcn = rs.getString("PTCN"); ptcn = rs.getString("PTCN");
//changed by sankara on 13/06/2013
unit = rs.getString("UNIT");
standardUnit = rs.getString("UNIT__STD");
convQtyStduom = rs.getDouble("CONV__QTY_STDUOM");
ptcnSET.add(ptcn); ptcnSET.add(ptcn);
saleOrderLine = " " + saleOrderLine; saleOrderLine = " " + saleOrderLine;
saleOrderLine = saleOrderLine.substring(saleOrderLine.length()-3); saleOrderLine = saleOrderLine.substring(saleOrderLine.length()-3);
...@@ -226,11 +256,32 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -226,11 +256,32 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if("S".equalsIgnoreCase(pPickType)) if("S".equalsIgnoreCase(pPickType))
{ {
errString = deallocatedRepl(pickOrder, pickLineNo,pPickType, siteCode, itemCode, lotNo, lotSl, DeallocQty, saleOrder, saleOrderLine, expLev, custCode, xtraParams, waveId,cartonNo, conn); errString = deallocatedRepl(pickOrder, pickLineNo,pPickType, siteCode, itemCode, lotNo, lotSl, DeallocQty, saleOrder, saleOrderLine, expLev, custCode, xtraParams, waveId,cartonNo, conn);
errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, "",conn); // changed by sankara on 13-06-2013
// errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, "",conn);
errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, "",unit,standardUnit,convQtyStduom,conn);
continue; continue;
} }
sql = ""; sql = "";
if(standardUnit == null || standardUnit.trim().length() <= 0 )
{
sql = " SELECT UNIT FROM ITEM WHERE ITEM_CODE = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, pickOrder);
pstmt2.setInt(2, pickLineNo);
rs2 = pstmt2.executeQuery();
if( rs2.next())
{
standardUnit = rs2.getString("UNIT");
}
rs2.close(); rs2 = null;
pstmt2.close(); pstmt2 = null;
}
sql = " SELECT PIH.PICK_ORDER, PIH.PICK_TYPE, PIH.CONFIRMED, PID.LOC_CODE__TO, " + sql = " SELECT PIH.PICK_ORDER, PIH.PICK_TYPE, PIH.CONFIRMED, PID.LOC_CODE__TO, " +
" (CASE WHEN PIH.TRF_STATUS IS NULL THEN 'N' ELSE PIH.TRF_STATUS END) AS TRF_STATUS ,PID.LOC_CODE " + " (CASE WHEN PIH.TRF_STATUS IS NULL THEN 'N' ELSE PIH.TRF_STATUS END) AS TRF_STATUS ,PID.LOC_CODE " +
" FROM PICK_ISS_HDR PIH, PICK_ISS_DET PID WHERE PIH.PICK_ORDER = ? AND PIH.PICK_ORDER = PID.PICK_ORDER " + " FROM PICK_ISS_HDR PIH, PICK_ISS_DET PID WHERE PIH.PICK_ORDER = ? AND PIH.PICK_ORDER = PID.PICK_ORDER " +
...@@ -409,9 +460,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -409,9 +460,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
{ {
System.out.println(update+" wave_task_det update syuccessfully"); System.out.println(update+" wave_task_det update syuccessfully");
} }
// changed by sankara on 13-06-2013
errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, pickOrder,conn); // errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, pickOrder,conn);
errString = sorderDeAllocate(saleOrder, saleOrderLine, itemCode, DeallocQty, expLev, custCode, lotSl, lotNo, locCode, xtraParams, waveId, pickOrder,unit,standardUnit,convQtyStduom,conn);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("errString :"+errString); System.out.println("errString :"+errString);
...@@ -468,6 +519,19 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -468,6 +519,19 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
//
update = 0;
sql = " UPDATE CARTON_MASTER SET CHANGE_STATUS = ? WHERE MASTER_CARTON = " +
" (SELECT MASTER_CARTON FROM CARTON_MASTER WHERE CARTON_NO = ? AND MASTER_CARTON IS NOT NULL)";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, "Y");
pstmt2.setString(2, cartonNo);
update = pstmt2.executeUpdate();
if( update > 0 )
{
System.out.println(" WAVE_STATUS_ORG_DET updated succefully ");
}
pstmt2.close(); pstmt2 = null;
} }
rs.close(); rs = null; rs.close(); rs = null;
...@@ -517,6 +581,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -517,6 +581,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println(" ptcnSET "+ptcnSET); System.out.println(" ptcnSET "+ptcnSET);
System.out.println(" errString "+errString); System.out.println(" errString "+errString);
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label start.
sql = "UPDATE WAVE_STATUS_ORG SET PRINT_STATUS = ? WHERE PTCN = ? ";
pstmt = conn.prepareStatement(sql);
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label end
if(ptcnSET.size() > 0 && errString.trim().length() == 0) if(ptcnSET.size() > 0 && errString.trim().length() == 0)
{ {
String tempPTCN = ""; String tempPTCN = "";
...@@ -526,6 +596,16 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -526,6 +596,16 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
tempPTCN = it.next().toString(); tempPTCN = it.next().toString();
System.out.println(" tempPTCN --> ["+tempPTCN+"]"); System.out.println(" tempPTCN --> ["+tempPTCN+"]");
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label start
pstmt.setString(1, "N");
pstmt.setString(2, tempPTCN);
if( pstmt.executeUpdate() > 0 )
{
System.out.println(" WAVE_STATUS_ORG updated successfully");
}
pstmt.clearParameters();
//Changed by sumit on 04/06/13 updating WAVE_STATUS_ORG to re-print label end.
ConsolidatToDoc conToDoc = new ConsolidatToDoc(); ConsolidatToDoc conToDoc = new ConsolidatToDoc();
errString = conToDoc.process(ptcn, conn,xtraParams); errString = conToDoc.process(ptcn, conn,xtraParams);
if ( errString != null && errString.trim().length() > 0 ) if ( errString != null && errString.trim().length() > 0 )
...@@ -536,8 +616,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -536,8 +616,14 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
} }
//Changed by sumit on 04/06/13 closing prepared statement start
if(pstmt != null)
{
pstmt.close(); pstmt = null;
}
//Changed by sumit on 04/06/13 closing prepared statement end
System.out.println("ret string :"+errString); System.out.println("ret string :"+errString);
//End changes by Gulzar on 5/10/2012
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -608,8 +694,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -608,8 +694,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
return input; return input;
} }
//changed by sankara on 13-06-2013
private String sorderDeAllocate(String saleOrder, String lineNo, String itemCode, double DeallocQty, String expLev,String custCode,String lotSl,String lotNo,String locCode, String xtraParams, String waveId, String pickOrder, Connection conn ) throws ITMException //private String sorderDeAllocate(String saleOrder, String lineNo, String itemCode, double DeallocQty, String expLev,String custCode,String lotSl,String lotNo,String locCode, String xtraParams, String waveId, String pickOrder, Connection conn ) throws ITMException
private String sorderDeAllocate(String saleOrder, String lineNo, String itemCode, double DeallocQty, String expLev,String custCode,String lotSl,String lotNo,String locCode, String xtraParams, String waveId, String pickOrder,String unit,String mbaseUnit,double convQtyStduom, Connection conn ) throws ITMException
{ {
System.out.println("updateSOrder calling .............."); System.out.println("updateSOrder calling ..............");
String updateSorditem = null,updateSordAllocDet=null; String updateSorditem = null,updateSordAllocDet=null;
...@@ -628,6 +715,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -628,6 +715,10 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
double grossWeightItem = 0d; double grossWeightItem = 0d;
double netWeightItem = 0d; double netWeightItem = 0d;
int noArt = 0, totalNoArt = 0; int noArt = 0, totalNoArt = 0;
//Changed By sankara
double convFact = 0,convertQty = 0,qtyStduom = 0,meffQty;
DistCommon disCommon = new DistCommon();
//Connection conn = null; //Connection conn = null;
PreparedStatement pstmt=null, pstmt1 = null,pstmtStock = null; PreparedStatement pstmt=null, pstmt1 = null,pstmtStock = null;
Statement st = null; Statement st = null;
...@@ -635,6 +726,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -635,6 +726,7 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
HashMap invallocTraceMap = new HashMap(); HashMap invallocTraceMap = new HashMap();
//ConnDriver connDriver = new ConnDriver(); //ConnDriver connDriver = new ConnDriver();
InvAllocTraceBean invallocTraceBean = new InvAllocTraceBean(); InvAllocTraceBean invallocTraceBean = new InvAllocTraceBean();
try try
{ {
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code"); siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "site_code");
...@@ -663,6 +755,71 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -663,6 +755,71 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
if (DeallocQty > 0 && saleOrder.trim().length()>0) if (DeallocQty > 0 && saleOrder.trim().length()>0)
{ {
//Change by Sankara.start
if(!unit.equalsIgnoreCase(mbaseUnit))
{
convFact = 0;
ArrayList convQtyList = disCommon.getConvQuantityFact(mbaseUnit, unit, itemCode, DeallocQty, convFact,conn);
System.out.println("convQtyList = "+convQtyList);
convertQty = Double.parseDouble(convQtyList.get(1).toString());
if(convertQty == -999999999)
{
convertQty = 0;
}
}
else
{
convertQty = DeallocQty;
}
/*if(qtyStduom == 0)
{
if(!unit.equalsIgnoreCase(mbaseUnit))
{
if(convQtyStduom != 0)
{
convFact = convQtyStduom;
}
ArrayList convQtyList = disCommon.getConvQuantityFact(unit, mbaseUnit, itemCode, DeallocQty, convFact,conn);
System.out.println("convQtyList = "+convQtyList);
meffQty = Double.parseDouble(convQtyList.get(1).toString());
System.out.println("meffQty ["+meffQty+"]");
if(meffQty == -999999999)
{
meffQty = 0;
}
if (convQtyStduom == 0)
{
convQtyStduom= Double.parseDouble(convQtyList.get(0).toString());
}
}
else
{
meffQty = DeallocQty ;
if (convQtyStduom == 0)
{
convQtyStduom=1;
}
}
qtyStduom = meffQty;
}
*/
qtyStduom = DeallocQty;
System.out.println("Convertd Quantity convertQty BASEUNIT unit------->"+convertQty);
System.out.println("Convertd Quantity qtyStduom UNIT BASEUNIT------->"+qtyStduom);
//Changed by Sankara.end
invallocTraceMap.put("ref_id",saleOrder); invallocTraceMap.put("ref_id",saleOrder);
invallocTraceMap.put("ref_line",lineNo); invallocTraceMap.put("ref_line",lineNo);
errString = invallocTraceBean.updateInvallocTrace(invallocTraceMap,conn); errString = invallocTraceBean.updateInvallocTrace(invallocTraceMap,conn);
...@@ -753,7 +910,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -753,7 +910,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
" AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" + " AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" +
" AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? "; " AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty); //Changed By Sankara
//pstmt.setDouble(1, DeallocQty);
pstmt.setDouble(1, convertQty);
pstmt.setString(2, saleOrder); pstmt.setString(2, saleOrder);
pstmt.setString(3, lineNo); pstmt.setString(3, lineNo);
pstmt.setString(4, expLev); pstmt.setString(4, expLev);
...@@ -801,9 +960,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -801,9 +960,12 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
" AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" + " AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" +
" AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? "; " AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1, DeallocQty); /*pstmt1.setDouble(1, DeallocQty);
pstmt1.setDouble(2, DeallocQty); pstmt1.setDouble(2, DeallocQty);
pstmt1.setDouble(3, DeallocQty); pstmt1.setDouble(3, DeallocQty);*/
pstmt1.setDouble(1, convertQty);
pstmt1.setDouble(2, qtyStduom);
pstmt1.setDouble(3, qtyStduom);
pstmt1.setString(4, saleOrder); pstmt1.setString(4, saleOrder);
pstmt1.setString(5, lineNo); pstmt1.setString(5, lineNo);
pstmt1.setString(6, expLev); pstmt1.setString(6, expLev);
...@@ -822,7 +984,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -822,7 +984,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
//Updating no_art if deallocated quantity after despatch populated //Updating no_art if deallocated quantity after despatch populated
System.out.println(" Updating NO_ART in "); System.out.println(" Updating NO_ART in ");
sql = " SELECT QUANTITY, DESP_ID FROM DESPATCHDET WHERE SORD_NO = ? AND LINE_NO__SORD = ? AND EXP_LEV = ? " + //sql = " SELECT QUANTITY, DESP_ID FROM DESPATCHDET WHERE SORD_NO = ? AND LINE_NO__SORD = ? AND EXP_LEV = ? " +
sql = " SELECT QUANTITY__STDUOM, DESP_ID FROM DESPATCHDET WHERE SORD_NO = ? AND LINE_NO__SORD = ? AND EXP_LEV = ? " +
" AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" + " AND DESP_ID = (SELECT REF_ID FROM WAVE_TASK_DET WHERE WAVE_ID = ? AND REF_SER = 'S-DSP' AND SALE_ORDER = ? )" +
" AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? "; " AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ? AND LOC_CODE = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
...@@ -838,7 +1001,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -838,7 +1001,8 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if( rs1.next()) if( rs1.next())
{ {
quantity = rs1.getDouble("QUANTITY"); //quantity = rs1.getDouble("QUANTITY");
quantity = rs1.getDouble("QUANTITY__STDUOM");
} }
rs1.close(); rs1 = null; rs1.close(); rs1 = null;
pstmt1.close(); pstmt1.close(); pstmt1.close(); pstmt1.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