Commit 52fee249 authored by msharma's avatar msharma

Exclude hold Qty from stock during manual stock allocation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93341 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f70ed820
...@@ -349,7 +349,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -349,7 +349,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
else else
{ {
sql ="SELECT SUM(STOCK.QUANTITY - case when STOCK.ALLOC_QTY is null then 0 else STOCK.ALLOC_QTY end ),SUM(case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end ) " sql ="SELECT SUM(STOCK.QUANTITY - case when STOCK.ALLOC_QTY is null then 0 else STOCK.ALLOC_QTY end - case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end ),SUM(case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end ) "
+"FROM STOCK,ITEM,LOCATION,INVSTAT " +"FROM STOCK,ITEM,LOCATION,INVSTAT "
+"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) " +"WHERE (ITEM.ITEM_CODE = STOCK.ITEM_CODE) "
+"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) " +"AND (LOCATION.LOC_CODE = STOCK.LOC_CODE ) "
...@@ -357,7 +357,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -357,7 +357,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"AND INVSTAT.AVAILABLE = 'Y' " +"AND INVSTAT.AVAILABLE = 'Y' "
+"AND STOCK.ITEM_CODE = ? " +"AND STOCK.ITEM_CODE = ? "
+"AND STOCK.SITE_CODE = ? " +"AND STOCK.SITE_CODE = ? "
+"AND (STOCK.QUANTITY - case when STOCK.ALLOC_QTY is null then 0 else STOCK.ALLOC_QTY end ) > 0 "; +"AND (STOCK.QUANTITY - case when STOCK.ALLOC_QTY is null then 0 else STOCK.ALLOC_QTY end - case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end ) > 0 ";
// 01/11/12 manoharan preparedstatement used instead of statement // 01/11/12 manoharan preparedstatement used instead of statement
//rs1 = st.executeQuery(sql); //rs1 = st.executeQuery(sql);
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
...@@ -957,7 +957,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -957,7 +957,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
getDataSql = "SELECT STOCK.LOT_NO,STOCK.LOT_SL," getDataSql = "SELECT STOCK.LOT_NO,STOCK.LOT_SL,"
+"STOCK.LOC_CODE, " +"STOCK.LOC_CODE, "
+"STOCK.UNIT, " +"STOCK.UNIT, "
+"(STOCK.QUANTITY - STOCK.ALLOC_QTY ) AS QTY_AVAIL_ALLOC ," +"(STOCK.QUANTITY - STOCK.ALLOC_QTY - case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end ) AS QTY_AVAIL_ALLOC ,"
+"STOCK.GRADE,STOCK.EXP_DATE,STOCK.CONV__QTY_STDUOM,STOCK.QUANTITY, " +"STOCK.GRADE,STOCK.EXP_DATE,STOCK.CONV__QTY_STDUOM,STOCK.QUANTITY, "
+"STOCK.MFG_DATE,STOCK.SITE_CODE__MFG " +"STOCK.MFG_DATE,STOCK.SITE_CODE__MFG "
+"FROM STOCK,ITEM,LOCATION,INVSTAT " +"FROM STOCK,ITEM,LOCATION,INVSTAT "
...@@ -966,7 +966,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -966,7 +966,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"AND (LOCATION.INV_STAT = INVSTAT.INV_STAT) " +"AND (LOCATION.INV_STAT = INVSTAT.INV_STAT) "
+"AND INVSTAT.AVAILABLE = 'Y' " +"AND INVSTAT.AVAILABLE = 'Y' "
+"AND STOCK.ITEM_CODE = ? AND STOCK.SITE_CODE = ? " +"AND STOCK.ITEM_CODE = ? AND STOCK.SITE_CODE = ? "
+"AND (STOCK.QUANTITY - STOCK.ALLOC_QTY) > 0 " +"AND (STOCK.QUANTITY - STOCK.ALLOC_QTY - case when STOCK.HOLD_QTY is null then 0 else STOCK.HOLD_QTY end) > 0 "
+"AND NOT EXISTS (SELECT 1 FROM INV_RESTR I WHERE I.INV_STAT = INVSTAT.INV_STAT AND I.REF_SER = 'S-DSP' )"; +"AND NOT EXISTS (SELECT 1 FROM INV_RESTR I WHERE I.INV_STAT = INVSTAT.INV_STAT AND I.REF_SER = 'S-DSP' )";
pstmtStock = conn.prepareStatement(getDataSql); pstmtStock = conn.prepareStatement(getDataSql);
......
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