Commit 395370a5 authored by prane's avatar prane

added sql for despatch

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202939 ce508802-f39f-4f6c-b175-0d175dae99d5
parent be86aec2
......@@ -47,6 +47,25 @@ sum(pending_dr) pending_dr from
AND NVL(b.plan_prod,'N') = 'Y'
AND a.item_code=d.item_code
UNION ALL
SELECT item.item_code__plan as item_code,invtrace.tran_date as due_date,
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
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
NVL( invstat.plan_prod,'N') = 'Y' 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') ) and
trim(nvl((select si.mfg_type from siteitem si where si.site_code = invtrace.site_code and si.item_code = invtrace.item_code ),' ')) not in ('O','D')
Group By item.item_code__plan,invtrace.tran_date
UNION ALL
SELECT d.item_code__plan as item_code,FN_MRP_DUEDATE(to_date('@fromdate@')) as due_date,0 as demand,
NVL((eff_qty * -1),0) as supply,NVL((eff_qty * -1),0) as stock_qty,
......
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