select a.vendor_number             供应商编码
      ,a.vendor_name                   供应商名称
      ,a.item_number                      物料编码
      ,a.item_description                 物料描述 
      ,a.po_number                      采购订单号
      ,a.receipt_num                          收据号
      ,a.transaction_date                 入库日期
      ,a.primary_quantity                入库数量
      ,a.unit_price                        采购订单价  /*一揽子协议价+入库金额*/
      ,(select pll.price_override                 
          from apps.po_lines_all              pla2
                ,apps.po_headers_all         pha2
                ,apps.po_line_locations_all    pll
         where pla2.item_id = a.inventory_item_id
           and pla2.po_header_id = pha2.po_header_id
           and pha2.type_lookup_code = 'BLANKET'
           and pha2.vendor_site_id = a.vendor_site_id
           and pla2.po_line_id = pll.line_location_id
           And pha2.AUTHORIZATION_STATUS = 'APPROVED'
           And pha2.approved_flag = 'Y'
           And nvl(pha2.cancel_flag,'N') = 'N'
           And nvl(pha2.closed_code,'OPEN') = 'OPEN'
           And nvl(pla2.cancel_flag,'N') = 'N'
           And nvl(pla2.closed_code,'OPEN') = 'OPEN'
           and trunc(a.transaction_date) between
                 nvl(pll.start_date
                  ,a.transaction_date - 1) and
                 nvl(pll.end_date
                  ,a.transaction_date + 1)) blanket_price
  from (select pv.segment1 vendor_number
              ,pv.vendor_name
              ,msi.segment1 item_number
              ,msi.description item_description
              ,pha.segment1 po_number
              ,rsh.receipt_num
              ,trunc(mmt.transaction_date) transaction_date
              ,sum(mmt.primary_quantity) primary_quantity
              ,pla.unit_price
              ,pha.vendor_site_id
              ,msi.inventory_item_id
              ,pha.po_header_id
          from apps.mtl_material_transactions mmt
              ,apps.po_headers_all                     pha
              ,apps.mtl_system_items_b             msi
              ,apps.po_vendors                            pv
              ,apps.rcv_transactions                      rt
              ,apps.rcv_shipment_headers           rsh
              ,apps.po_lines_all                           pla
         where mmt.organization_id = X
           and mmt.transaction_source_type_id = 1
           and mmt.transaction_source_id = pha.po_header_id
           and mmt.inventory_item_id = msi.inventory_item_id
           and mmt.organization_id = msi.organization_id
           and pha.vendor_id = pv.vendor_id
           and mmt.source_code = 'RCV'
           and mmt.source_line_id = rt.transaction_id
           and rt.shipment_header_id = rsh.shipment_header_id
           and rt.po_line_id = pla.po_line_id
         group by pv.segment1
                 ,pv.vendor_name
                 ,msi.segment1
                 ,msi.description
                 ,pha.segment1
                 ,rsh.receipt_num
                 ,trunc(mmt.transaction_date)
                 ,pla.unit_price
                 ,pha.vendor_site_id
                 ,msi.inventory_item_id
                 ,pha.po_header_id) a

Oracle EBS-SQL (INV-8):检查物料入库明细信息.sql的更多相关文章

  1. SQL显示某月全部日期明细以及SQL日期格式

    SQL显示某月全部日期明细<存储过程> 方法一: declare @date datetime declare @end datetime ,getdate()) ,@date) crea ...

  2. Oracle EBS-SQL (BOM-8):检查物料属性(无采购员).sql

    select       msi.segment1                                  物料编码,       msi.DESCRIPTION               ...

  3. Oracle EBS 隐藏帮助-诊断-检查

  4. Oracle EBS DBA常用SQL - 安装/补丁【Z】

    Oracle EBS DBA常用SQL - 安装/补丁 检查应用补丁有没有安装:select bug_number,last_update_date from ad_bugs where bug_nu ...

  5. Oracle EBS中分类账和法人实体 的关系(有sql语句实例)

    Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报  分类: Oracle EBS(12)  Oracle数据 ...

  6. Oracle EBS 采购 接收入库 接口开发

    http://blog.itpub.net/25164132/viewspace-746657/ 接收入库是项目中会经常碰到的开发,这类开发一般来说比较简单,但是接收入库在Oracle中其实涉及到很多 ...

  7. Oracle EBS应用笔记整理 (转自IT++ flyingkite)

    ***************************************************** Author: Flyingkite Blog:   http://space.itpub. ...

  8. [转]oracle EBS 基础100问

    from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...

  9. Oracle EBS R12经验谈(二)

    作者: jianping.ni    时间: 2009-2-13 12:52     标题: Oracle EBS R12经验谈(二) OAF页面:银行帐户开户人LOV值列表无值    在输入 应付超 ...

随机推荐

  1. Django学习之路

    Django Website Collect django packages http://djangopackages.com/ django project http://code.djangop ...

  2. mysql innodb_double_write特性

    知识储备: 1.mysql 的crasy recovery 是通过redo log 和undo log 来完成的: 2.redo log 和undo log的记录的是对页面的物理操作:如在1024号p ...

  3. wordpress教程之get_option()

    get_option函数的作用 如果你想开发自己的一个wordpress插件,那么也许你有些数据希望保存,这些自定义数据一起都保存在 wordpress数据库的wp_options表,wp_optio ...

  4. 使用PHP从web访问mysql数据库

    一. web数据库构架的工作原理 1. 用户由浏览器发出HTTP请求,请求特定的web页面. 2. web服务器接受接收到对特定页面的请求,检索相应文件,并将其传递给php引擎处理. 3. php引擎 ...

  5. A(51)和C(51)相互调用

    C语言是一种编译型程序设计语言,它兼顾了多种高级语言的特点,并可以调用汇编语言的子程序.用C语言设计开发微控制器程序已成为一种必然的趋势.Franklin C51是一种专门针对Intel 8051系列 ...

  6. CEF中文教程(google chrome浏览器控件) -- Windows下编译Chromium

    CEF中文教程(google chrome浏览器控件) -- CEF简介 2013-04-10 16:48 42928人阅读 评论(4) 收藏 举报  分类: CEF(2)    目录(?)[+]   ...

  7. Google map v3 using simple tool file google.map.util.js v 1.0

    /** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的(div)z-inde ...

  8. Kth Smallest Element in a BST 解答

    Question Given a binary search tree, write a function kthSmallest to find the kth smallest element i ...

  9. The Java™ Tutorials下载地址

    1.The Java™ Tutorials下载地址: http://www.oracle.com/technetwork/java/javase/java-tutorial-downloads-200 ...

  10. Mac 下纯lua(二)

    Lua库 基本函数 assert(v,[,message]) 当v时false时,返回message assert(money >0,"error -1001"); coll ...