{"id":18456,"date":"2019-06-11T14:26:16","date_gmt":"2019-06-11T17:26:16","guid":{"rendered":"https:\/\/orabr.com\/?p=18456"},"modified":"2019-06-11T14:26:23","modified_gmt":"2019-06-11T17:26:23","slug":"oracle-r11-r12-query-de-po-aberta-e-seus-detalhes","status":"publish","type":"post","link":"https:\/\/orabr.virttus.com\/?p=18456","title":{"rendered":"ORACLE R11 R12 QUERY DE PO ABERTA E SEUS DETALHES"},"content":{"rendered":"<HTML><HTML>\n<pre class=\"wp-block-code\"><code>\n\nSELECT ph.segment1 po_num, ph.creation_date, hou.NAME \"Operating Unit\",\n        ppx.full_name \"Buyer Name\", ph.type_lookup_code \"PO Type\",\n        plc.displayed_field \"PO Status\", ph.comments, pl.line_num,\n        plt.order_type_lookup_code \"Line Type\", msi.segment1 \"Item Code\",\n        pl.item_description, pl.unit_meas_lookup_code \"UOM\",\n        pl.base_unit_price, pl.unit_price, pl.quantity,\n        ood.organization_code \"Shipment Org Code\",\n        ood.organization_name \"Shipment Org Name\", pv.vendor_name supplier,\n        pvs.vendor_site_code, (pl.unit_price * pl.quantity) \"Line Amount\",\n        prh.segment1 req_num, prh.type_lookup_code req_method,\n        ppx1.full_name \"Requisition requestor\"\n   FROM po_headers_all ph,\n        po_lines_all pl,\n        po_distributions_all pda,\n        po_vendors pv,\n        po_vendor_sites_all pvs,\n        po_distributions_all pd,\n        po_req_distributions_all prd,\n        po_requisition_lines_all prl,\n        po_requisition_headers_all prh,\n        hr_operating_units hou,\n        per_people_x ppx,\n        mtl_system_items_b msi,\n        po_line_types_b plt,\n        org_organization_definitions ood,\n        per_people_x ppx1,\n        po_lookup_codes plc\n  WHERE 1 = 1\n    AND ph.vendor_id = pv.vendor_id\n    AND PH.ORG_ID =                           NVL(NULL,PH.ORG_ID) --TROCAR NULL PELO ORG_ID\n    AND ph.po_header_id = pl.po_header_id\n    AND ph.vendor_site_id = pvs.vendor_site_id\n    AND ph.po_header_id = pd.po_header_id\n    AND pl.po_line_id = pd.po_line_id\n    AND pd.req_distribution_id = prd.distribution_id(+)\n    AND prd.requisition_line_id = prl.requisition_line_id(+)\n    AND prl.requisition_header_id = prh.requisition_header_id(+)\n    AND hou.organization_id = ph.org_id\n    AND ph.agent_id = ppx.person_id\n    AND pda.po_header_id = ph.po_header_id\n    AND pda.po_line_id = pl.po_line_id\n \n    AND ph.closed_code = 'OPEN'\n    AND pl.line_type_id = plt.line_type_id\n    AND ood.organization_id = pda.destination_organization_id\n    AND ppx1.person_id(+) = prh.preparer_id\n    AND pda.destination_organization_id = msi.organization_id(+)\n    AND msi.inventory_item_id = NVL (pl.item_id, msi.inventory_item_id)\n    AND plc.lookup_type = 'DOCUMENT STATE'\n    AND plc.lookup_code = ph.closed_code<\/code><\/pre>\n<\/code><\/pre>\n<\/HTML><\/HTML>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-18456","post","type-post","status-publish","format-standard","hentry","category-base-de-conhecimentos"],"_links":{"self":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18456"}],"version-history":[{"count":1,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18456\/revisions"}],"predecessor-version":[{"id":18457,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=\/wp\/v2\/posts\/18456\/revisions\/18457"}],"wp:attachment":[{"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orabr.virttus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}