Commit f6e908d3 authored by msharma's avatar msharma

invtrace removed for demand


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96049 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3d4d5b82
...@@ -37,21 +37,6 @@ ...@@ -37,21 +37,6 @@
( sales_demand.due_date <= to_date('@todate@')) AND ( sales_demand.due_date <= to_date('@todate@')) AND
( 0 = @madetostock@ ) ( 0 = @madetostock@ )
Group By item.item_code__plan,sales_demand.due_date Group By item.item_code__plan,sales_demand.due_date
UNION ALL
SELECT item.item_code__plan as item_code,invtrace.tran_date as due_date,
sum(invtrace.eff_qty) 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
FROM invtrace, item, location, invstat
WHERE ( invtrace.item_code = item.item_code ) and
( location.loc_code = invtrace.loc_code) and
( invstat.inv_stat = location.inv_stat) and
( invstat.stat_type <> 'S' ) and
( invtrace.site_code in ('@sitecode@') ) AND
( item.item_code__plan = '@itemcode@') AND
( invtrace.tran_date >= to_date('@fromdate@')) and
( invtrace.tran_date <= to_date('@rundate@')) and
( invtrace.ref_ser in ('D-ISS','S-DSP') )
Group By item.item_code__plan,invtrace.tran_date
UNION ALL UNION ALL
SELECT item.item_code__plan as item_code,distorder_det.due_date as due_date, SELECT item.item_code__plan as item_code,distorder_det.due_date as due_date,
sum(case when qty_confirm is null then 0 else qty_confirm end - case when qty_shipped is null then 0 else qty_shipped end) as demand, sum(case when qty_confirm is null then 0 else qty_confirm end - case when qty_shipped is null then 0 else qty_shipped end) as demand,
......
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