select distinct
         msi.segment1                                               项目
        ,msi.description                                             描述
        ,msi.primary_unit_of_measure                        单位
        ,decode(pla.line_type_id,'1','物货','1000','估价') 类型
        ,pla.unit_price                                       报价单价格
        ,cot.item_cost                                                成本
        ,(pla.unit_price - cot.item_cost)                       差异
        ,Trunc((pla.unit_price - cot.item_cost)/cot.item_cost,4)*100||'%'  差异百分比
    -- ,pla.creation_date                            报价单新建日期
    -- ,pla.last_update_date                       报价单更新日期
     --,cot.creation_date                               成本新建日期
    -- ,cot.last_update_date                          成本更新日期
from po.po_headers_all            pha
       ,po.po_lines_all                 pla
       ,bom.cst_item_costs          cot
       ,inv.mtl_system_items_b  msi
where
        pha.po_header_id = pla.po_header_id
  and msi.inventory_item_id = pla.item_id(+)
  and pha.type_lookup_code ='QUOTATION'
  and msi.inventory_item_id = cot.inventory_item_id(+)
  and msi.organization_id = cot.organization_id(+)
  and cot.cost_type_id = 1
  and cot.item_cost <> 0
  and nvl(trunc(pla.unit_price,4),-1) <> nvl(Trunc(cot.item_cost, 4),-1)
  and pla.item_id = cot.inventory_item_id
  and msi.organization_id in(X,Y)
  and abs((Trunc((pla.unit_price - cot.item_cost)/cot.item_cost,4)*100)) >= 20
order by msi.segment1

Oracle EBS-SQL (PO-14):检查报价单与成本对比.sql的更多相关文章

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

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

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

  3. 转:oracle ebs po模块一揽子采购协议小结

    转自:http://yedward.net/?id=193 oracle ebs po模块一揽子采购协议小结 本文总结oracle ebs采购订单(po)模块一揽子采购协议的相关知识,总结如下: 1. ...

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

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

  5. Oracle EBS R12经验谈(二)

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

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

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

  7. Oracle EBS R12 (12.1.3) Installation Linux(64 bit)

    Oracle EBS R12 (12.1.3) Installation Linux(64 bit) Contents Objective. 3 1 Download & Unzip. 3 D ...

  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 WIP Component Issue&Return Process

    oracleassemblytransactionscomponentsjobsreference 目录(?)[-] 定义BOM 定义Routing 定义WIP Discrete Job 发料 Mat ...

随机推荐

  1. html简单定位

    (1) 两个块水平排列 将两个块都设为浮动即可.注意不能将两个块的position属性设为absolute(绝对定位) #div1{ background-color: red; float:left ...

  2. 使用Calendar增加日期

    /** * @Description: 当前日期加上n个月返回long date */ public static long getLongDateAddMonth(int n){ Calendar ...

  3. HttpClient post中文乱码解决

    在javase方式下使用HttpClient没有进行任何编码设置,本地从服务端获取到数据不存在中文乱码. 但是将此段代码部署到Tomcat下面出现了中文乱码,此时设置: post.getParams( ...

  4. USB class总结

    以下是总结的USB的类,不同的USB类,主机询问的描述符格式和内容都不一样,具体的descriptor的内容可以查看 USB spec(http://www.usb.org/home/),如HID的s ...

  5. 超大批量删除redis中无用key+配置

    目前线上一个单实例redis中无用的key太多,决定删除一部分. 1.删除指定用户的key,使用redis的pipeline 根据一定条件把需要删除的用户统计出来,放到一个表里面,表为 del_use ...

  6. POJ 2579 Fiber Network(状态压缩+Floyd)

    Fiber Network Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3328   Accepted: 1532 Des ...

  7. ubuntu 包维护

    gnats == bug; tox = tales xillia ubuntu回显当前目录

  8. DataTable转换成List

    public static List<T> GetList<T>(DataTable table) { List<T> list = new List<T&g ...

  9. Yougth的最大化(好题,二分查找 0 1分数规划)

    Yougth的最大化 时间限制:1000 ms  |  内存限制:65535 KB 难度:4   描述 Yougth现在有n个物品的重量和价值分别是Wi和Vi,你能帮他从中选出k个物品使得单位重量的价 ...

  10. [Java Web]Struts2解决中文乱码问题

    1.设置struts的字符编码,能够在struts.xml中添加下面代码: <constant name="struts.i18n.encoding" value=" ...