|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
select a.order_number || '' as order_number,
a.cust_po_number,
a.sold_to_org_id as customer_id,
a.salesrep_id as salesrep_id,
b.name as salesrep_name,
c.customer_name,
c.customer_number,
(select sum(nvl(t.ordered_quantity * t.unit_selling_price, 0))
from apps.oe_order_lines_all t
where t.header_id = a.header_id) payment_amount,
aa.ordered_item,
aa.attribute15,
aa.attribute16
from ont.oe_order_headers_all a,
ont.oe_order_lines_all aa,
jtf.JTF_RS_SALESREPS b,
apps.ra_customers c
where a.salesrep_id = b.salesrep_id(+)
and a.sold_to_org_id = c.customer_id(+)
and a.org_id = 85
and aa.header_id = a.header_id
and a.BOOKED_FLAG = 'Y'
AND a.CANCELLED_FLAG = 'N'
AND a.OPEN_FLAG = 'Y'
AND a.FLOW_STATUS_CODE = 'BOOKED'
order by a.order_number, aa.line_id |
|