Commit 1096ce1f 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@216662 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 77cff814
...@@ -87,7 +87,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -87,7 +87,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND ( item.Item_Ser <= '@itemserTo@') AND ( item.Item_Ser <= '@itemserTo@')
AND ( distorder_det.due_date >= to_date('@fromdate@')) AND ( distorder_det.due_date >= to_date('@fromdate@'))
AND ( distorder_det.due_date <= to_date('@todate@')) AND ( distorder_det.due_date <= to_date('@todate@'))
AND ( distorder.order_type not in (@ordtypes@) ) AND ( distorder.order_type not in ('@ordtypes@') )
AND ( case when distorder.status is null then 'P' else distorder.status end = 'P') AND ( case when distorder.status is null then 'P' else distorder.status end = 'P')
AND ( case when qty_confirm is null then 0 else qty_confirm end - case when qty_shipped is null then 0 else qty_shipped end) > 0 AND ( case when qty_confirm is null then 0 else qty_confirm end - case when qty_shipped is null then 0 else qty_shipped end) > 0
GROUP BY distorder.dist_order, distorder_det.line_no,'D-ISS',item.item_code__plan,distorder_det.due_date , distorder.site_code__ship GROUP BY distorder.dist_order, distorder_det.line_no,'D-ISS',item.item_code__plan,distorder_det.due_date , distorder.site_code__ship
...@@ -108,7 +108,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -108,7 +108,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND ( item.Item_Ser <= '@itemserTo@') AND ( item.Item_Ser <= '@itemserTo@')
AND ( distorder_det.due_date >= to_date('@fromdate@')) AND ( distorder_det.due_date >= to_date('@fromdate@'))
AND ( distorder_det.due_date <= to_date('@todate@')) AND ( distorder_det.due_date <= to_date('@todate@'))
AND ( distorder.order_type not in (@ordtypes@) ) AND ( distorder.order_type not in ('@ordtypes@') )
AND ( case when distorder.status is null then 'P' else distorder.status end = 'P') AND ( case when distorder.status is null then 'P' else distorder.status end = 'P')
AND (case when qty_confirm is null then 0 else qty_confirm end - case when qty_received is null then 0 else qty_received end ) > 0 AND (case when qty_confirm is null then 0 else qty_confirm end - case when qty_received is null then 0 else qty_received end ) > 0
GROUP BY distorder.dist_order, distorder_det.line_no,'D-RCP',item.item_code__plan,distorder_det.due_date , distorder.site_code__dlv GROUP BY distorder.dist_order, distorder_det.line_no,'D-RCP',item.item_code__plan,distorder_det.due_date , distorder.site_code__dlv
...@@ -149,7 +149,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -149,7 +149,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
AND ( item.item_code__plan <= '@itemcodeTo@') AND ( item.item_code__plan <= '@itemcodeTo@')
AND ( item.Item_Ser >= '@itemserFr@') AND ( item.Item_Ser >= '@itemserFr@')
AND ( item.Item_Ser <= '@itemserTo@') AND ( item.Item_Ser <= '@itemserTo@')
AND ( porder.pord_type not in (@ordtypes@) ) AND ( porder.pord_type not in ('@ordtypes@') )
AND ( porddet.dlv_date <= to_date('@todate@') ) AND ( porddet.dlv_date <= to_date('@todate@') )
GROUP BY porder.purc_order, porddet.line_no,'P-ORD',item.item_code__plan,porddet.dlv_date, porddet.site_code GROUP BY porder.purc_order, porddet.line_no,'P-ORD',item.item_code__plan,porddet.dlv_date, porddet.site_code
...@@ -160,7 +160,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -160,7 +160,7 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
FROM STOCK a, INVSTAT b , LOCATION c,item d FROM STOCK a, INVSTAT b , LOCATION c,item d
WHERE a.loc_code = c.loc_code WHERE a.loc_code = c.loc_code
AND b.inv_stat = c.inv_stat AND b.inv_stat = c.inv_stat
AND NVL(b.stat_type, ' ') <> @ordtypes@ AND NVL(b.stat_type, ' ') <> ('@ordtypes@')
AND ( a.site_code >= ('@sitecodeFr@') ) AND ( a.site_code >= ('@sitecodeFr@') )
AND ( a.site_code <= ('@sitecodeTo@') ) AND ( a.site_code <= ('@sitecodeTo@') )
AND ( a.item_code ) >= ( '@itemcodeFr@' ) AND ( a.item_code ) >= ( '@itemcodeFr@' )
...@@ -225,21 +225,20 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin ...@@ -225,21 +225,20 @@ select item_code, due_date, sum(demand) demand , sum(supply) supply, tran_id,lin
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
UNION ALL 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 , select proj_est_bsl_item.tran_id, TO_CHAR(proj_est_bsl_item.line_no), 'PRJBSL' as tran_ser, proj_est_bsl_item.item_code,
0 as supply, floor_mst.site_code proj_est_bsl_item.start_date as due_date, 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 from proj_est_bsl_item, floor_mst
where ( proj_est_bsl_item.floor_id= floor_mst.tran_id ) where ( proj_est_bsl_item.floor_id= floor_mst.tran_id )
AND ( floor_mst.site_code >= ('@sitecodeFr@') ) AND ( floor_mst.site_code >= '@sitecodeFr@' )
AND ( floor_mst.site_code <= ('@sitecodeTo@') ) AND ( floor_mst.site_code <= '@sitecodeTo@' )
AND ( proj_est_bsl_item.item_code >= ('@itemcodeFr@')) AND ( proj_est_bsl_item.item_code >= '@itemcodeFr@')
AND ( proj_est_bsl_item.item_code <= ('@itemcodeTo@')) 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('@fromdate@'))
AND ( proj_est_bsl_item.start_date <= to_date('@itemserTo@')) AND ( proj_est_bsl_item.start_date <= to_date('@todate@'))
GROUP BY proj_est_bsl_item.tran_id , GROUP BY
proj_est_bsl_item.item_code, proj_est_bsl_item.tran_id, TO_CHAR(proj_est_bsl_item.line_no),'PRJBSL', proj_est_bsl_item.item_code, proj_est_bsl_item.start_date,
proj_est_bsl_item.line_no,
proj_est_bsl_item.start_date ,
floor_mst.site_code floor_mst.site_code
) ALIAS ) 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
......
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