Commit efe9b5aa authored by prane's avatar prane

added spcaes

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@202704 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bc889ac9
......@@ -24,7 +24,9 @@
( sales_demand.due_date <= to_date('@todate@')) AND
( 0 = @madetostock@ )
Group By sales_demand.tran_id,'S-FCT',item.item_code__plan,sales_demand.due_date
UNION ALL
SELECT h.tran_id, 'S-FST' as tran_ser, item.item_code__plan as item_code,fn_get_prdfrdate(d.PRD_CODE__FOR) as due_date,
sum(fn_get_avgpotency('@itemcode@' ,'@sitecode@',case when d.quantity is null then 0 else d.quantity end )) as demand ,
0 as supply
......@@ -39,6 +41,7 @@ UNION ALL
and trim(nvl((select si.mfg_type from siteitem si where si.site_code = h.site_code and si.item_code = item.item_code ),' ')) not in ('O','D')
Group By h.TRAN_ID, 'S-FST', item.item_code__plan,fn_get_prdfrdate(d.PRD_CODE__FOR)
UNION ALL
SELECT distorder.dist_order||'@'||distorder_det.line_no tran_id, 'Dist Order' as tran_ser, 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,
0 as supply
......
......@@ -11,7 +11,9 @@
( independent_demand.due_date <= to_date('@todate@')) and
( case when independent_demand.status is null then 'C' else independent_demand.status end <> 'P')
Group By item.item_code__plan,independent_demand.due_date
UNION ALL
SELECT item.item_code__plan as item_code,sales_demand.due_date as due_date,
sum(case when sales_demand.quantity__std_uom is null then 0 else sales_demand.quantity__std_uom end - case when sales_demand.consumed_qty is null then 0 else sales_demand.consumed_qty end ) as demand,
0 as supply
......@@ -25,6 +27,7 @@
Group By item.item_code__plan,sales_demand.due_date
UNION ALL
SELECT item.item_code__plan as item_code,fn_get_prdfrdate(d.PRD_CODE__FOR) as due_date,
sum(fn_get_avgpotency('@itemcode@' ,'@sitecode@',case when d.quantity is null then 0 else d.quantity end )) as demand ,
0 as supply
......
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