Commit b6042f70 authored by ngadkari's avatar ngadkari

Changes in stock update

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196225 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 96d56faf
......@@ -1859,7 +1859,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
System.out.println("termId :"+termId);
chgUser=userId;
chgTerm=termId;
InvAllocTraceBean invBean = new InvAllocTraceBean(); //added by nandkumar gadkari on 24/01/19
......@@ -3833,12 +3833,12 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
break;
}
HashMap invAllocTraceMap = new HashMap();
if(qtyStkAlloc - allocQtyAlloc - holdQtyAlloc >= sordItmQtyallc)
{
updQty = sordItmQtyallc;
sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
/*sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
+"WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
pstmt6 = conn.prepareStatement(sqlAlloc);
pstmt6.setDouble(1,updQty) ;
......@@ -3849,8 +3849,33 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
pstmt6.setString(6,lotSl.trim()) ;
pstmt6.executeUpdate();
pstmt6.close();
pstmt6 = null;
pstmt6 = null;*/
//added by nandkumar gadkari on 24/01/19----------start---------------
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id",saleOrder);
invAllocTraceMap.put("ref_line",lineNo);
invAllocTraceMap.put("site_code",siteCode);
invAllocTraceMap.put("item_code",itemCode);
invAllocTraceMap.put("loc_code",locCode);
invAllocTraceMap.put("lot_no",lotNo);
invAllocTraceMap.put("lot_sl",lotSl);
invAllocTraceMap.put("alloc_qty",updQty);
invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER");
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
if(merrcode != null && merrcode.trim().length() > 0)
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
else
{
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n";
}
//added by nandkumar gadkari on 24/01/19------------- end------------
// inputQtyTotAlloc = inputQtyTotAlloc+inputQtyAlloc;
sordItmQtyallc = 0;
......@@ -3861,7 +3886,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
updQty = qtyStkAlloc - allocQtyAlloc - holdQtyAlloc;
stockBean.setAllocQtyUpd(updQty);
sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
/*sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
+"WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
pstmt6 = conn.prepareStatement(sqlAlloc);
pstmt6.setDouble(1,updQty) ;
......@@ -3872,7 +3897,38 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
pstmt6.setString(6,lotSl.trim()) ;
pstmt6.executeUpdate();
pstmt6.close();
pstmt6 = null;
pstmt6 = null;*/
//added by nandkumar gadkari on 24/01/19----------start---------------
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id",saleOrder);
invAllocTraceMap.put("ref_line",lineNo);
invAllocTraceMap.put("site_code",siteCode);
invAllocTraceMap.put("item_code",itemCode);
invAllocTraceMap.put("loc_code",locCode);
invAllocTraceMap.put("lot_no",lotNo);
invAllocTraceMap.put("lot_sl",lotSl);
invAllocTraceMap.put("alloc_qty",updQty);
invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER");
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
if(merrcode != null && merrcode.trim().length() > 0)
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
else
{
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n";
}
//added by nandkumar gadkari on 24/01/19------------- end------------
sordItmQtyallc = sordItmQtyallc - (qtyStkAlloc - allocQtyAlloc - holdQtyAlloc);
......@@ -4123,7 +4179,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
System.out.println("allocQtyUpd::["+allocQtyUpd+"]");
if(allocQtyUpd > 0)
{
sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
/*sqlAlloc = "UPDATE STOCK SET ALLOC_QTY =(CASE WHEN ALLOC_QTY IS NULL THEN 0 ELSE ALLOC_QTY END) + ? "
+"WHERE ITEM_CODE = ? AND SITE_CODE = ? AND LOC_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
pstmt6 = conn.prepareStatement(sqlAlloc);
pstmt6.setDouble(1,(allocQtyUpd * (-1))) ;
......@@ -4134,28 +4190,57 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
pstmt6.setString(6,lotSl.trim()) ;
pstmt6.executeUpdate();
pstmt6.close();
pstmt6 = null;
pstmt6 = null;*/// commented by nandkumar gadkari on 24/01/19
}
//Pavan R End 12/JAN/18
if(isRejected)
// commented by nandkumar gadkari on 24/01/19
/*if(isRejected)
{
continue;
}
}*/
if(skipline.trim().indexOf("'"+lineNo.trim()) > 0 )
if(skipline.trim().indexOf("'"+lineNo.trim()) > 0 || skiplot.trim().indexOf("'"+lineNo.trim()) > 0 || isRejected)// condition merged by nandkumar gadkari on 24/01/19
{
//added by nandkumar gadkari on 24/01/19----------start---------------
if(allocQtyUpd > 0)
{
HashMap invAllocTraceMap = new HashMap();
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id",saleOrder);
invAllocTraceMap.put("ref_line",lineNo);
invAllocTraceMap.put("site_code",siteCode);
invAllocTraceMap.put("item_code",itemCode);
invAllocTraceMap.put("loc_code",locCode);
invAllocTraceMap.put("lot_no",lotNo);
invAllocTraceMap.put("lot_sl",lotSl);
invAllocTraceMap.put("alloc_qty",allocQtyUpd * (-1));
invAllocTraceMap.put("chg_user",userId);
invAllocTraceMap.put("chg_term",termId);
invAllocTraceMap.put("chg_win","W_SORDER");
merrcode = invBean.updateInvallocTrace(invAllocTraceMap,conn);
if(merrcode != null && merrcode.trim().length() > 0)
{
merrcode = itmDBAccessEJB.getErrorString("VTSTKNOAVL",merrcode,"","",conn);
return merrcode;
}
else
{
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n";
}
} //added by nandkumar gadkari on 24/01/19------------- end------------
System.out.println("Inside Skipline");
continue;
}
if(skiplot.trim().indexOf("'"+lineNo.trim()) > 0 )
/*if(skiplot.trim().indexOf("'"+lineNo.trim()) > 0 )
{
System.out.println("Inside skiplot");
continue;
}
}*/// commented by nandkumar gadkari on 24/01/19
if(stockOpt != 0)
......@@ -4345,7 +4430,7 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
//
//System.out.println("inputQty :"+inputQty);
HashMap invAllocTraceMap = new HashMap();
/*HashMap invAllocTraceMap = new HashMap();
invAllocTraceMap.put("ref_ser","S-ORD");
invAllocTraceMap.put("ref_id",saleOrder);
invAllocTraceMap.put("ref_line",lineNo);
......@@ -4373,7 +4458,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
{
logMsg= saleOrder + "\t" + itemCode + "\t"+locCode + "\t" +lotNo+"\t"+ lineNo + "\tInserted data in INVALLOC_TRACE";
strToWrite=strToWrite+logMsg+"\t\r\n";
}
}*/ //commented by nandkujmar gadkari on 24/01/19
sorderpostedList.add(saleOrder);
totAlloc = totAlloc + inputQty;
......
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