PO采购-采购订单

这篇博客详细介绍了如何在Oracle采购订单(PO)系统中查询采购订单的头信息,包括供应商、收货地址、购买人、订单类型、发货地、账单地址、状态、创建日期等关键信息。此外,还涵盖了行信息,如行类型、物品、数量、价格等,并探讨了配送和分发细节。

2014-01-06

头信息:

po : po_headers_all.segment1

rev : po_headers_all.revision_num

supplier

SELECT v.vendor_name
FROM po_headers_all poh,
     po_vendors     v
where v.vendor_id(+) = poh.vendor_id
and poh.segment1 = 'FCJT1109220015';

ship-to

SELECT hrl1.location_code
  FROM po_headers_all      poh,
       hr_locations_all_tl hrl1
 WHERE hrl1.location_id(+) = poh.ship_to_location_id
   AND hrl1.language(+) = userenv('LANG')
   AND poh.segment1 = 'FCJT1109220015';

buyer :

SELECT p.full_name
  FROM po_headers_all poh,
       per_people_f   p
 WHERE poh.agent_id = p.person_id
   AND trunc(SYSDATE) BETWEEN p.effective_start_date AND p.effective_end_date
   AND p.employee_number IS NOT NULL
   AND poh.segment1 = 'FCJT1109220015';

description :  po_headers_all.comments

type

SELECT pdt.type_name
  FROM po_headers_all        poh,
       po_document_types_all pdt
 WHERE ((pdt.document_type_code IN ('PO',
                                    'PA') AND pdt.document_subtype = poh.type_lookup_code))
   AND poh.org_id = pdt.org_id
   AND poh.segment1 = 'FCJT1109220015';

site

SELECT vs.vendor_site_code
  FROM po_headers_all  poh,
       po_vendor_sites_all vs
 WHERE vs.vendor_site_id(+) = poh.vendor_site_id
   AND poh.segment1 = 'FCJT1109220015';

bill-to :

SELECT hrl2.location_code
  FROM po_headers_all      poh,
       hr_locations_all_tl hrl2
 WHERE hrl2.location_id(+) = poh.bill_to_location_id
   AND hrl2.language(+) = userenv('LANG')
   AND poh.segment1 = 'FCJT1109220015';

status : --

created : po_headers_all.creation_date

contact

SELECT decode(poh.vendor_contact_id,
              NULL,
              NULL,
              vc.last_name || ', ' || vc.first_name)
  FROM po_headers_all     poh,
       po_vendor_contacts vc
 WHERE vc.vendor_contact_id(+) = poh.vendor_contact_id
   AND poh.segment1 = 'FCJT1109220015';

currency : po_headers_all.currency_code

total : --

行信息:

line tab

num : po_lines_all.line_num

type

SELECT plt.line_type
  FROM po_lines_all  pol,
       po_line_types plt

 WHERE plt.line_type_id(+) = pol.line_type_id
   AND pol.po_header_id = 69774;
item :

SELECT msi.segment1
  FROM po_lines_all       pol,
       mtl_system_items_b msi
 WHERE msi.inventory_item_id(+) = pol.item_id
   AND msi.organization_id = pol.org_id
   AND pol.po_header_id = 69774;

rev : po_lines_all.item_revision

category : --

description :

SELECT msi.description
  FROM po_lines_all       pol,
       mtl_system_items_b msi
 WHERE msi.inventory_item_id(+) = pol.item_id
   AND msi.organization_id = pol.org_id
   AND pol.po_header_id = 69774;

uom : po_lines_all.unit_meas_lookup_code

quantity : po_lines_all.quantity

price :

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值