Commit da0af8f8 authored by arane's avatar arane

Project Estimation - On approval those item for which stk_opt is <> "0" to be...

Project Estimation - On approval those item for which stk_opt is <> "0" to be updated in demand/supply summary for MRP

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216382 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1f65f336
...@@ -223,7 +223,25 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -223,7 +223,25 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND (case when workorder.status is null then 'P' else workorder.status end in ('R','F')) 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') ) 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, workorder.due_date, 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
UNION ALL
select proj_est_bsl_item.tran_id, proj_est_bsl_item.line_no, proj_est_bsl_item.item_code, proj_est_bsl_item.start_date as due_date,
'PRJBSL' as tran_ser, sum(case when proj_est_bsl_item.quantity is null then 0 else proj_est_bsl_item.quantity end ) as demand ,
0 as supply, floor_mst.site_code
from proj_est_bsl_item, floor_mst
where ( proj_est_bsl_item.floor_id= floor_mst.tran_id )
AND ( floor_mst.site_code >= ('@sitecodeFr@') )
AND ( floor_mst.site_code <= ('@sitecodeTo@') )
AND ( proj_est_bsl_item.item_code >= ('@itemcodeFr@'))
AND ( proj_est_bsl_item.item_code <= ('@itemcodeTo@'))
AND ( proj_est_bsl_item.start_date >= to_date('@itemserFr@'))
AND ( proj_est_bsl_item.start_date <= to_date('@itemserTo@'))
GROUP BY proj_est_bsl_item.tran_id ,
proj_est_bsl_item.item_code,
proj_est_bsl_item.line_no,
proj_est_bsl_item.start_date ,
floor_mst.site_code
) ALIAS
GROUP BY item_code,due_date ,tran_id,line_no,tran_ser,site_code GROUP BY item_code,due_date ,tran_id,line_no,tran_ser,site_code
HAVING sum(demand) <> 0 or sum(supply) <> 0 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