Commit bfb64768 authored by ssarkar's avatar ssarkar

updated by 09/02/13 changed logic by manoharan sir.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92666 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b5101fdc
...@@ -235,8 +235,42 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -235,8 +235,42 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pickOrder = checkNullAndTrim(rs.getString( "PICK_ORDER" )); pickOrder = checkNullAndTrim(rs.getString( "PICK_ORDER" ));
lineNoPick = rs.getInt( "LINE_NO__PICK" ); lineNoPick = rs.getInt( "LINE_NO__PICK" );
orderType = checkNullAndTrim(rs.getString( "ORDER_TYPE" )); orderType = checkNullAndTrim(rs.getString( "ORDER_TYPE" ));
// 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 //Changed by sumit sarkar on 25/07/12 getting actual value from repl_ord_det
actualQty = rs.getInt( "ACTUAL_QTY" ); //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 = ? ) " +
" 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 = ? ))) ))";
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" )); String dExpLev = checkNullAndTrim(rs.getString( "EXP_LEV" ));
//Changed by sumit on 27/09/12 getting SHIPPER_SIZE //Changed by sumit on 27/09/12 getting SHIPPER_SIZE
itmVolumeMap.clear(); itmVolumeMap.clear();
...@@ -247,22 +281,12 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -247,22 +281,12 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
caseGrossWeight = (Double) itmVolumeMap.get("CASE_GROSS_WEIGHT"); caseGrossWeight = (Double) itmVolumeMap.get("CASE_GROSS_WEIGHT");
itemNetWeight = (Double) itmVolumeMap.get("ITEM_NET_WEIGHT"); itemNetWeight = (Double) itmVolumeMap.get("ITEM_NET_WEIGHT");
caseNetWeight = (Double) itmVolumeMap.get("CASE_NET_WEIGHT"); caseNetWeight = (Double) itmVolumeMap.get("CASE_NET_WEIGHT");
// end 10/10/12 manoharan
// 16/10/11 manoharan check whether allocation against sales order is there
// if allocation against sales order found change allocation to point to loc_code__to
// and deallocate the same for loc_code in stock
// update sordalloc with loc_code__to
// This utility methods to update old and new location should be in
// a separate probably in stockupdate so that we can call the same from various places
//
//
lineNo = rs.getInt( "LINE_NO" ); lineNo = rs.getInt( "LINE_NO" );
lotSlNew = rs.getString("lot_sl__new"); lotSlNew = rs.getString("lot_sl__new");
if(lotSlNew == null || lotSlNew.trim().length() == 0) //added by Kunal on 11/09/12 if(lotSlNew == null || lotSlNew.trim().length() == 0) //added by Kunal on 11/09/12
{ {
lotSlNew = lotSl ; lotSlNew = lotSl ;
} }
replOrderLineNo = rs.getInt("ORDER_lINE_NO");
pstmtStock.setString(1,itemCode); pstmtStock.setString(1,itemCode);
pstmtStock.setString(2,siteCode); pstmtStock.setString(2,siteCode);
pstmtStock.setString(3,locCode); pstmtStock.setString(3,locCode);
...@@ -332,198 +356,56 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -332,198 +356,56 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("batch_no", batchNo); updateRowMap.put("batch_no", batchNo);
updateRowMap.put("batch_size", ""+batchSize); updateRowMap.put("batch_size", ""+batchSize);
//End changes by gulzar on 12/24/2011 //End changes by gulzar on 12/24/2011
/*
// 24/06/12 manoharan active deallocation should be actual issue should be shipperSize if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) )
//Changed by sumit on 27/07/12 added 'Q' orderType Condition {
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "Q".equals(orderType) || "K".equals(orderType) || "J".equals(orderType) )
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) ) System.out.println(" inside 'J' OR K block and actualQty ["+actualQty+"]");
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType)) //Changed by sumit on 28/08/12 modifide sql.
if ("A".equals(orderType))
{ sql = "SELECT ACTUAL_QTY FROM REPL_ORD_DET WHERE REPL_ORDER = ? " +
//Changed by sumit sarkar on 25/07/12 provide pick_qty for 'E' start. " AND LINE_NO =? ";
//if( "E".equals(orderType) || "K".equals(orderType) )
/*if( "E".equals(orderType))
{
sql = "SELECT PICK_ORDER, LINE_NO FROM REPL_ORD_DET WHERE REPL_ORDER = " +
" (SELECT PICK_ORDER FROM REPL_ORD_DET WHERE REPL_ORDER = ? ) ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, replOrder);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
pickOrder = rs1.getString("PICK_ORDER");
lineNoPick = rs1.getInt( "LINE_NO" );
}
System.out.println("pickOrder - >["+pickOrder+"] lineNoPick - >["+lineNoPick+"]");
pstmt1.close();
pstmt1 = null;
rs1.close();
rs1 = null;
} */
//Changed by sumit sarkar on 25/07/12 provide pick_qty for 'E' end.
sql = "SELECT quantity from pick_ord_det where pick_order = ? and line_no = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, pickOrder); pstmt1.setString(1, pickOrder);
pstmt1.setInt(2,lineNoPick); pstmt1.setInt(2, lineNoPick);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if( rs1.next())
{ {
pickQty = rs1.getDouble(1); actualQty = rs1.getInt( "ACTUAL_QTY" );
} }
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
// 10/10/12 manoharan active quantity will be less than shipper_size set no_art as 1 and weight as one case weight }
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE"); */
noArt = 1;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight);
updateRowMap.put("net_weight", caseNetWeight);
updateRowMap.put("tare_weight", caseGrossWeight - caseNetWeight);
// end 10/10/12 manoharan
updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ pickQty );
updateRowMap.put("quantity", ""+ pickQty);
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 )
{
isError = true;
break;
}
// 10/10/12 manoharan active quantity will be less than shipper_size set no_art as 1 and weight as one case weight
shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
noArt = Math.floor((quantity - pickQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ (quantity - pickQty));
updateRowMap.put("quantity", ""+(quantity - pickQty));
System.out.println(" quantity -> ["+quantity+"] pickQty - >["+pickQty+"]");
}
//Changed by sumit on 27/07/12 added condition for order type 'G' start.
//else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType))
//else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType) || "C".equals(orderType) || "T".equals(orderType))
//else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType) || "C".equals(orderType) || "T".equals(orderType) || "K".equals(orderType) || "M".equals(orderType))
else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType) || "C".equals(orderType) || "T".equals(orderType) || "K".equals(orderType) || "M".equals(orderType) || "I".equals(orderType) || "E".equals(orderType) || "P".equals(orderType))
{
//if("J".equals(orderType) || "K".equals(orderType) )
if("J".equals(orderType) || "K".equals(orderType) || "I".equals(orderType))
{
System.out.println(" inside 'J' OR K block and actualQty ["+actualQty+"]");
//Changed by sumit on 28/08/12 modifide sql.
/*sql = "SELECT ACTUAL_QTY FROM REPL_ORD_DET WHERE PICK_ORDER = ? " +
" AND LINE_NO__PICK =? ";*/
sql = "SELECT ACTUAL_QTY FROM REPL_ORD_DET WHERE REPL_ORDER = ? " +
" AND LINE_NO =? ";
pstmt1 = conn.prepareStatement(sql); System.out.println(" Active actualQty ["+actualQty+"]");
/*pstmt1.setString(1, replOrder); updateRowMap.put("tran_type","ID");
pstmt1.setInt(2, replOrderLineNo);*/ updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140
pstmt1.setString(1, pickOrder); updateRowMap.put("quantity", ""+ (quantity - actualQty));
pstmt1.setInt(2, lineNoPick); noArt = Math.floor((quantity - actualQty) / shipperSize) ;
rs1 = pstmt1.executeQuery(); updateRowMap.put("no_art", noArt);
if( rs1.next()) updateRowMap.put("gross_weight", caseGrossWeight * noArt);
{ updateRowMap.put("net_weight", caseNetWeight * noArt);
actualQty = rs1.getInt( "ACTUAL_QTY" ); updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
} // end 10/10/12 manoharan
System.out.println("actualQty - inside 'J' OR 'K' >["+actualQty+"]"); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if(pstmt1 != null) if ( retString != null && retString.trim().length() > 0 )
{
pstmt1.close();
pstmt1 = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
}
System.out.println(" inside 'G' and actualQty ["+actualQty+"]");
//Changed by sumit sarkar on 25/07/12 provide pick_qty for 'k' end.
updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140
updateRowMap.put("quantity", ""+ (quantity - actualQty));
// 10/10/12 commented by manoharan
////Changed by sumit on 27/09/12 start.
//shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
//noArt = quantity/ shipperSize;
//updateRowMap.put("no_art", noArt);
////Changed by sumit on 27/09/12 end.
noArt = Math.floor((quantity - actualQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 )
{
isError = true;
break;
}
updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ actualQty);//360
updateRowMap.put("quantity", ""+actualQty);
// 10/10/12 manoharan weight and no_art to be set properly
noArt = Math.floor((actualQty) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
}
/*else if("J".equals(orderType))
{
updateRowMap.put("tran_type","ID");
updateRowMap.put("qty_stduom", ""+ (quantity - actualQty));//140
updateRowMap.put("quantity", ""+ (quantity - actualQty));
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 )
{
isError = true;
break;
}
updateRowMap.put("tran_type","I");
updateRowMap.put("qty_stduom", ""+ actualQty);//360
updateRowMap.put("quantity", ""+actualQty);
}*/
//Changed by sumit on 27/07/12 added condition for order type 'G' end.
else
{ {
updateRowMap.put("tran_type","ID"); isError = true;
updateRowMap.put("qty_stduom", ""+quantity); break;
updateRowMap.put("quantity", ""+quantity);
// 10/10/12 manoharan weight and no_art to be set properly
noArt = Math.floor((quantity) / shipperSize) ;
updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
} }
// end 24/06/12 manoharan updateRowMap.put("tran_type","I");
// 10/10/12 manoharan comented updateRowMap.put("qty_stduom", ""+ actualQty);//360
////Changed by sumit on 27/09/12 start. updateRowMap.put("quantity", ""+actualQty);
//shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE"); noArt = Math.floor((actualQty) / shipperSize) ;
//noArt = quantity/ shipperSize; updateRowMap.put("no_art", noArt);
//updateRowMap.put("no_art", noArt); updateRowMap.put("gross_weight", caseGrossWeight * noArt);
////Changed by sumit on 27/09/12 end. updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
...@@ -536,21 +418,12 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -536,21 +418,12 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updateRowMap.put("quantity", ""+quantity); updateRowMap.put("quantity", ""+quantity);
updateRowMap.put("loc_code", locCodeTo); updateRowMap.put("loc_code", locCodeTo);
updateRowMap.put("lot_sl", lotSlNew);//added by akhilesh on 23/jun/2012 // 24/06/12 manoharan it should be lot_sl not lot_sl__new updateRowMap.put("lot_sl", lotSlNew);//added by akhilesh on 23/jun/2012 // 24/06/12 manoharan it should be lot_sl not lot_sl__new
updateRowMap.put("tran_type", "R");//Creating receipt updateRowMap.put("tran_type", "R");//Creating receipt
// 10/10/12 manoharan commented and new code added
////Changed by sumit on 27/09/12 start.
//shipperSize = (Double) itmVolumeMap.get("SHIPPER_SIZE");
//noArt = quantity/ shipperSize;
//updateRowMap.put("no_art", noArt);
////Changed by sumit on 27/09/12 end.
// 10/10/12 manoharan weight and no_art to be set properly
noArt = Math.floor((quantity) / shipperSize) ; noArt = Math.floor((quantity) / shipperSize) ;
updateRowMap.put("no_art", noArt); updateRowMap.put("no_art", noArt);
updateRowMap.put("gross_weight", caseGrossWeight * noArt); updateRowMap.put("gross_weight", caseGrossWeight * noArt);
updateRowMap.put("net_weight", caseNetWeight * noArt); updateRowMap.put("net_weight", caseNetWeight * noArt);
updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt); updateRowMap.put("tare_weight", (caseGrossWeight - caseNetWeight) * noArt);
// end 10/10/12 manoharan
retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn ); retString = stkUpdate.updateStock( updateRowMap, xtraParams, conn );
if ( retString != null && retString.trim().length() > 0 ) if ( retString != null && retString.trim().length() > 0 )
...@@ -580,33 +453,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -580,33 +453,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//strAllocate.put("chg_win","w_pick_iss"); //strAllocate.put("chg_win","w_pick_iss");
strAllocate.put("chg_win","w_repl_iss"); strAllocate.put("chg_win","w_repl_iss");
// 24/06/12 manoharan active deallocation should be actual issue should be shipperSize strAllocate.put("alloc_qty",new Double(quantity - actualQty));
//Changed by sumit sarkar on 27/07/12 changing condition
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) )
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "K".equals(orderType) )
//if ("A".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) )
if ("A".equals(orderType) )
{
strAllocate.put("alloc_qty",new Double(pickQty));
}
//Changed by sumit on 23/07/12separated condition 'I' start.
//else if ("I".equals(orderType) || "Q".equals(orderType) || "K".equals(orderType) )
/*else if ("I".equals(orderType) || "Q".equals(orderType) || "K".equals(orderType) )
{
System.out.println(" for order type 'I' and 'Q' and 'k' ["+pickQty+"");
strAllocate.put("alloc_qty",new Double(pickQty));
}*/
//else if ("G".equals(orderType) || "F".equals(orderType) )
//else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType) || "C".equals(orderType) || "T".equals(orderType) || "K".equals(orderType) || "M".equals(orderType))
else if ("G".equals(orderType) || "F".equals(orderType) || "J".equals(orderType) || "Q".equals(orderType) || "C".equals(orderType) || "T".equals(orderType) || "K".equals(orderType) || "M".equals(orderType) || "E".equals(orderType) || "I".equals(orderType) || "P".equals(orderType) )
{
strAllocate.put("alloc_qty",new Double(quantity - actualQty));
}
//Changed by sumit on 23/07/12separated condition 'I' end.
else
{
strAllocate.put("alloc_qty",new Double(quantity));
}
retString = invAllocTrace.updateInvallocTrace(strAllocate, conn); retString = invAllocTrace.updateInvallocTrace(strAllocate, conn);
System.out.println("retString ::: " + retString); System.out.println("retString ::: " + retString);
...@@ -621,7 +468,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -621,7 +468,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
// 18/09/12 manoharan as the lot_sl also changed and allocation may be for case pick as well as active pick // 18/09/12 manoharan as the lot_sl also changed and allocation may be for case pick as well as active pick
// reduce the quantity in existing and insert new for the active // reduce the quantity in existing and insert new for the active
//if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) )
if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "P".equals(orderType)) if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType)) // all active replenishment
{ {
//Changed By Pragyan 06/12/2012 To get valid Pick Order.start //Changed By Pragyan 06/12/2012 To get valid Pick Order.start
/*sql = " SELECT * FROM PICK_ORD_DET " /*sql = " SELECT * FROM PICK_ORD_DET "
......
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