Commit ca58ae2d authored by prane's avatar prane

changes in deamndsupply summ and detail sql

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@212058 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3c873880
...@@ -41,8 +41,8 @@ and trim(nvl((select si.mfg_type from siteitem si where si.site_code = h.site_co ...@@ -41,8 +41,8 @@ and trim(nvl((select si.mfg_type from siteitem si where si.site_code = h.site_co
Group By h.TRAN_ID, 'S-FST', item.item_code__plan,fn_get_prdfrdate(d.PRD_CODE__FOR),0, h.SITE_CODE Group By h.TRAN_ID, 'S-FST', item.item_code__plan,fn_get_prdfrdate(d.PRD_CODE__FOR),0, h.SITE_CODE
UNION ALL UNION ALL
select invtrace.tran_id||'@'||invtrace.ref_id||'@'||invtrace.ref_line tran_id,invtrace.ref_ser as tran_ser, item.item_code__plan as item_code, invtrace.tran_date as due_date, sum(invtrace.eff_qty) as demand, select invtrace.tran_id||'@'||invtrace.ref_id||'@'||invtrace.ref_line tran_id,invtrace.ref_ser as tran_ser, item.item_code__plan as item_code, FN_MRP_DUEDATE(to_date('@fromdate@')) as due_date,
0 as supply , 0 as stock_qty, 0 as oth_supply, 0 as pending_po, 0 as pending_do, 0 as pending_indent, 0 as pending_dr , invtrace.SITE_CODE 0 as demand, sum(invtrace.eff_qty) * -1 as supply , 0 as stock_qty, 0 as oth_supply, 0 as pending_po, 0 as pending_do, 0 as pending_indent, 0 as pending_dr , invtrace.SITE_CODE
from invtrace, item, location, invstat from invtrace, item, location, invstat
where ( invtrace.item_code = item.item_code ) and where ( invtrace.item_code = item.item_code ) and
( location.loc_code = invtrace.loc_code) and ( location.loc_code = invtrace.loc_code) and
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
and trim(nvl((select si.mfg_type from siteitem si where si.site_code = dist_demand.site_code and si.item_code = item.item_code ),' ')) not in ('O','D') and trim(nvl((select si.mfg_type from siteitem si where si.site_code = dist_demand.site_code and si.item_code = item.item_code ),' ')) not in ('O','D')
Group By item.item_code__plan,dist_demand.due_date Group By item.item_code__plan,dist_demand.due_date
UNION ALL UNION ALL
SELECT item.item_code__plan as item_code,invtrace.tran_date as due_date, SELECT item.item_code__plan as item_code,FN_MRP_DUEDATE(to_date('@fromdate@')) as due_date,
sum(invtrace.eff_qty ) as demand, 0 as demand,
0 as supply , 0 as stock_qty, 0 as oth_supply, 0 as pending_po, 0 as pending_do, 0 as pending_indent, 0 as pending_dr sum(invtrace.eff_qty) *-1 as supply , 0 as stock_qty, 0 as oth_supply, 0 as pending_po, 0 as pending_do, 0 as pending_indent, 0 as pending_dr
FROM invtrace, item, location, invstat FROM invtrace, item, location, invstat
WHERE ( invtrace.item_code = item.item_code ) and WHERE ( invtrace.item_code = item.item_code ) and
( location.loc_code = invtrace.loc_code) and ( location.loc_code = invtrace.loc_code) 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