Commit 42e79389 authored by asikarwar's avatar asikarwar

add to column hold flag and qty allocated and update hold flag in sorderdet table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91897 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b391ff1b
/* /*
Window Name : w_sordalloc Window Name : w_sordalloc
*/ */
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
...@@ -255,7 +255,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -255,7 +255,8 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"ITEM.DESCR,SORDITEM.QUANTITY," +"ITEM.DESCR,SORDITEM.QUANTITY,"
+"SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC PENDING_QUANTITY," +"SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC PENDING_QUANTITY,"
+"SORDITEM.QTY_ALLOC,SORDDET.PACK_INSTR," +"SORDITEM.QTY_ALLOC,SORDDET.PACK_INSTR,"
+"SORDER.SITE_CODE__SHIP,SORDITEM.EXP_LEV " +"SORDER.SITE_CODE__SHIP,SORDITEM.EXP_LEV , "
+"CASE WHEN SORDDET.HOLD_FLAG IS NULL THEN 'N' ELSE SORDDET.HOLD_FLAG END "// ADDED BY AKHILESH FOR NEW COLUNM
+"FROM SORDDET,SORDER,SORDITEM,CUSTOMER,ITEM " +"FROM SORDDET,SORDER,SORDITEM,CUSTOMER,ITEM "
+"WHERE ( SORDER.SALE_ORDER = SORDDET.SALE_ORDER ) AND " +"WHERE ( SORDER.SALE_ORDER = SORDDET.SALE_ORDER ) AND "
+"( SORDITEM.SALE_ORDER = SORDER.SALE_ORDER ) AND " +"( SORDITEM.SALE_ORDER = SORDER.SALE_ORDER ) AND "
...@@ -275,7 +276,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -275,7 +276,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"AND CASE WHEN SORDDET.STATUS IS NULL THEN 'P' ELSE SORDDET.STATUS end <> 'C' " +"AND CASE WHEN SORDDET.STATUS IS NULL THEN 'P' ELSE SORDDET.STATUS end <> 'C' "
+"AND CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS end = 'P' " +"AND CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS end = 'P' "
+"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 " +"AND SORDITEM.QUANTITY - SORDITEM.QTY_DESP - SORDITEM.QTY_ALLOC > 0 "
+"AND SORDITEM.LINE_TYPE = 'I'" +"AND SORDITEM.LINE_TYPE = 'I' "
+"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD"; +"ORDER BY SORDER.CUST_CODE,SORDER.SALE_ORDER,SORDITEM.ITEM_CODE__ORD";
pstmt = conn.prepareStatement(getDataSql); pstmt = conn.prepareStatement(getDataSql);
...@@ -368,11 +369,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -368,11 +369,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
retTabSepStrBuff.append("0").append("\t"); retTabSepStrBuff.append("0").append("\t");
} }
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// alloc_qty to be set based on stock availability // alloc_qty to be set based on stock availability
// it should not be more than pending quantity // it should not be more than pending quantity
// the balance quantity to be updated in itemCodeMap // the balance quantity to be updated in itemCodeMap
// and to be used for the item's next iteration // and to be used for the item's next iteration
//QTY_ALLOC //QTY_ALLOC
if(balStockQty >= pendQty) if(balStockQty >= pendQty)
{ {
...@@ -395,7 +398,6 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -395,7 +398,6 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
// this line has to be commented later // this line has to be commented later
// as this will be a input from the user // as this will be a input from the user
itemCodeMap.put(rs.getString(6), new Double(balStockQty)); itemCodeMap.put(rs.getString(6), new Double(balStockQty));
//PACK_INSTR //PACK_INSTR
retTabSepStrBuff.append(rs.getString(11)).append("\t"); retTabSepStrBuff.append(rs.getString(11)).append("\t");
...@@ -403,7 +405,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -403,7 +405,13 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
retTabSepStrBuff.append(rs.getString(12)).append("\t"); retTabSepStrBuff.append(rs.getString(12)).append("\t");
//EXP_LEV //EXP_LEV
retTabSepStrBuff.append(rs.getString(13)).append("\t"); retTabSepStrBuff.append(rs.getString(13)).append("\t");
retTabSepStrBuff.append(" ").append("\n");
//Hold Flag
retTabSepStrBuff.append(rs.getString(14)).append("\t");// ADDED BY AKHILESH
//qty allocated
retTabSepStrBuff.append(rs.getDouble(10)).append("\t");// ADDED BY AKHILESH
retTabSepStrBuff.append("\n");
} }
}while(rs.next()); }while(rs.next());
...@@ -520,6 +528,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -520,6 +528,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
double qtyAvailAlloc = 0; double qtyAvailAlloc = 0;
String stockQuantity = ""; String stockQuantity = "";
String errString = ""; String errString = "";
String holdFlag = "";
String getDataSql= null; String getDataSql= null;
String insertSql = null; String insertSql = null;
...@@ -596,13 +605,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -596,13 +605,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
{ {
expLev = childNode.getFirstChild().getNodeValue(); expLev = childNode.getFirstChild().getNodeValue();
} }
if (childNodeName.equals("hold_flag"))
{
holdFlag = childNode.getFirstChild().getNodeValue();
}
}//inner for loop }//inner for loop
if(allocQty > 0) if(allocQty > 0)
{ {
System.out.println("if calling........"); System.out.println("if calling........");
errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev); errString = sorderAllocate(saleOrder, lineNo, itemCode, allocQty, expLev ,holdFlag);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("errString :"+errString); System.out.println("errString :"+errString);
...@@ -611,7 +624,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -611,7 +624,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
}// out for loop }// out for loop
/*Commented By Manoj Sharma dtd 29/032012 Not required as discussed with Manohar Sir /*Commented By Manoj Sharma dtd 29/032012 Not required as discussed with Manohar Sir
if(postOrderFg.equals("Y")) if(postOrderFg.equals("Y"))
{ {
...@@ -672,7 +685,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -672,7 +685,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev) throws ITMException private String sorderAllocate(String saleOrder, String lineNo, String itemCode, double allocQty, String expLev ,String holdFlag) throws ITMException
{ {
System.out.println("updateSOrder calling .............."); System.out.println("updateSOrder calling ..............");
String getDataSql = null; String getDataSql = null;
...@@ -1000,7 +1013,22 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -1000,7 +1013,22 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
}//end else }//end else
//st.close(); //st.close();
//added by akhilesh to update hold_flag
updateSql = "UPDATE SORDDET SET HOLD_FLAG ='"+holdFlag+"'"
+ " WHERE SALE_ORDER = '" + saleOrder + " ' "
+ " AND LINE_NO = '" + lineNo + "' ";
System.out.println("updateSql::>>>>"+ updateSql);
st = conn.createStatement();
st.executeUpdate(updateSql);
st.close();
st=null;
System.out.println("UPDATE SUCCESS FOR SORDDET....");
//ended by akhilesh
}//end of if(lotQtyToBeAllocated > 0) }//end of if(lotQtyToBeAllocated > 0)
}//end of while }//end of while
rs.close(); rs.close();
pstmtStock.clearParameters(); pstmtStock.clearParameters();
......
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