Commit 197b73dc authored by vkadam's avatar vkadam

Change in transfer of praportionet quantity from one location to another location.

Also the change in transfer stock from one location to another location.
During different condition by Manoj sir.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97986 ce508802-f39f-4f6c-b175-0d175dae99d5
parent abe61d19
...@@ -1448,7 +1448,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1448,7 +1448,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
hashMap.put("loc_code",locCodeFr); hashMap.put("loc_code",locCodeFr);
hashMap.put("lot_no",lotno); hashMap.put("lot_no",lotno);
hashMap.put("lot_sl",lotsl); hashMap.put("lot_sl",lotsl);
hashMap.put("alloc_qty", aldAllocQty); //hashMap.put("alloc_qty", aldAllocQty);
hashMap.put("alloc_qty", -1*Double.parseDouble(allocQty));
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI"); hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode")); hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId")); hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
...@@ -1560,6 +1561,11 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1560,6 +1561,11 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
String deAllocated="N";
if( batchQuantity == totWoQty)
{
deAllocated="Y";
}
if(count == 0) if(count == 0)
{ {
...@@ -1597,7 +1603,23 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1597,7 +1603,23 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " Insert into inv_alloc_det(TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE,LOT_NO,LOT_SL,QUANTITY,REMARKS,REAS_CODE,LOC_CODE,EXP_LEV,ISSUE_QTY)" + sql="update inv_alloc_det set quantity=quantity-?,alloc_qty=alloc_qty-?,DEALLOC_QTY=DEALLOC_QTY+? where tran_id=? and site_code=? and item_code=? and lot_no=? and lot_sl=? and loc_code=?";
pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,actualPropQty);
pstmt.setDouble(2,actualPropQty);
pstmt.setDouble(3,actualPropQty);
pstmt.setString(4,tranId);
pstmt.setString(5,siteCode);
pstmt.setString(6,itemCode);
pstmt.setString(7,lotno);
pstmt.setString(8,lotsl);
pstmt.setString(9,locCodeFr);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
pstmt = null;
sql = " Insert into inv_alloc_det(TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE,LOT_NO,LOT_SL,QUANTITY,REMARKS,REAS_CODE,LOC_CODE,EXP_LEV,ALLOC_QTY)" +
" values (?,?,?,?,?,?,?,?,?,?,?,?)"; " values (?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
...@@ -1616,7 +1638,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1616,7 +1638,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " update inv_alloc_det set quantity = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; /*sql = " update inv_alloc_det set quantity = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
System.out.println(" SQL::update"+sql); System.out.println(" SQL::update"+sql);
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(actualQty - actualPropQty)); pstmt.setDouble(1,(actualQty - actualPropQty));
...@@ -1629,7 +1651,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1629,7 +1651,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;*/
} }
} }
else else
...@@ -1650,26 +1672,41 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1650,26 +1672,41 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.close(); pstmt.close();
pstmt = null;*/ pstmt = null;*/
sql = " update inv_alloc_det set quantity = ? , " + sql = " update inv_alloc_det set quantity = quantity-? ,alloc_qty=alloc_qty-? , " +
" DEALLOC_QTY = ? , DEALLOCATED = 'Y' " + " DEALLOC_QTY = DEALLOC_QTY+? , DEALLOCATED = '"+deAllocated+"' " +
" where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; " where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
System.out.println(" SQL::update"+sql); System.out.println(" SQL::update"+sql);
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(actualQty - actualPropQty)); pstmt.setDouble(1,actualPropQty);
pstmt.setDouble(2,(actualPropQty)); pstmt.setDouble(2,actualPropQty);
pstmt.setString(3,tranId); pstmt.setDouble(3,actualPropQty);
pstmt.setString(4,itemCode); pstmt.setString(4,tranId);
pstmt.setString(5,lotno); pstmt.setString(5,itemCode);
pstmt.setString(6,lotsl); pstmt.setString(6,lotno);
pstmt.setString(7,locCodeFr); pstmt.setString(7,lotsl);
pstmt.setString(8,siteCode); pstmt.setString(8,locCodeFr);
pstmt.setString(9,siteCode);
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " update inv_alloc_det set quantity = quantity+? , alloc_qty = alloc_qty+? " +
double lcToqty=0.0; " where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(actualPropQty));
pstmt.setDouble(2,(actualPropQty));
pstmt.setString(3,tranId);
pstmt.setString(4,itemCode);
pstmt.setString(5,lotno);
pstmt.setString(6,lotsl);
pstmt.setString(7,locCodeTo);
pstmt.setString(8,siteCode);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
pstmt = null;
/*double lcToqty=0.0;
sql = " select quantity from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; sql = " select quantity from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
...@@ -1688,7 +1725,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1688,7 +1725,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
rs = null; rs = null;
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;*/
// comment and modify below by cpatil on 16/04/15 // comment and modify below by cpatil on 16/04/15
/*sql = "update inv_alloc_det set quantity = ? ,ISSUE_QTY = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; /*sql = "update inv_alloc_det set quantity = ? ,ISSUE_QTY = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
...@@ -1707,7 +1744,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1707,7 +1744,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.close(); pstmt.close();
pstmt = null;*/ pstmt = null;*/
sql = " update inv_alloc_det set quantity = ? , alloc_qty = ? " + /*Commented by manoj dtd 20/05/2015
sql = " update inv_alloc_det set quantity = ? , alloc_qty = ? " +
" where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; " where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(lcToqty + actualPropQty)); pstmt.setDouble(1,(lcToqty + actualPropQty));
...@@ -1721,7 +1759,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1721,7 +1759,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;*/
} }
} }
......
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