Commit 6a705aca authored by msharma's avatar msharma

Changes done for Work order stock transfer


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98495 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 42d7b638
...@@ -857,6 +857,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -857,6 +857,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
} }
} }
} }
/*Commented by Manoj dtd 20/08/2015 value set from header
if (childNodeName.equals("work_order")) if (childNodeName.equals("work_order"))
{ {
if(childNode !=null) if(childNode !=null)
...@@ -866,7 +867,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -866,7 +867,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
worder = childNode.getFirstChild().getNodeValue(); worder = childNode.getFirstChild().getNodeValue();
} }
} }
} }*/
if (childNodeName.equals("remarks")) if (childNodeName.equals("remarks"))
{ {
if(childNode !=null) if(childNode !=null)
...@@ -1439,7 +1440,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1439,7 +1440,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
hashMap.put("lot_no",rs.getString("lot_no")); hashMap.put("lot_no",rs.getString("lot_no"));
hashMap.put("lot_sl",rs.getString("lot_sl")); hashMap.put("lot_sl",rs.getString("lot_sl"));
hashMap.put("alloc_qty", -1 * rs.getDouble("quantity")); hashMap.put("alloc_qty", -1 * rs.getDouble("quantity"));
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI"); hashMap.put("chg_win","w_wo_stock_trf");
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"));
hashMap.put("loc_code__fr",rs.getString("loc_code")); hashMap.put("loc_code__fr",rs.getString("loc_code"));
...@@ -1475,7 +1476,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1475,7 +1476,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
//hashMap.put("alloc_qty", aldAllocQty); //hashMap.put("alloc_qty", aldAllocQty);
// hashMap.put("alloc_qty", -1*Double.parseDouble(allocQty)); // hashMap.put("alloc_qty", -1*Double.parseDouble(allocQty));
hashMap.put("alloc_qty", -1*actualPropQty); //VALLABH KADAM change [allocQty] to [actualPropQty] 22/MAY/2015. hashMap.put("alloc_qty", -1*actualPropQty); //VALLABH KADAM change [allocQty] to [actualPropQty] 22/MAY/2015.
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI"); hashMap.put("chg_win","w_wo_stock_trf");
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"));
hashMap.put("loc_code__fr",locCodeFr); hashMap.put("loc_code__fr",locCodeFr);
...@@ -1556,9 +1557,10 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1556,9 +1557,10 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
lotsl=(String) hashMap.get("lot_sl"); lotsl=(String) hashMap.get("lot_sl");
locCodeFr=(String) hashMap.get("loc_code__fr"); locCodeFr=(String) hashMap.get("loc_code__fr");
explev=(String) hashMap.get("exp_lev"); explev=(String) hashMap.get("exp_lev");
actualPropQty=Double.parseDouble(""+hashMap.get("alloc_qty"));//Changed by Manoj dtd 20/08/15 Set value from map instead of dom value
int count = 0,recIn=0 ; int count = 0,recIn=0 ;
sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? " sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? "
+ "and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? "; + "and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? and case when deallocated is null then 'N' else deallocated end <> 'Y' ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
pstmt.setString(2,itemCode); pstmt.setString(2,itemCode);
...@@ -1579,6 +1581,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1579,6 +1581,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
String deAllocated="N"; String deAllocated="N";
System.out.println("batchQuantity["+batchQuantity+"]totWoQty["+totWoQty+"]["+campflag1+"]");
if( (batchQuantity == totWoQty) || campflag1) if( (batchQuantity == totWoQty) || campflag1)
{ {
deAllocated="Y"; deAllocated="Y";
...@@ -1588,7 +1591,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1588,7 +1591,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if( (batchQuantity == totWoQty) || campflag1) if( (batchQuantity == totWoQty) || campflag1)
{ {
sql = " update inv_alloc_det set loc_code = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=?"; sql = " update inv_alloc_det set loc_code = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? and case when deallocated is null then 'N' else deallocated end <> 'Y'";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,locCodeTo); pstmt.setString(1,locCodeTo);
pstmt.setString(2,tranId); pstmt.setString(2,tranId);
...@@ -1624,7 +1627,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1624,7 +1627,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
sql="update inv_alloc_det set quantity=quantity-?,alloc_qty=alloc_qty-?,DEALLOC_QTY=DEALLOC_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=?" + "where tran_id=? and site_code=? and item_code=? and lot_no=? and lot_sl=? and loc_code=?"
+ " AND EXP_LEV=?"; // VALLABH KADAM add [EXP_LEV] 21/MAY/15 + " AND EXP_LEV=? and case when deallocated is null then 'N' else deallocated end <> 'Y'"; // VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,actualPropQty); pstmt.setDouble(1,actualPropQty);
pstmt.setDouble(2,actualPropQty); pstmt.setDouble(2,actualPropQty);
...@@ -1696,9 +1699,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1696,9 +1699,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt = null;*/ pstmt = null;*/
sql = " update inv_alloc_det set quantity = quantity-? ,alloc_qty=alloc_qty-? , " + sql = " update inv_alloc_det set quantity = quantity-? ,alloc_qty=alloc_qty-? , " +
" DEALLOC_QTY = DEALLOC_QTY+? , DEALLOCATED = '"+deAllocated+"' " + " DEALLOC_QTY = DEALLOC_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 = ? "
+ "AND EXP_LEV=?";//VALLABH KADAM add [EXP_LEV] 21/MAY/15 + "AND EXP_LEV=? and case when deallocated is null then 'N' else deallocated end <> 'Y'";//VALLABH KADAM add [EXP_LEV] 21/MAY/15
System.out.println(" SQL::update"+sql); System.out.println(" SQL::update"+sql);
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,actualPropQty); pstmt.setDouble(1,actualPropQty);
...@@ -1718,7 +1721,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1718,7 +1721,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
sql = " update inv_alloc_det set quantity = quantity+? , alloc_qty = alloc_qty+? " + sql = " update inv_alloc_det set quantity = quantity+? , alloc_qty = 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 = ? "
+ "AND EXP_LEV=?";//VALLABH KADAM add [EXP_LEV] 21/MAY/15 + "AND EXP_LEV=? and case when deallocated is null then 'N' else deallocated end <> 'Y'";//VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(actualPropQty)); pstmt.setDouble(1,(actualPropQty));
pstmt.setDouble(2,(actualPropQty)); pstmt.setDouble(2,(actualPropQty));
......
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