Commit dce5d6a2 authored by prane's avatar prane

removed select mps_order sql as per suggested Manoharan sir for syncom

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183961 ce508802-f39f-4f6c-b175-0d175dae99d5
parent be7989dc
......@@ -9,9 +9,10 @@ select item_code,due_date, demand, 0 supply, 0 stock_qty, 0 oth_supply,
(sorder.sale_order = sorditem.sale_order ) and
(case when sorder.confirmed is null then 'N' else sorder.confirmed end = 'Y' ) and
(case when sorditem.consume_fc is null then 'Y' else sorditem.consume_fc end = 'N' ) and
(sorditem.site_code in ('') ) AND
(item.item_code__plan = '') AND
(sorditem.due_date >= to_date('')) and
(sorditem.due_date <= to_date('')) and
(CASE WHEN SORDER.STATUS IS NULL THEN 'P' ELSE SORDER.STATUS END = 'P') AND
(sorder.order_type not in ('S') ) )
(sorditem.site_code in ('@sitecode@') ) AND
(item.item_code__plan = '@itemcode@') AND
(sorditem.due_date >= to_date('@fromdate@')) and
(sorditem.due_date <= to_date('@todate@')) and
(case when sorder.status is null then 'P' else sorder.status end = 'P') and
(sorder.order_type not in ('S') )
)
select sale_order,line_no,item_code,due_date, demand, 0 supply, 0 stock_qty, 0 oth_supply,
0 as pending_po, 0 as pending_do, 0 as pending_indent, 0 as pending_dr,site_code from
(
SELECT sorditem.sale_order,sorditem.line_no,item.item_code__plan as item_code,sorditem.due_date as due_date,
((case when sorditem.quantity is null then 0 else sorditem.quantity end - case when sorditem.qty_alloc is null then 0 else sorditem.qty_alloc end - case when sorditem.qty_desp is null then 0 else sorditem.qty_desp end ) * case when sorditem.conv__qty_stdqty is null then 1 else sorditem.conv__qty_stdqty end ) as demand,
0 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 , sorditem.site_code
FROM sorder,sorditem, item
WHERE ( sorditem.item_code = item.item_code ) and
(sorder.sale_order = sorditem.sale_order ) and
(case when sorder.confirmed is null then 'N' else sorder.confirmed end = 'Y' ) and
(case when sorditem.consume_fc is null then 'Y' else sorditem.consume_fc end = 'N' ) and
(sorditem.site_code in ('@sitecode@') ) AND
(sorditem.item_code = '@itemcode@') AND
(sorditem.due_date >= to_date('@fromdate@')) and
(sorditem.due_date <= to_date('@todate@')) and
( case when sorder.status is null then 'P' else sorder.status end = 'P') and
( sorder.order_type not in ('S') )
and trim(nvl((select si.mfg_type from siteitem si where si.site_code = sorditem.site_code and si.item_code = item.item_code ),' ')) in ('O','D')
and ((CASE WHEN SORDITEM.QUANTITY IS NULL THEN 0 ELSE SORDITEM.QUANTITY END
- CASE WHEN SORDITEM.QTY_ALLOC IS NULL THEN 0 ELSE SORDITEM.QTY_ALLOC END
- CASE WHEN SORDITEM.QTY_DESP IS NULL THEN 0 ELSE SORDITEM.QTY_DESP END )
* CASE WHEN SORDITEM.CONV__QTY_STDQTY IS NULL THEN 1 ELSE SORDITEM.CONV__QTY_STDQTY END ) >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