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. 阿里巴巴JAVA常考面试题及汇总答案

    一.String,StringBuffer, StringBuilder 的区别是什么?String为什么是不可变的? 答:   1.String是字符串常量,StringBuffer和StringB ...

  2. 互斥体与互锁 <第五篇>

    互斥体实现了“互相排斥”(mutual exclusion)同步的简单形式(所以名为互斥体(mutex)).互斥体禁止多个线程同时进入受保护的代码“临界区”.因此,在任意时刻,只有一个线程被允许进入这 ...

  3. 动态绑定ReportViewer控件之经验总结

    以上两篇文章已经很丰富了,但是照做一遍不行,检查了N遍还是不行,就是找不出问题原因,总是提示“尚未为数据源“DataSet1_DataTable1”提供数据源实例.”这主要是说在为ReportView ...

  4. Jquery EasyUI修改行背景的两种方式

    1.数据加载完成不请求后台的做法 方式一: //更改表格行背景 function changeLineStyle(index){ var rows=$("#alertGird"). ...

  5. 【剑指offer】面试题25:二叉树中和为某一值的路径

    题目: 输入一颗二叉树和一个整数,打印出二叉树中结点值的和为输入整数的所有路径.路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径. 思路: dfs一下就可以了.一般dfs肯定递归写比 ...

  6. 【POJ 1330 Nearest Common Ancestors】LCA问题 Tarjan算法

    题目链接:http://poj.org/problem?id=1330 题意:给定一个n个节点的有根树,以及树中的两个节点u,v,求u,v的最近公共祖先. 数据范围:n [2, 10000] 思路:从 ...

  7. python 性能优化

    1.优化循环 循环之外能做的事不要放在循环内,比如下面的优化可以快一倍 2.使用join合并迭代器中的字符串 join对于累加的方式,有大约5倍的提升 3.使用if is 使用if is True比i ...

  8. Android学习总结——文件储存

    Android中文件存储的操作: 1.Activity的openFileOutput()方法可以把数据输出到文件中2.创建的文件保存在/data/data/<package name>/f ...

  9. jquery第二期:三个例子带你走进jquery

    jquery是完全支持css的,我们举个例子来看看使用jquery的方便之处,这功劳是属于选择器的: 例1: <!DOCTYPE html PUBLIC "-//W3C//DTD HT ...

  10. RMAN传输表空间迁移数据

    实验环境: 源数据库:oracle 10g(Release 10.2.0.1.0) 目标数据库:oracle 10g(Release 10.2.0.1.0) 待传输的表空间:TEST 1.在tes ...