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. Can't create/write to file '/tmp/#sql_3105_0.MYI' (Errcode: 13)

    最近的项目中由于临时存储空间太大了.索性把tmp目录删除了.结果访问出现 Can't create/write to file '/tmp/#sql_3105_0.MYI' (Errcode: 13) ...

  2. wordpress教程之修改上传文件大小限制

    1. 修改apache配置文件 php.ini upload_max_filesize = 64M  post_max_size = 64M  max_execution_time = 300 //上 ...

  3. C# Process类_进程管理器Demo

    Process用于管理计算机的进程,下面给出一个C#进程管理器的DEMO. namespace ProcessManager { public partial class Form1 : Form { ...

  4. C# 字符串驻留池

    在.Net中,对于相同的字符串,.Net会将它们指向同一个地址,它们是相同的实例..Net中的字符串并不会更新,当更改一个字符串变量时,由于字符串的不可变性,.Net实际上是新创建一个字符串,而将变量 ...

  5. mysql 保留的关键字

    mysql> select precision from Product; ERROR 1064 (42000): You have an error in your SQL syntax; c ...

  6. 2014第2周四部署环境&买火车票

    2014第2周四部署环境&买火车票 今天遇到mysql一个问题:要把两个包含不同数据库的绿色mysql安装包中的数据库文件合并到一个数据库中,之前在sqlserver下操作很简单,只需要分离. ...

  7. Valid Anagram 解答

    Question Given two strings s and t, write a function to determine if t is an anagram of s. For examp ...

  8. HDU1754(线段树)

    I Hate It Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  9. Linux系统下定时上传文件至FTP服务器脚本

    环境:Red Hat Enterprise Linux Server release 6.4 需求:需要将Oracle数据库的定时备份上传至FTP服务器 1.干货,用户名:oracle,数据库名称:X ...

  10. UIColor-Hex-Swift

    // // UIColorExtension.swift // HEXColor // // Created by R0CKSTAR on 6/13/14. // Copyright (c) 2014 ...