R12 供应商SQL
-- 供应商主表数据:
SELECT ass.vendor_id vendor_id,
ass.party_id party_id,
ass.segment1 vendor_code,
ass.vendor_name vendor_name,
ass.vendor_name vendor_short_name,
ass.vendor_type_lookup_code vendor_type,
flv.meaning vendor_type_meaning,
hp.tax_reference tax_registered_name,
ass.payment_method_lookup_code payment_method,
att.name term_name,
att.enabled_flag enabled_flag,
att.end_date_active end_date_active,
ass.creation_date creation_date,
ass.created_by created_by,
ass.last_update_date last_update_date,
ass.last_updated_by last_updated_by,
ass.last_update_login last_update_login
FROM ap_suppliers ass,
fnd_lookup_values flv,
hz_parties hp,
ap_terms_tl att
WHERE ass.vendor_type_lookup_code = flv.lookup_code(+)
AND flv.lookup_type(+) = 'VENDOR TYPE'
AND flv.language(+) = userenv ( 'LANG' )
AND ass.party_id = hp.party_id
AND att.language = userenv ( 'LANG' )
AND ass.terms_id = att.term_id(+)
-- 供应商银行信息
SELECT ass.vendor_id vendor_id,
ass.party_id party_id,
bank.party_id bank_id,
bank.party_name bank_name,
branch.party_id branch_id,
branch.party_name bank_branch_name,
ieba.bank_account_num bank_account_num
FROM ap_suppliers ass,
hz_parties hp,
iby_account_owners iao,
iby_ext_bank_accounts ieba,
hz_parties bank,
hz_parties branch
WHERE ass.party_id = hp.party_id
AND hp.party_id = iao.account_owner_party_id(+)
AND iao.ext_bank_account_id = ieba.ext_bank_account_id(+)
AND ieba.bank_id = bank.party_id(+)
AND ieba.branch_id = branch.party_id(+)
ORDER BY ieba.creation_date;
-- 供应商开户行地址信息
SELECT hps.party_id party_id,
hps.party_site_id party_site_id,
hl.location_id location_id,
hl.country country,
hl.province province,
hl.city city,
hl.address1 address1,
hl.address2 address2,
hl.address3 address3,
hl.address4 address4
FROM hz_party_sites hps, hz_locations hl
WHERE hps.location_id = hl.location_id
ORDER BY hps.creation_date
-- 供应商联系人信息
SELECT hr.subject_id subject_id,
hr.object_id object_id,
hr.party_id party_id,
hp.person_last_name || ' ' || hp.person_middle_name || ' ' ||
hp.person_first_name contact_person,
hcpp.phone_area_code phone_area_code,
hcpp.phone_number phone_number,
hcpp.phone_extension phone_extension,
hcpf.phone_area_code fax_phone_area_code,
hcpf.phone_number fax_phone_number,
hcpe.email_address email_address
FROM hz_relationships hr,
hz_contact_points hcpp,
hz_contact_points hcpf,
hz_contact_points hcpe,
hz_parties hp
WHERE hr.object_id = hp.party_id
AND hcpp.owner_table_id(+) = hr.party_id
AND hcpf.owner_table_id(+) = hr.party_id
AND hcpe.owner_table_id(+) = hr.party_id
AND hr.object_type = 'PERSON'
AND hr.relationship_code(+) = 'CONTACT'
AND hcpp.owner_table_name(+) = 'HZ_PARTIES'
AND hcpf.owner_table_name(+) = 'HZ_PARTIES'
AND hcpe.owner_table_name(+) = 'HZ_PARTIES'
AND hcpp.contact_point_type(+) = 'PHONE'
AND hcpp.phone_line_type(+) = 'GEN'
AND hcpf.contact_point_type(+) = 'PHONE'
AND hcpf.phone_line_type(+) = 'FAX'
AND hcpe.contact_point_type(+) = 'EMAIL'
AND hcpe.phone_line_type IS NULL
ORDER BY hr.creation_date;
-- 供应商地址主信息
SELECT assa.vendor_site_id vendor_site_id,
assa.vendor_id vendor_id,
assa.vendor_site_code vendor_code,
assa.vendor_site_code address_short_name,
assa.address_line1 address_line1,
assa.address_line2 address_line2,
assa.address_line3 address_line3,
assa.address_line4 address_line4,
assa.org_id org_id,
assa.country country,
assa.province province,
assa.city city,
assa.county county,
assa.zip zip,
assa.pay_site_flag pay_site_flag,
assa.purchasing_site_flag purchasing_site_flag,
assa.inactive_date inactive_date,
assa.creation_date creation_date,
assa.created_by created_by,
assa.last_update_date last_update_date,
assa.last_updated_by last_updated_by,
assa.last_update_login last_update_login
FROM ap_suppliers ass, ap_supplier_sites_all assa
WHERE assa.vendor_id = ass.vendor_id;
-- 供应商地址联系人信息: phone 、 fax 和 Email
SELECT hcpp.phone_area_code phone_area_code,
hcpp.phone_number phone_number,
hcpp.phone_extension phone_extension,
hcpf.phone_area_code fax_phone_area_code,
hcpf.phone_number fax_phone_number,
hcpe.email_address email_address
FROM ap_supplier_sites_all assa,
hz_contact_points hcpp,
hz_contact_points hcpf,
hz_contact_points hcpe,
hz_party_sites hps
WHERE assa.party_site_id = hps.party_site_id
AND hcpp.owner_table_id(+) = assa.party_site_id
AND hcpf.owner_table_id(+) = assa.party_site_id
AND hcpe.owner_table_id(+) = assa.party_site_id
AND hcpp.owner_table_name(+) = 'HZ_PARTY_SITES'
AND hcpf.owner_table_name(+) = 'HZ_PARTY_SITES'
AND hcpe.owner_table_name(+) = 'HZ_PARTY_SITES'
AND hcpp.contact_point_type(+) = 'PHONE'
AND hcpp.phone_line_type(+) = 'GEN'
AND hcpf.contact_point_type(+) = 'PHONE'
AND hcpf.phone_line_type(+) = 'FAX'
AND hcpe.contact_point_type(+) = 'EMAIL'
AND hcpe.phone_line_type IS NULL ;
-- 供应商地址收件人信息
SELECT assa.party_site_id
FROM ap_supplier_sites_all assa
-- 根据 party_site_id 得到供应商地址的收件人名称
SELECT hps.addressee FROM hz_party_sites hps;
-- 供应商银行帐户分配层次关系
SELECT * FROM iby_pmt_instr_uses_all;
-- 供应商银行帐户分配层次关系明细 ( 不包括供应商层的分配信息 ):
SELECT * FROM iby_external_payees_all;
| The link between PO_VENDORS and HZ_PARTIES is PO_VENDORS.party_id. The link between PO_VENDOR_SITES_ALL and HZ_PARTY_SITES is PO_VENDOR_SITES_ALL.party_site_id. When a Supplier is created Record will be Inserted in HZ_PARTIES. When the Supplier Site is created Record will be Inserted in HZ_PARTY_SITES. When Address is created it will be stored in HZ_LOCATIONS When a bank Is Created, the banking information will be stored in IBY_EXT_BANK_ACCOUNTS IBY_EXT_BANK_ACCOUNTS.BANK_id = hz_paties.party_id When the Bank is assigned to Vendors then it will be updated in HZ_CODE_ASSIGNMENTS. |
R12 供应商SQL的更多相关文章
- R12供应商地点层付款方法SQL
--R12供应商地点层付款方法SQL:SELECT ipmv.payment_method_name , ipmv.payment_method_code , 'N' primary_ ...
- asp.net 一般处理程序
一般处理程序类似公共模块,所有页面都可以调用. 一般处理程序 <%@ WebHandler Language="C#" Class="SetGrid" % ...
- EBS R12 查询EBS用户相关SQL
--R12查询EBS在线用户SQL SELECT U.USER_NAME, APP.APPLICATION_SHORT_NAME, FAT.APPLICATION_NAM ...
- R12 查询EBS用户相关SQL(转)
https://www.cnblogs.com/quanweiru/p/4869697.html http://hutianci.iteye.com/blog/934921 --R12查询EBS在线用 ...
- EBS R12使用接口表往已存在的供应商地址下创建新的地点
在供应商 "测试供应商A" 下已经有了两个地址,分别为 "地址A","地址B",现在由于某些原因,需要在地址A下面创建新的地点. 由于业务需 ...
- R12 查询EBS用户相关SQL
--R12查询EBS在线用户SQL SELECT U.USER_NAME, APP.APPLICATION_SHORT_NAME, FAT.APPLICATION_NAME, ...
- 解决VS2010在新建实体数据模型出现“在 .NET Framework Data Provider for Microsoft SQL Server Compact 3.5 中发生错误。请与提供程序供应商联系以解决此问题。”的问题
最近想试着学习ASP.NET MVC,在点击 添加--新建项--Visual C#下的数据中的ADO.NET 实体数据模型,到"选择您的数据连接"时,出现错误,"在 .N ...
- 031医疗项目-模块三:药品供应商目录模块——供货商药品目录查询功能----------sql补充知识
这个补充知识有一个点很有必要,视屏上的老师提出一点: 内链接关联查询: 如果表A和表B有一个外键关联 ,可以通过外键进行内链接查询 select dictinfo.*, dicttype.typena ...
- 供应商和管理员查看供应商地址簿信息SQL
--管理员查看地址簿 SELECT hps.party_site_id, hps.party_site_name AS address_name, 'CURRENT' AS status, hzl.a ...
随机推荐
- 设计模式:观察者模式(Observer)
定 义:定义了一种一对多的依赖关系,让多个观察者对象同时监听某一主题对象.这个主题对象在状态发生 变化时,会通知所有观察者对象,使他们能够自动更新自己. 结构图: 抽象主题类: abstract c ...
- 1012 最小公倍数LCM
1012 最小公倍数LCM 基准时间限制:1 秒 空间限制:131072 KB 输入2个正整数A,B,求A与B的最小公倍数. Input 2个数A,B,中间用空格隔开.(1<= A,B < ...
- 其他常用HTML 片段
1.input placeholder 文字居中 字体大小+上下padding值等于设计稿宽度 设计稿中总高度为86px padding:27px 0;font-size:30px; 2.英文 ...
- graphviz - Node Shapes
Node Shapes There are three main types of shapes : polygon-based, record-based and user-defined. The ...
- An Implementation of Double-Array Trie
Contents What is Trie? What Does It Take to Implement a Trie? Tripple-Array Trie Double-Array Trie S ...
- Macro and SQL
If you’ve developed anything in the supply chain area, you’ve most probably come across InventDimJoi ...
- Fatal error: Cannot redeclare tran() (previously declared in
解决方法如下: 1.你该段源码里面是不是有include 或者require 之类的包含其他文件函数 包含的文件里已经有 函数 nw() 的定义 而这段代码里又有nv()的定义 所以出现redecla ...
- 解决.Net设置只读、隐藏后后台获取不到值的问题
在前台页面上放了几个textbox,用 ReadOnly=true设置不可编辑,用visible="False"设置不可见 用jquery给textbox赋值后在后台页面获取不到t ...
- http://www.cnblogs.com/dumuqiao/p/3654702.html?utm_source=tuicool&utm_medium=referral
http://www.cnblogs.com/dumuqiao/p/3654702.html?utm_source=tuicool&utm_medium=referral
- 读取、写入excel数据
在实际项目中,不可避免的会操作excel表格.一直以来都是读取excel表格,可今天为了写入excel表格,可是煞费苦心,终于完成,记录下来以便后续使用. 1.读取excel表格的数据 读取excel ...