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. joseph-约瑟夫环问题

    约瑟夫环运作如下: 1.一群人围在一起坐成环状(如:N) 2.从某个编号开始报数(如:K) 3.数到某个数(如:M)的时候,此人出列,下一个人重新报数 4.一直循环,直到所有人出列,约瑟夫环结束 关于 ...

  2. C语言IO操作总结

    C语言IO操作总结C程序将输入看做字节流,流的来源是文件.输入设备.或者另一程序的输入:C程序将输出也看做字节流:流的目的是文件.视频显示等: 文件处理:1 :fopen("filename ...

  3. C 宏定义

    C/C++中宏使用总结 .C/C++中宏总结C程序的源代码中可包括各种编译指令,这些指令称为预处理命令.虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境.本节将介绍如何应用预处理程序和注释 ...

  4. Delphi线程同步(临界区、互斥、信号量,包括详细代码)

    当有多个线程的时候,经常需要去同步这些线程以访问同一个数据或资源. 例如,假设有一个程序,其中一个线程用于把文件读到内存,而另一个线程用于统计文件的字符数.当然,在整个文件调入内存之前,统计它的计数是 ...

  5. 类:初识类的事件(有点不明白,怎么普通Precedure可以赋值给TEvent)

    先勾画一下思路:1.建立一个类, 里面有年龄字段 FAge;2.通过 Age 属性读写 FAge;3.如果输入的年龄刚好是 100 岁, 将会激发一个事件, 这个事件我们给它命名为: OnHundre ...

  6. Regex类

    一.属性 CacheSize 获取或设置已编译的正则表达式的当前静态缓存中的最大项数. 默认是15个,最近使用的15个会存在缓存中,避免重新创建.当有第16个进来会替换掉第  1个.保持15个.Opt ...

  7. 编译boost python模块遇到的错误:../../libraries/boost_1_44_0/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory

    就是遇到类似标题上面的错误. 原因是没有安装对应python的python-dev依赖,不然编译到boost python模块的时候就会出错. 所以解决方案是sudo apt-get install ...

  8. poj 3311 Hie with the Pie(状态压缩dp)

    Description The Pizazz Pizzeria prides itself or more (up to ) orders to be processed before he star ...

  9. java排列

    排列:它可以被看作是多个相同类型的数据的组合,这些数据的统一管理. 1.声明. 创建 一维:type[]  var  比如:int[] a或 int a[]: 数组名= new  数组元素的类型[数组 ...

  10. hdu2095 像水题的不错题 异或运算

    异或运算的基础有点忘记了 先介绍一下..2个数异或 就是对于每一个二进制位进行位运算 具有2个特殊的性质 1.一个数异或本身恒等于0,如5^5恒等于0: 2.一个数异或0恒等于本身,如5^0恒等于5. ...