Commit 51638918 authored by smanohar's avatar smanohar

Changes for existence of demand for item

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196146 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 726e2baf
select distinct item.item_code__plan as item_code
FROM independent_demand, item ,siteitem
where ( independent_demand.item_code = item.item_code )
and ( independent_demand.site_code in ('@sitecode@') )
and ( item.item_code__plan >= '@itemcodefr@')
and ( item.item_code__plan <= '@itemcodeto@')
and (siteitem.site_code = independent_demand.site_code))
and siteitem.item_code = case when item.item_code__plan is null then item.item_code else item.item_code__plan end
and case when siteitem.master_sch is null then 'Y' else siteitem.master_sch end <> 'N'
and (siteitem.mfg_type not in ('O','D') )
and ( independent_demand.due_date >= to_date('@fromdate@'))
and ( independent_demand.due_date <= to_date('@todate@'))
and ( case when independent_demand.status is null then 'C' else independent_demand.status end <> 'P')
and ( independent_demand.quantity__std_uom <> 0)
\ No newline at end of file
select distinct CASE WHEN item.item_code__plan is null then item.item_code else item.item_code__plan end as item_code
FROM sorder,sorditem, item, siteitem
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 (item.item_code__plan >= '@itemcodefr@')
and (item.item_code__plan <= '@itemcodeto@')
and (siteitem.site_code = sorditem.site_code)
and siteitem.item_code = case when item.item_code__plan is null then item.item_code else item.item_code__plan end
and case when siteitem.master_sch is null then 'Y' else siteitem.master_sch end <> 'N'
and (siteitem.mfg_type in ('O','D'))
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 (@ordtypes@) )
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