Commit a48701ac authored by prane's avatar prane

RunMPR enhancemenet related sql merged

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213447 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 68e1fd2f
......@@ -188,7 +188,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND workorder.SALE_ORDER IS NULL
AND (case when workorder.status is null then 'P' else workorder.status end in ('R','F'))
AND (case when workorder.consider_wip is null then 'O' else workorder.consider_wip end = 'O')
GROUP BY workorder.work_order, ' ','W-ORD',item.item_code__plan, to_date('@fromdate@'), workorder.site_code
GROUP BY workorder.work_order, ' ','W-ORD',item.item_code__plan, workorder.due_date, workorder.site_code
HAVING sum((case when workorder.current_batch_qty is null then 0 else workorder.current_batch_qty end *
case when workorder.yield_perc is null then 100 else workorder.yield_perc end / 100 ) - case when workorder.quantity__rcvd is null then 0 else workorder.quantity__rcvd end ) > 0
......@@ -222,7 +222,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND workorder.SALE_ORDER IS NULL
AND (case when workorder.status is null then 'P' else workorder.status end in ('R','F'))
AND (case when workorder.consider_wip is null then 'O' else workorder.consider_wip end = 'O') )
GROUP BY workorder_bill.work_order,case when rtrim(siteitem.supp_sour) = 'M' then 'W-BIL' when rtrim(siteitem.supp_sour) = 'P' then 'Indend' else '???' end, workorder_bill.item_code, to_date('@fromdate@'), workorder.site_code
GROUP BY workorder_bill.work_order,case when rtrim(siteitem.supp_sour) = 'M' then 'W-BIL' when rtrim(siteitem.supp_sour) = 'P' then 'Indend' else '???' end, workorder_bill.item_code, workorder.due_date, workorder.site_code
) ALIAS
GROUP BY item_code,due_date ,tran_id,line_no,tran_ser,site_code
HAVING sum(demand) <> 0 or sum(supply) <> 0
......
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