Commit 97635041 authored by steurwadkar's avatar steurwadkar

Changed by Santosh added Nvl() to Hold_qty


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101123 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 74958028
......@@ -179,7 +179,9 @@ public class DDUpdStockSchedule implements Schedule
pstmt.setString(3, "NOSL");
pstmt.setString(4, "INTR");
*/
sql = " select A.Item_code, A.stk_qty- Nvl(H.Order_QTY,0) FinStk from (select stk.Item_code, sum(quantity-Alloc_Qty-Hold_qty) stk_qty "
//Added Nvl() to hold_qty to retrun 0 if hold_qty is null in stock master by Santosh on 06-04-2016
//sql = " select A.Item_code, A.stk_qty- Nvl(H.Order_QTY,0) FinStk from (select stk.Item_code, sum(quantity-Alloc_Qty-Hold_qty) stk_qty "
sql = " select A.Item_code, A.stk_qty- Nvl(H.Order_QTY,0) FinStk from (select stk.Item_code, sum(quantity-Alloc_Qty-Nvl(Hold_qty,0)) stk_qty "
+ " from stock Stk group by stk.Item_code) A left outer join (select G.item_code,G.Order_QTY from (select item_code, Sum(Quantity) Order_QTY, "
+ " (select sum(quantity) from stock Stk where stk.Item_code = S.Item_code) as Stock_Qty from sorddet S, Sorder SO "
+ " where SO.Sale_order=S.Sale_order and SO.Confirmed = ? and SO.Status not in (?, ?) and "
......
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