Commit e1de0002 authored by rbhogale's avatar rbhogale

Changed by Rohan on 15-02-13 for select actual qty form repl_ord_det in case of stock to dock


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92696 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 04b4f2c2
......@@ -238,41 +238,54 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
// 09/02/13 manoharan actual quantity (balance quantity) is updated in multiples of number of cases so this has to be taken as the total pick quantity
//Changed by sumit sarkar on 25/07/12 getting actual value from repl_ord_det
//actualQty = rs.getInt( "ACTUAL_QTY" );
replOrderLineNo = rs.getInt("ORDER_lINE_NO");
sql = " SELECT SUM(QUANTITY) AS QUANTITY FROM " +
" ( SELECT SUM(QUANTITY) AS QUANTITY FROM (SELECT SUM(QUANTITY) AS QUANTITY FROM PICK_ORD_DET P " +
" WHERE P.REPL_ORDER = ? AND P.LINE_NO__REPL = ? AND FN_IS_VALID_PICK_ORDER(P.PICK_ORDER) = 'Y' " +
" UNION ALL " +
" SELECT SUM(QUANTITY) FROM PICK_ORD_DET WHERE (REPL_ORDER, LINE_NO__REPL) IN " +
" (SELECT REPL_ORDER , LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? ) " +
//Changed by sumit on 14/02/13 checking whether wave cancel or hold
" AND FN_IS_VALID_PICK_ORDER(PICK_ORDER) = 'Y' " +
" UNION ALL " +
" SELECT SUM(QUANTITY) FROM PICK_ORD_DET WHERE (REPL_ORDER, LINE_NO__REPL) IN ( " +
" SELECT REPL_ORDER,LINE_NO FROM REPL_ORD_DET WHERE (PICK_ORDER,LINE_NO__PICK) IN ( " +
" (SELECT REPL_ORDER , LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? )))" +
//Changed by sumit on 14/02/13 checking whether wave cancel or hold
" AND FN_IS_VALID_PICK_ORDER(PICK_ORDER) = 'Y' ))";
pstmtPick = conn.prepareStatement(sql);
pstmtPick.setString(1, replOrder);
pstmtPick.setInt(2, replOrderLineNo);
pstmtPick.setString(3, replOrder);
pstmtPick.setInt(4, replOrderLineNo);
pstmtPick.setString(5, replOrder);
pstmtPick.setInt(6, replOrderLineNo);
rsPick = pstmtPick.executeQuery();
if (rsPick.next())
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.start
System.out.println("Order Type"+orderType);
if ("D".equals(orderType) || "H".equals(orderType) || "L".equals(orderType))
{
pickQty = rsPick.getDouble("QUANTITY");
actualQty = rs.getInt( "ACTUAL_QTY" );
System.out.println("actualQty"+actualQty);
}
rsPick.close();
rsPick = null;
pstmtPick.close();
pstmtPick = null;
actualQty = quantity - pickQty;
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.start
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.start
if (!"D".equals(orderType) && !"H".equals(orderType) && !"L".equals(orderType))
{
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.end
replOrderLineNo = rs.getInt("ORDER_lINE_NO");
sql = " SELECT SUM(QUANTITY) AS QUANTITY FROM " +
" ( SELECT SUM(QUANTITY) AS QUANTITY FROM (SELECT SUM(QUANTITY) AS QUANTITY FROM PICK_ORD_DET P " +
" WHERE P.REPL_ORDER = ? AND P.LINE_NO__REPL = ? AND FN_IS_VALID_PICK_ORDER(P.PICK_ORDER) = 'Y' " +
" UNION ALL " +
" SELECT SUM(QUANTITY) FROM PICK_ORD_DET WHERE (REPL_ORDER, LINE_NO__REPL) IN " +
" (SELECT REPL_ORDER , LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? ) " +
//Changed by sumit on 14/02/13 checking whether wave cancel or hold
" AND FN_IS_VALID_PICK_ORDER(PICK_ORDER) = 'Y' " +
" UNION ALL " +
" SELECT SUM(QUANTITY) FROM PICK_ORD_DET WHERE (REPL_ORDER, LINE_NO__REPL) IN ( " +
" SELECT REPL_ORDER,LINE_NO FROM REPL_ORD_DET WHERE (PICK_ORDER,LINE_NO__PICK) IN ( " +
" (SELECT REPL_ORDER , LINE_NO FROM REPL_ORD_DET WHERE PICK_ORDER = ? AND LINE_NO__PICK = ? )))" +
//Changed by sumit on 14/02/13 checking whether wave cancel or hold
" AND FN_IS_VALID_PICK_ORDER(PICK_ORDER) = 'Y' ))";
pstmtPick = conn.prepareStatement(sql);
pstmtPick.setString(1, replOrder);
pstmtPick.setInt(2, replOrderLineNo);
pstmtPick.setString(3, replOrder);
pstmtPick.setInt(4, replOrderLineNo);
pstmtPick.setString(5, replOrder);
pstmtPick.setInt(6, replOrderLineNo);
rsPick = pstmtPick.executeQuery();
if (rsPick.next())
{
pickQty = rsPick.getDouble("QUANTITY");
}
rsPick.close();
rsPick = null;
pstmtPick.close();
pstmtPick = null;
actualQty = quantity - pickQty;
}
// end 09/02/13 manoharan actual quantity (balance quantity) is updated in multiples of number of cases so this has to be taken as the total pick quantity
String dExpLev = checkNullAndTrim(rs.getString( "EXP_LEV" ));
......@@ -384,8 +397,32 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
rs1.close();
rs1 = null;
}
*/
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.start
System.out.println("orderType::"+orderType);
if ("D".equals(orderType) || "H".equals(orderType) || "L".equals(orderType))
{
sql = "SELECT ACTUAL_QTY FROM REPL_ORD_DET WHERE REPL_ORDER = ? " +
" AND LINE_NO =? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, pickOrder);
pstmt1.setInt(2, lineNoPick);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
actualQty = rs1.getInt( "ACTUAL_QTY" );
}
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;
}
//Chnaged by Rohan on 15-02-13 for calculating actual qty from repanishment in case of stock to dock.end
*/
System.out.println(" Active actualQty ["+actualQty+"]");
updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140
......
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