Commit e555721d authored by vhegde's avatar vhegde

changed by sankara on 05/05/14 updarted replissconf,deallocartconf,shipmentprs for wms


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95023 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 21442c0e
...@@ -1583,7 +1583,23 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -1583,7 +1583,23 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
} }
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
} }
//changed by sankara on 03/05/14 for update actual_qty in repl ord det start.
if( "A".equalsIgnoreCase(pickTye))
{
System.out.println("inside active.....");
sql = "UPDATE REPL_ORD_DET SET ACTUAL_QTY = ( ACTUAL_QTY + ?) WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY >= 0 ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty );
pstmt.setString(2, parentReplOrder);
pstmt.setInt(3, parentReplOrdLine);
update = pstmt.executeUpdate();
if( update > 0 )
{
System.out.println(currentReplOrder+" repl_order of REPL_ISS_DET updated actual_qty successfully ");
}
pstmt.close();pstmt = null;
}
//changed by sankara on 03/05/14 for update actual_qty in repl ord det end.
sql = "UPDATE REPL_ISS_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO__ORD = ?"; sql = "UPDATE REPL_ISS_DET SET DEALLOC_QTY = (CASE WHEN DEALLOC_QTY IS NULL THEN 0 ELSE DEALLOC_QTY END + ?) WHERE REPL_ORDER = ? AND LINE_NO__ORD = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, DeallocQty ); pstmt.setDouble(1, DeallocQty );
...@@ -2297,8 +2313,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo ...@@ -2297,8 +2313,9 @@ public class DeallocArtConf extends ActionHandlerEJB implements DeallocArtConfLo
System.out.println(" WAVE_TASK_DET updated succesfully "); System.out.println(" WAVE_TASK_DET updated succesfully ");
} }
pstmt.close(); pstmt = null; pstmt.close(); pstmt = null;
//changed by sankara on 03/05/14 update cancel_mode for parent repl order only
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? "; //sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? ";
sql = "UPDATE REPL_ORD_DET SET CANCEL_MODE = 'Y' WHERE REPL_ORDER = ? AND LINE_NO = ? AND ACTUAL_QTY IS NOT NULL ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currentReplOrder); pstmt.setString(1, currentReplOrder);
pstmt.setInt(2, replOrderLine); pstmt.setInt(2, replOrderLine);
......
...@@ -304,18 +304,25 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -304,18 +304,25 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmtPick = null; pstmtPick = null;
actualQty = quantity - pickQty; actualQty = quantity - pickQty;
actualAllocQty = getStockQuantity(itemCode,siteCode,locCode,lotNo,lotSl,0.0,true,conn); //Changed By Pragyan 03-May-14 for changed Last case logic if pick quantity > last case.start
if(actualQty > actualAllocQty) actualAllocQty = getStockQuantity(itemCode,siteCode,locCode,lotNo,lotSl,quantity,true,pickQty,conn);
//if(actualQty > actualAllocQty)
if(actualAllocQty != 0.0 && pickQty < actualAllocQty)
{ {
System.out.println("Found Last case Found with Other allocation pickQty["+pickQty+"]quantity ["+quantity+"]Stock alloc qty["+actualAllocQty+"]");
isLastCaseUpDFlag = true; isLastCaseUpDFlag = true;
lastCaseUpdQty = actualQty; lastCaseUpdQty = actualQty;
actualQty = 0.0; //actualQty = 0.0;
actualQty = quantity - actualAllocQty;
System.out.println("Now Actual Quantity to issue ["+actualQty+"]");
} }
//Changed By Pragyan 03-May-14 for changed Last case logic if pick quantity > last case.end
} }
else else
{ {
actualAllocQty = getStockQuantity(itemCode,siteCode,locCode,lotNo,lotSl,0.0,false,conn); actualAllocQty = getStockQuantity(itemCode,siteCode,locCode,lotNo,lotSl,0.0,false,pickQty,conn);
actualQty = quantity - actualAllocQty; actualQty = quantity - actualAllocQty;
} }
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock //Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock
...@@ -448,6 +455,10 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -448,6 +455,10 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
isError = true; isError = true;
break; break;
} }
//Changed By Pragyan 03-May-14 to check if zero issue quantity not to allow.start
if(actualQty > 0.0)
{
updateRowMap.put("tran_type","I"); updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ actualQty);//360 updateRowMap.put("qty_stduom", ""+ actualQty);//360
updateRowMap.put("quantity", ""+actualQty); updateRowMap.put("quantity", ""+actualQty);
...@@ -463,6 +474,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -463,6 +474,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
isError = true; isError = true;
break; break;
} }
}
//Changed By Pragyan 03-May-14 to check if zero issue quantity not to allow.end
updateRowMap.put("qty_stduom", ""+quantity); updateRowMap.put("qty_stduom", ""+quantity);
updateRowMap.put("quantity", ""+quantity); updateRowMap.put("quantity", ""+quantity);
...@@ -934,14 +947,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -934,14 +947,16 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
String sordUpdNo = "",updLineNo = ""; String sordUpdNo = "",updLineNo = "";
sql = " SELECT S.SALE_ORDER, S.LINE_NO,S.QTY_ALLOC, S.EXP_LEV, S.ITEM_CODE, S.LOT_NO, S.LOT_SL, S.LOC_CODE, " + sql = " SELECT S.SALE_ORDER, S.LINE_NO,S.QTY_ALLOC, S.EXP_LEV, S.ITEM_CODE, S.LOT_NO, S.LOT_SL, S.LOC_CODE, " +
" S.ALLOC_MODE,S.QUANTITY FROM SORDALLOC S " + " S.ALLOC_MODE,S.QUANTITY FROM SORDALLOC S " +
" WHERE S.ITEM_CODE = ? AND S.LOT_NO = ? AND S.LOT_SL = ? AND S.LOC_CODE = ? " + " WHERE S.ITEM_CODE = ? AND S.LOT_NO = ? AND S.LOT_SL = ? AND S.LOC_CODE = ? AND CASE WHEN WAVE_FLAG IS NULL THEN 'N' ELSE WAVE_FLAG END <> 'Y' " +
" AND NVL((SELECT COUNT(1) FROM REPL_ORD_DET R WHERE R.SALE_ORDER = S.SALE_ORDER AND R.LINE_NO__SORD = S.LINE_NO ),0) = 0 AND S.QTY_ALLOC >0"; " AND NVL((SELECT COUNT(1) FROM REPL_ORD_DET R WHERE R.SALE_ORDER = S.SALE_ORDER AND R.LINE_NO__SORD = S.LINE_NO ),0) = 0 " +
" AND S.QTY_ALLOC >0 ORDER BY QTY_ALLOC ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode); pstmt1.setString(1, itemCode);
pstmt1.setString(2, lotNo); pstmt1.setString(2, lotNo);
pstmt1.setString(3, lotSl); pstmt1.setString(3, lotSl);
pstmt1.setString(4, locCode); pstmt1.setString(4, locCode);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
remainQty = lastCaseUpdQty; remainQty = lastCaseUpdQty;
while( rs1.next()) while( rs1.next())
...@@ -1934,7 +1949,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -1934,7 +1949,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
return status; return status;
} }
//Changed by sumit on 25/03/13 checking whether all repl is confirmed or not end. //Changed by sumit on 25/03/13 checking whether all repl is confirmed or not end.
public double getStockQuantity(String itemCode,String siteCode,String locCode,String lotNo,String lotSl,double qtyAllocate,boolean isActRepl ,Connection conn) throws Exception public double getStockQuantity(String itemCode,String siteCode,String locCode,String lotNo,String lotSl,double replQty,boolean isActRepl ,double pickQty,Connection conn) throws Exception
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -1982,7 +1997,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -1982,7 +1997,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt = null; pstmt = null;
} }
System.out.println("For deduction ["+qtyAllocate+"]"); System.out.println("For deduction ["+replQty+"]");
System.out.println("quantity["+quantity+"]allocQty["+allocQty+"]holdQty["+holdQty+"]"); System.out.println("quantity["+quantity+"]allocQty["+allocQty+"]holdQty["+holdQty+"]");
/*System.out.println("For Result ["+(quantity - (allocQty - qtyAllocate))+"]"); /*System.out.println("For Result ["+(quantity - (allocQty - qtyAllocate))+"]");
stockQty = quantity - (allocQty - qtyAllocate); stockQty = quantity - (allocQty - qtyAllocate);
...@@ -2020,7 +2035,23 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -2020,7 +2035,23 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
if(isActRepl) if(isActRepl)
{ {
sordAllocQty = quantity - allocQty ; System.out.println("Active repl stock["+quantity+"]Alloc Qty["+allocQty+"]replQty["+replQty+"]sordAllocQty["+sordAllocQty+"]pickQty["+pickQty+"]");
//Changed By Pragyan to proper handle last case.start
if(quantity == replQty)
{
//sordAllocQty = quantity - allocQty ;
sordAllocQty = allocQty ;
}
else if((sordAllocQty == allocQty) && (replQty - pickQty) > 0)
{
sordAllocQty = replQty ;
}
else
{
sordAllocQty = 0.0;
}
//Changed By Pragyan to proper handle last case.end
} }
System.out.println("sordAllocQty["+sordAllocQty+"]"); System.out.println("sordAllocQty["+sordAllocQty+"]");
......
...@@ -938,10 +938,17 @@ public class ShipmentPrs extends ValidatorEJB implements ShipmentPrsLocal, Shipm ...@@ -938,10 +938,17 @@ public class ShipmentPrs extends ValidatorEJB implements ShipmentPrsLocal, Shipm
String errorString = ""; String errorString = "";
try try
{ {
//changed by sankara on 05/03/14 pass profile id
System.out.println("xtraParams::::::::::::::::"+xtraParams);
String profileId = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "profileId" ));
System.out.println("Found Profile ID->"+profileId);
//sql = " SELECT MSG_TYPE FROM MESSAGES_LEVEL WHERE PROFILE_ID = ? AND WIN_NAME = 'w_shipment' AND MSG_NO = 'ALLPTCNNTA' "; //sql = " SELECT MSG_TYPE FROM MESSAGES_LEVEL WHERE PROFILE_ID = ? AND WIN_NAME = 'w_shipment' AND MSG_NO = 'ALLPTCNNTA' ";
sql = " SELECT MSG_TYPE, WIN_NAME FROM MESSAGES_LEVEL WHERE PROFILE_ID = ? AND MSG_NO = 'ALLPTCNNTA' "; sql = " SELECT MSG_TYPE, WIN_NAME FROM MESSAGES_LEVEL WHERE PROFILE_ID = ? AND MSG_NO = 'ALLPTCNNTA' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId); //changed by sankara on 03/05/14 passed profile id
//pstmt.setString(1, userId);
pstmt.setString(1, profileId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
......
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