zoukankan      html  css  js  c++  java
  • Oracle EBS-SQL (PO-14):检查报价单与成本对比.sql

    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

  • 相关阅读:
    USACO 4.1 Fence Rails
    POJ 1742
    LA 2031
    uva 10564
    poj 3686
    LA 3350
    asp.net MVC 3多语言方案--再次写, 配源码
    使用Log4net记录日志
    在C#用HttpWebRequest中发送GET/HTTP/HTTPS请求
    为什么要使用反射机制
  • 原文地址:https://www.cnblogs.com/st-sun/p/3782175.html
Copyright © 2011-2022 走看看