Oracle EBS-SQL (PO-16):检查采购订单完成情况统计.sql
select
e.FULL_NAME 采购员,
sum(plla.quantity-plla.QUANTITY_CANCELLED) 订购数量,
sum(plla.Quantity_Received) 完成数量 ,
round(SUM(plla.Quantity_Received)*100 / sum(plla.quantity-plla.QUANTITY_CANCELLED),2)||'%' 完成百分比
FROM
PO.PO_AGENTS pa,
PO.PO_HEADERS_ALL pha,
PO.PO_LINES_ALL pla,
PO.PO_LINE_LOCATIONS_ALL plla,
PO.PO_VENDORS pv,
hr.PER_ALL_PEOPLE_F e,
inv.mtl_system_items_b msi
where
pha.org_id = X
and ((pha.PO_HEADER_ID = pla.PO_HEADER_ID)
and (pla.PO_LINE_ID=plla.PO_LINE_ID)
and (pha.AGENT_ID=pa.AGENT_ID)
and (pha.ORG_ID=pla.ORG_ID)
and (msi.inventory_item_id = pla.item_id)
and (msi.organization_id in (X,Y))
and (msi.organization_id = plla.ship_to_organization_id)
and (pha.VENDOR_ID=pv.VENDOR_ID)
and (pha.agent_id=E.PERSON_ID(+)))
and nvl(pha.APPROVED_FLAG,'N') = 'Y'
and nvl(plla.APPROVED_FLAG,'N') ='Y'
and nvl(pha.CANCEL_FLAG,'N') ='N'
and nvl(pla.CANCEL_FLAG,'N') ='N'
and nvl(plla.CANCEL_FLAG,'N') = 'N'
and pha.type_lookup_code = 'STANDARD'
and nvl(plla.need_by_date,plla.promised_date) between
to_date('20**-01-01','YYYY-MM-DD') AND to_date('20**-01-31','YYYY-MM-DD')
group by
e.full_name
Oracle EBS-SQL (PO-16):检查采购订单完成情况统计.sql的更多相关文章
- Oracle EBS-SQL (PO-9):检查期间采购订单执行情况.sql
--采购订单执行情况查询(七天内接收情况)select pha.segment1 采购订单, msib.segment1 物料编码, pla.qu ...
- Oracle EBS中分类账和法人实体 的关系(有sql语句实例)
Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报 分类: Oracle EBS(12) Oracle数据 ...
- oracle ebs 采购订单关闭之PL/SQL实现方法
应客户需求,需要写个脚本,批量关闭Bonus Item类型的采购订单,在metalink上搜索到一些方法,但是都测试不通.原来需要将代码生成一个并发程序.下面是测试成功的代码. 1.首先创建一个存储过 ...
- Oracle EBS-SQL (PO-5):采购订单控制信息查询.sql
select distinct pla.po_header_id, --pha.type_lookup_code, pha.segment1 采购订单号, appf.full_name ...
- Oracle EBS-SQL (PO-11):检查采购订单退货数.sql
select msi.segment1 物料编码, -- msi.inventory_item_id return_it ...
- Oracle EBS-SQL (PO-4):检查采购订单明细.sql
SELECT PHA.SEGMENT1 订单号, pha.approved_flag 批准状态, pha.closed_code 订 ...
- PO*创建标准采购订单
-- l_iface_rec po_headers_interface%ROWTYPE; 校验头相关信息 ) INTO l_po_count FROM po_headers_all p ...
- Oracle EBS OM 已存在的OM订单增加物料
DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_r ...
- Oracle EBS 隐藏帮助-诊断-检查
随机推荐
- information_schema.engines学习
当前mysql实例的存储引擎信息可以从information_schema.engines 中查询到 例子: mysql> select * from information_schema.en ...
- 实现AT24C02的数据读写操作
/*************************************************************** 功能:11:32 2008-6-27 作者:SG 时间:2004-03 ...
- WIN下和LINUX动态库的区别
**************************************************************************************************** ...
- UVA_Digit Puzzle UVA 12107
If you hide some digits in an integer equation, you create a digit puzzle. The figure below shows tw ...
- 【转】morgan stanley 电面面经新鲜出炉
楼楼早上上午大概11点接到的电话,一个声音炒鸡好听的GG,说他是来自morgan stanley的,想和我约一下店面时间.我一听,真是戳不及防,掐指一算,online的IKE测试已经过去20几天了吧, ...
- 【LeetCode练习题】Minimum Path Sum
Minimum Path Sum Given a m x n grid filled with non-negative numbers, find a path from top left to b ...
- 一起来学canvas (前言)
codeyy - 一依丫丫 一起来学canvas (前言)
- poj 2115 C Looooops(推公式+扩展欧几里得模板)
Description A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; ...
- poj 3311 Hie with the Pie(状态压缩dp)
Description The Pizazz Pizzeria prides itself or more (up to ) orders to be processed before he star ...
- poj 3370 Halloween treats(鸽巢原理)
Description Every year there is the same problem at Halloween: Each neighbour is only willing to giv ...