PO_采购单信息

/*
  當區號為空時,區號與號碼不加橫桿(-)連接 。
 decode(length(po_vendor_contacts.area_code) ,'', po_vendor_contacts.area_code, po_vendor_contacts.area_code ||'-' )|| po_vendor_contacts.phone as Tel  
 功能:採購單 信息 (採購單號,交貨方式,聯絡人,電話,地址 , 序号,物料编号,品名/规格,单位,单价,数量)  
 Author: Zaorv
 Date :2010-07-02
 */
 /*  ******* BEGIN *********   */
  select po_headers_all.segment1 AS PO_NO
   ,po_headers_all.FOB_LOOKUP_CODE
   ,po_vendor_contacts.First_name|| ' ' || po_vendor_contacts.Last_name || ' ' || po_vendor_contacts.Prefix as Contactor
   ,decode(length(po_vendor_contacts.area_code) ,'', po_vendor_contacts.area_code, po_vendor_contacts.area_code ||'-' )|| po_vendor_contacts.phone as Tel   
   ,po_vendor_sites_all.Address_line1
   ,po_lines_all.Line_NUM
  -- ,po_lines_all.item_ID
   ,MTL_SYSTEM_ITEMS.SEGMENT1  -- 物料編號
   ,Po_lines_all.item_description AS DESCRIPTION1  -- 品名/規格
   ,po_lines_all.unit_meas_lookup_code  AS UOM  -- 單位
   ,po_lines_all.unit_price AS PRICE
   ,po_lines_all.quantity
   ,po_lines_all.unit_price* po_lines_all.quantity AS AMOUNT
   From po.po_headers_all po_headers_all ,
       po.po_lines_all po_lines_all ,
       po.po_vendors po_vendors ,
       po.po_vendor_contacts po_vendor_contacts ,
       po.po_vendor_sites_all  po_vendor_sites_all ,
       (SELECT inventory_item_id,description,segment1 from  apps.MTL_SYSTEM_ITEMS group by segment1 ) MTL_SYSTEM_ITEMS
     where    
       po_headers_all.vendor_id = po_vendors.vendor_id  
       and po_headers_all.vendor_site_id =po_vendor_sites_all.vendor_site_id
       and po_headers_all.vendor_contact_id = po_vendor_contacts.vendor_contact_id
       AND po_headers_all.po_header_id = po_lines_all.po_header_id
       AND po_lines_all.item_id = MTL_SYSTEM_ITEMS.INVENTORY_ITEM_ID
       and po_headers_all.segment1 like 'DMBC%'
     ORDER BY po_headers_all.segment1,po_lines_all.Line_NUM  ;   
/* *********** END ***************   */    
採購單號:DMBC%, GLT%,   
DMBC80113W
请使用浏览器的分享功能分享到微信等