P. 1
item.txt

item.txt

|Views: 8|Likes:
Published by Olabooye Ayodeji
item
item

More info:

Published by: Olabooye Ayodeji on Jul 30, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

10/06/2015

pdf

text

original

SELECT distinct decode (hao.

organization_id, '593','Oando Gas and Power', '639','Oando Energy Services', '640','Oando Energy Services', '261','Oando Exploration & Production', '262','Oando Marketing Plc', '263','Oando Marketing Plc', '264','Oando Supply & Trading', '265','Oando Group Plc', '266','Oando Marketing Plc', '267','Oando Marketing Plc', '268','Oando Group Plc', '269','Oando Gas and Power', '270','Oando Marketing Plc', '271','Oando Refinery & Terminal', '272','Oando Gas and Power', '273','Oando Energy Services', '274','Oando Supply & Trading', '1517','Oando Exploration & Production', '645','Oando Exploration & Production', '1518','Oando Exploration & Production', '1519','Oando Exploration & Production', '1869','Oando Exploration & Production', '343','Oando Exploration & Production', '344','Oando Exploration & Production', '345','Oando Exploration & Production', '1244','Oando Exploration & Production', '1245','Oando Exploration & Production', '1246','Oando Exploration & Production', '1247','Oando Exploration & Production', '1248','Oando Exploration & Production', '1249','Oando Exploration & Production', '2046','Oando Gas and Power', '2047','Oando Gas and Power', '2048','Oando Gas and Power', '1332','Oando Exploration & Production', '1333','Oando Exploration & Production', '1334','Oando Exploration & Production', '1335','Oando Exploration & Production', '1198','Oando Exploration & Production', '646','Oando Gas and Power', '0', 'Oando PLC', '666','Oando Exploration & Production' ) "Entity", hao.name "Company",--po_release_id , pha.segment1 "BPA Num" ,pra.RELEASE_NUM ,pha.COMMENTS "BPA Desc" ,pha.CREATION_DATE "BPA Creation Date" ,pra.RELEASE_DATE ,pv.VENDOR_NAME Vendor ,pha.BLANKET_TOTAL_AMOUNT "Amount Agreed" ,PHA.CURRENCY_CODE Currency ,NVL((select CONVERSION_RATE from gl_daily_rates where to_currency='NGN' AND from_currency=PHA.CURRENCY_CODE AND CONVERSION_TYPE='Corporate' AND CONVERSION_DATE= (select MAX(CONVERSION_DATE) from gl_daily_rates

org_id =273 --and pha.'Oando Gas and Power'.'Oando Marketing Plc'.'Oando Marketing Plc'.price_override * pll.pra.'Oando Group Plc'.SUM (pll. '640'.RELEASE_NUM.'Oando Group Plc'.pha.CURRENCY_CODE--.APPROVED_DATE BPA_Appro ve_Date .CURRENCY_CODE in ( 'NGN'.pha.APPROVED_DATE.COMMENTS. pha.'Oando Marketing Plc'.VENDOR_ID=pha. '267'.(select count(release_num) from po_releases_all where po_header_id = pha. '639'.4 -------------------- -----SELECT distinct decode (hao.org_id and pha.RELEASE_DATE.approved_date .po_header_id AND pll.2.organization_id.po_release_id IS not NULL and pv. '263'.po_releases_all pra WHERE pll.CLOSED_CODE.1) Currency_Rate .pha.pv. round(((pra.CREATION_DATE.authorization_status.'Oando Energy Services'.quantity) "Amount Released" --.3.VENDOR_NAME.hr_all_organization_units hao .authorization_ status.pha.agent_name "Buyer".0 "Amount Released" .po_release_id order by 1.CURRENCY_CODE)). '268'.PO_HEADER_ID in (select PO_HEADER_ID from po_releases_all where AU THORIZATION_STATUS ='APPROVED') -.'USD') GROUP BY pha.C LOSED_CODE .nvl(pha.organization_id=pha.0) BPA_Creatnn_Aprv_Inte rval_Days .po_header_id = pra. '261'.agent_id = pav. '593'.pav.pav.pha. po_line_locations_all pll . '266'.TYPE_LOOKUP_CODE = 'BLANKET' and hao.pha. round(((pha.CREATION_DATE)* 1).PO_HEADER_ID not in (select PO_HEADER_ID from po_releases_all) --AND pha .RELEASE_DATE .po_agents_v pav . .APPROVED_DATE )* 1).hao.'Oando Exploration & Production'.agent_id(+) AND pha.hao.pha.BLANKET_TOTAL_AMOUNT. '262'.agent_name. pha.PO_HEADER_ID not in (select PO_HEADER_ID from po_releases_all whe re AUTHORIZATION_STATUS ='APPROVED') and pha.name.VENDOR_ID AND pha.'Oando Energy Services'.and pha.segment1='9445'--'6769' --AND PHA.pha.po_header_id --and pha.pra.po_header_id(+) = pha.'OPEN') CLOSED_CODE FROM po_headers_all pha .pha.PHA.where to_currency='NGN' AND from_currency=PHA.'Oando Supply & Trading'. '264'.po_vendors pv .0) BPA_Rel_Aprv_Interval _Days .'Oando Marketing Plc'.organization_id.po_header_id.po_ header_id and AUTHORIZATION_STATUS ='APPROVED') num_of_releases .segment1. '265'.

pha.segment1 "BPA Num". '1245'.'Oando Exploration & Production'. '271'. '2047'. '1335'. '274'.'Oando Exploration & Production'.CREATION_DATE "BPA Creatio n Date". '1334'.pv.po_header_id AND pll.'Oando Exploration & Production'.approved_date . hr_all_organization_units hao --po_releases_all pra WHERE pll.quantity) "Amount Released" --. hao. po_line_locations_all pll .'Oando Exploration & Production' ) "Entity". '1198'.'Oando Supply & Trading'. '270'.and pha.--po_release_id .VENDOR_ID=pha.'Oando Exploration & Production'.'Oando Exploration & Production'.PO_HEADER_ID in (select PO_HEADER_ID from po_releases_all where AU THORIZATION_STATUS ='APPROVED') -. '2048'. pha.'Oando Gas and Power'.'Oando Energy Services'.'Oando Gas and Power'.'Oando Exploration & Production'.pha. '1519'.'269'.(select count(release_num) from po_releases_all where po_header_id = pha.agent_name "Buyer".SUM (pll.agent_id = pav.authorization_status.'Oando Marketing Plc'.TYPE_LOOKUP_CODE = 'BLANKET' and hao. '343'. '1248'. '0'.'Oando Gas and Power'.org_id and pha.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Exploration & Production'.COMMENTS "BPA Desc".BLANKET_TOTAL_AMOUNT "Amount Agreed" . '1333'.po_agents_v pav.pha.0 "Amount Released" . 'Oando PLC'.APPROVED_DATE BPA_Appro ve_Date .po_header_id(+) = pha.'Oando Exploration & Production'. '1517'.'Oando Exploration & Production'.0) BPA_Aprv_Interval_Day s . '646'. '1869'. '344'. '1244'. '666'.'Oando Gas and Power'. pha.'Oando Exploration & Production'. round(((pha.PO_HEADER_ID not in (select PO_HEADER_ID from po_releases_all whe re AUTHORIZATION_STATUS ='APPROVED') .CREATION_DATE)* 1).VENDOR_NAME Vendor .organization_id=pha.'Oando Exploration & Production'. '345'.pha.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Exploration & Production'.po_ header_id and AUTHORIZATION_STATUS ='APPROVED') num_of_releases FROM po_headers_all pha .VENDOR_ID AND pha.name "Company".'Oando Refinery & Terminal'. '273'.'Oando Gas and Power'.'Oando Gas and Power'. '2046'.po_vendors pv . '645'.price_override * pll. '1246'.'Oando Exploration & Production'.po_release_id IS not NULL and pv. '272'.agent_id(+) AND pha. '1247'.pav.'Oando Exploration & Production'. '1332'. '1249'.pha. '1518'.

'345'. '1869'. '268'.pv. '1198'.po_header_id.pha.'Oando Marketing Plc'.'Oando Energy Services'.'Oando Exploration & Production'.'Oando Gas and Power'.agent_name. '1244'. '344'.CREATION_DATE "BPA Creatio n Date".VENDOR_NAME. '1333'.'Oando Supply & Trading'.'Oando Marketing Plc'.'Oando Exploration & Production'.'Oando Exploration & Production'.COMMENTS "BPA Desc".pha.organization_id.'Oando Exploration & Production'.'Oando Exploration & Production'. '666'.'Oando Gas and Power'.3 union all SELECT distinct decode (hao.--and pha.'Oando Refinery & Terminal'.hao.'Oando Exploration & Production'. '645'.'Oando Exploration & Production'.COMMENTS.po_header_id = pra.pha. '262'.segment1 "BPA Num". '1248'. '1517'.--po_release_id .'Oando Exploration & Production'.pha.'Oando Exploration & Production'.org_id =273 --and pha.pha.hao.pv.'Oando Exploration & Production'.'Oando Gas and Power'. '1518'. '269'. '272'. pha.'Oando Energy Services'.'Oando Gas and Power'. '270'. '1335'.'Oando Exploration & Production' ) "Entity". '343'. '2048'. '1249'. 'Oando PLC'. '265'. '1519'.authorization_ status. '2046'.'Oando Gas and Power'.PO_HEADER_ID not in (select PO_HEADER_ID from po_releases_all) -AND pha .pav. '263'. '2047'. '1332'.'Oando Group Plc'. '640'. '261'. '1245'.'Oando Exploration & Production'.BLANKET_TOTAL_AMOUNT "Amount Agreed" .'Oando Exploration & Production'.'Oando Group Plc'.2.authorization_status='APPROVED' GROUP BY pha. '266'. pha. '593'.name "Company".'Oando Exploration & Production'.segment1='6347'--'6769' and pha. '273'. '1334'.segment1.CREATION_DATE.'Oando Gas and Power'.'Oando Exploration & Production'.po_header_id --and pha. '1246'.APPROVED_DATE--. '267'.BLANKET_TOTAL_AMOUNT.po_release_id --order by 1. '271'.name.'Oando Exploration & Production'.'Oando Marketing Plc'. '274'.'Oando Exploration & Production'. '646'.'Oando Exploration & Production'.pha.'Oando Exploration & Production'.VENDOR_NAME Vendor . '1247'.'Oando Exploration & Production'.'Oando Energy Services'. '0'.pha. hao. '264'.organization_id.'Oando Supply & Trading'.'Oando Gas and Power'.'Oando Marketing Plc'.'Oando Marketing Plc'. '639'.pha.'Oando Exploration & Production'.

quantity item_line_quantity.organization_id=pha. po_lines_all pla --. hr_all_organization_units hau.org_id =273 --and pha.CREATION_DATE)* 1).pha.po_header_i d.pha.pla.agent_name.pav.COMMENTS.BLANKET_TOTAL_AMOUNT.org_id = pla.org_id in ('273') .0 "Amount Released" .po_header_id = pla.APPROVED_DATE--.INVENTORY_ ITEM_ID=pla.po_item_description --.C REATION_DATE.organization_id = pha.agent_id = pav. -.VENDOR_NAME.pha.unit_price item_line_cost.po_release_id order by 1.organization_id.po_vendors pv .description master_item_descriptio n. pla.po_agents_v pav.item_id ) xx1.pha.name. pha.pla.(select distinct description from mtl_system_items_b a where a.authorization_status.authorization_status.SUM (pll.pha.pla.segment1.item_id) pla WHERE hau. pha.segment1 from mtl_system_items_b a where a.INVENTORY_ITEM_ID=pl a.comments po_item_description.VENDOR_ID AND pha.PO_HEADER_ID not in (select PO_HEADER_ID from po_releases_all) -AND pha .(select distinct a.(select distinct a.org_id --and a.creation_date po_date.APPROVED_FLAG.segment1 po_item_code.authorization_status='APPROVED' GROUP BY pha.INVENTORY_ITE M_ID=pla.hao.(select a.po_ header_id and AUTHORIZATION_STATUS ='APPROVED') num_of_releases FROM po_headers_all pha .NV L(pha. po_line_locations_all pll . hau. round(((pha.3 ------------------SELECT --(select distinct segment1 from mtl_system_items_b a where a.approved_date .AND a.price_override * pll.quantity * pla.NAME entity . po_item_code.description from mtl_system_items_b a where a.quantity) "Amount Released" .--. pla.(select count(release_num) from po_releases_all where po_header_id = pha.item_id.a.TYPE_LOOKUP_CODE = 'BLANKET' and hao.inventory_item_id = pla. pav.inven tory_item_id=pla.segment1 po_num.hao.2.agent_name "Buyer".i nventory_item_id=pla.segment1='6347'--'6769' and pha.item_id -. hr_all_organization_units hao WHERE pll.item_id ) master_item_description .APPROVED_FLAG='Y' and pha.'N') "Approved ?" FROM --mtl_system_items_b a.LINE_NUM --.DESCRIPTION LIKE '%S%' and pha.APPROVED_DATE BPA_Ap prove_Date .org_id --AND a. po_headers_all pha.po_header_id(+) = pha.po_header_id AND pha.item_id ) po_item_code --.VENDOR_ID=pha.pha. pha.po_header_id --AND pll.po_release_id IS not NULL and pv.organization_id = pla.0) BPA_Aprv_Interval_Day s . pla.pha.org_id and pha.unit_price item_amount.agent_id(+) AND pha. pla.pv.mtl_system_items_b a where a.* from po_lines_all pla.org_id AND pha.pha.item_id ) xx2.

'Oando Exploration & Production'.SEGMENT1 ='1001' ORDER BY 3 ------------------SELECT distinct decode (hao.and pha.QUANTITY_ORDERED. '0'. '1869'. '344'. '265'.'Oando Exploration & Production'. '1245'.'Oando Marketing Plc'.'Oando Exploration & Production'. '272'.organization_id. '1247'. '2048'. '1244'.'Oando Marketing Plc'. D.CREATION_DATE)) "PO DATE".VENDOR_NAME "Vendor Name".-. '271'.'Oando Marketing Plc'. '645'. '263'.'Oando Exploration & Production'.'Oando Gas and Power'.'Oando Exploration & Production'.SEGMENT1 "PO NUMBER".'Oando Refinery & Terminal'.'Oando Exploration & Production'. '343'. '270'. hao. '1518'.name "Company". '274'.'Oando Exploration & Production'. '1332'. '1248'.'Oando Gas and Power'.'Oando Supply & Trading'. '2047'.'Oando Exploration & Production'. '593'. G. '1198'. '639'. '269'.'Oando Exploration & Production'. '1517'.'Oando Exploration & Production'.'Oando Exploration & Production'. G. '666'. e. '1519'. '1333'. '273'.'Oando Exploration & Production'.'Oando Gas and Power'.'Oando Gas and Power'. '1246'. '262'. '646'.QUANTITY_CANCELLED.LINE_NUM "Line Num". '266'.ITEM_DESCRIPTION "LINE DESCRIPTION". (NVL (C.'Oando Group Plc'.'Oando Supply & Trading'.'Oando Exploration & Production'.'Oando Gas and Power'.'Oando Exploration & Production'. '268'. '345'.'Oando Exploration & Production' ) "Entity". '267'.'Oando Exploration & Production'. '1335'.'Oando Exploration & Production'.'Oando Energy Services'.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Marketing Plc'.'Oando Energy Services'. '640'. '261'.'Oando Gas and Power'.'Oando Gas and Power'. '1249'. 0)) * NVL (G . '264'. '1334'. TO_DATE (TRUNC (D.NVL (C. '2046'.'Oando Exploration & Production'.'Oando Group Plc'. 'Oando PLC'.'Oando Marketing Plc'.'Oando Energy Services'. 0) .

'593'.'Oando Exploration & Production'.TYPE_LOOKUP_CODE != 'BLANKET' AND PLL.VENDOR_ID(+) = D.'Oando Marketing Plc'.org_id='273' -.'Oando Exploration & Production'.VENDOR_SITE_ID AND D.'Oando Exploration & Production'. '1869'. '265'.'Oando Exploration & Production'. 0) "PO Line Amount".'Oando Gas and Power'.'Oando Exploration & Production'.VENDOR_ID AND F. '274'. PO_VENDORS E. PO_LINE_LOCATIONS_ALL PLL WHERE C. D.'Oando Exploration & Production'. '262'. PO_LINES_ALL G.SEGMENT1 ='5535' d.PO_HEADER_ID AND C.PO_LI AND PLL.'Oando Group Plc'.3 NE_ID --and --and order ----------------------SELECT distinct decode (hao.'Oando Marketing Plc'.ORG_ID AND D..'Oando Energy Services'. '272'.ORG_ID=hao. '266'. TRUNC(PLL.'Oando Gas and Power'. '1519'. '1517'.AND TRUNC(D. '345'.AUTHORIZATION_STATUS "Status" FROM PO_DISTRIBUTIONS_ALL C.'Oando Energy Services'.organization_id D. '1518'. PO_VENDOR_SITES_ALL F. HR_ALL_ORGANIZATION_UNITS HAO. '640'. '261'. '268'.PO_HEADER_ID=D.'Oando Gas and Power'.currency_code "Currency".PO_LINE_ID AND C.'Oando Marketing Plc'.PO_HEADER_ID AND PLL.PROMISED_DATE) "PROMISED DATE". '267'.UNIT_PRICE.PO_LINE_ID = G. .PO_HEADER_ID(+) AND E. '344'.PO_HEADER_ID = G. '263'.'Oando Marketing Plc'. D. '639'. '343'.'Oando Group Plc'.'Oando Energy Services'.PO_HEADER_ID IS NOT NULL AND D. '271'. '645'.PO_HEADER_ID = D. '1244'. '264'. '269'.'Oando Exploration & Production'.'Oando Exploration & Production'.'Oando Refinery & Terminal'.CREATION_DATE) BETWEEN SYSDATE-365 AND SYSDATE by 1. '270'. PO_HEADERS_ALL D.'Oando Supply & Trading'.'Oando Marketing Plc'.organization_id.ORG_ID=D.PO_LINE_ID=G.2.VENDOR_SITE_ID(+) = D.'Oando Supply & Trading'. '273'.'Oando Exploration & Production'.'Oando Exploration & Production'.

PO_VENDOR_SITES_ALL F. a.currency_code "Currency". G.AND TRUNC(D. D. 0) .APPROVED_FLAG. '1332'. C. '1198'.'Oando Exploration & Production' ) "Entity".'1245'.NVL (C.DESTINATION_TYPE_CODE.CREATION_DATE) BETWEEN SYSDATE-365 AND SYSDATE .VENDOR_SITE_ID AND D. PO_VENDORS E.SEGMENT1 ='5535' and d.org_id='273' -. 0) PO_Line_Item_Amount. --g.description master_item_description.quantity * g. '2048'.PO_LI NE_ID AND PLL. PO_HEADERS_ALL D.'Oando Gas and Power'.'Oando Gas and Power'. '1247'.ORG_ID=D.PO_HEADER_ID=D.PROMISED_DATE) "PROMISED DATE".inventory_item_id = g.organization_id and D. (NVL (C. e. D.PO_LINE_ID AND C. PO_LINE_LOCATIONS_ALL PLL.LINE_NUM "Line Num".'Oando Gas and Power'.ORG_ID AND D.unit_price item_amount.'Oando Exploration & Production'. hao. TO_DATE (TRUNC (D.ITEM_DESCRIPTION. '646'.organization_id = c.VENDOR_SITE_ID(+) = D. '1333'.'Oando Gas and Power'. 'Oando PLC'.'Oando Exploration & Production'.PO_LINE_ID=G.'Oando Exploration & Production'.'Oando Exploration & Production'.PO_HEADER_ID = G. '666'. '1246'.creation_date po_date. '1248'.'Oando Exploration & Production'.PO_LINE_ID = G.'N') "Approved ?".PO_HEADER_ID AND PLL. '1334'. TRUNC(PLL. NVL(d.VENDOR_ID(+) = D. d.'Oando Exploration & Production'.name "Company".'Oando Exploration & Production'.'Oando Exploration & Production'. PO_LINES_ALL G.c. '0'.PO_HEADER_ID AND C. '2046'.PO_HEADER_ID(+) AND E.VENDOR_NAME "Vendor Name".DESTINATION_ORGANIZATION_ID and C. '1249'. HR_ALL_ORGANIZATION_UNITS HAO.UNIT_PRICE. '1335'.PO_HEADER_ID = D. D.DESTINATION_ORGANIZATION_ID. mtl_system_items_b a WHERE * NVL (G a.CREATION_DATE)) "PO DATE". '2047'.segment1 po_item_code.AUTHORIZATION_STATUS "Status" FROM PO_DISTRIBUTIONS_ALL C.'Oando Exploration & Production'.SEGMENT1 "PO NUMBER".VENDOR_ID AND F.'Oando Exploration & Production'.QUANTITY_ORDERED. G.TYPE_LOOKUP_CODE != 'BLANKET' AND PLL.ORG_ID=hao. 0)) . a.item_id and a.QUANTITY_CANCELLED.PO_HEADER_ID IS NOT NULL AND D.

po_headers_all pha.NAME entity .quantity * pla. pha. pla.org_id --and a.org_id AND a.org_id = pla.APPROVED_FLAG.'N') "Approved ?" FROM mtl_system_items_b a. hr_all_organization_units hau. pla.unit_price item_amount.organization_id = pha.2. pha.organization_id = pla.6 ---------------SELECT hau.comments po_item_description.po_header_id = pla.description master_item_description.item_id AND a.3. po_lines_all pla WHERE hau.unit_price item_line_cost. a.DESCRIPTION LIKE '%S%' --and pha.a.creation_date po_date.quantity item_line_quantity. pla.order by 1.NV L(pha.segment1 po_item_code. pha.segment1 po_num.po_header_id AND pha.inventory_item_id = pla.SEGMENT1 ='6567' ORDER BY 3 .org_id in ('262') --and pha.org_id AND pha.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->