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. postgresql的psql命令

    1:不进入数据库而执行SQL命令,用参数-c 2:把SQL命令保存在一个外部文件中,用 -f 参数导入并执行 a1.txt文件内容 select * from student; 在shell中用如下命 ...

  2. StringBuilder是不是线程安全的?

    测试条件: 开启2个并行执行任务,往同一个StringBuilder对象写入值 测试代码: ; static StringBuilder sbIsThreadSafe = new StringBuil ...

  3. Eclipse Juno 配置反编译插件

    1 下载最新的jadClipse插件,地址:http://sourceforge.net/projects/jadclipse/files/jadclipse3.3/ 2 将net.sf.jadcli ...

  4. SqlServer sys.partition_view

    --查看partition的四个视图 select * from sys.partition_functions--查看分区函数 select * from sys.partition_paramet ...

  5. 杀死MySQL的连接

    命令  kill 执行线程号 C# 执行杀死指定的连接 1  强制Kill掉 internal protected void KillConnection(MySqlConnection c) { i ...

  6. vmware 网络连接

    解决VMware nat service等服务不能启动 虚拟机如何设置网络连接来上网?

  7. JSON 数字排序 多字段排序

    原文http://bbs.csdn.net/topics/390594744?page=1#post-395599672 //排序数组 function SortBy(field, reverse, ...

  8. tomcat那些事

    Tomcat7.0.22安装配置 1.下载tomcat7.0.22  下载地址:http://tomcat.apache.org/download-70.cgi 2.添加系统环境变量,我的电脑-> ...

  9. 算法(Algorithm)是什么?

    我们用煎蛋来打个比方.煎蛋的一般步骤是: 1.>取煎锅. 2.>取油. ->我们有油吗? ****有,把油倒入煎锅. ****没有,我们要去买油吗? #########要买,出去买油 ...

  10. iOS 7 改变Status Bar 颜色

    Set the UIViewControllerBasedStatusBarAppearance to NO in the Info.plist. In ViewDidLoad method or a ...