Oracle EBS AP 供应商取值
SELECT --nvl(substr(po.vendor_name,1,instr(po.vendor_name,',',1)-1),po.vendor_name) vendor_name,
po.vendor_name vendor_name,
po.vendor_name_alt, --别名
po.segment1, --供应商编号
decode(po.employee_id, NULL, 'STANDARD', 'EMPLOYEE') vendor_type, --创建供应商若关联员工 则是员工创建 若没有则是标准
flv.meaning TYPE, --类型
hop.tax_reference, --纳税登记编号
hop.jgzz_fiscal_code, --纳税人标识
ps.purchasing_site_flag, --采购
ps.pay_site_flag, --付款
ps.rfq_only_site_flag,
pvsa.org_id,
hr.name org_name,
hl.country country,
hl.province province,
hl.state state,
hl.city city,
hl.postal_code postal_code, --邮政编码
hl.address1 address1,
hps.party_site_name address_name,
hcpp1.phone_number,
hcpf1.phone_number fax_number,
pvsa.attribute1 pay_type,
pvsa.attribute2 id_card,
gcc.segment1 accts_pay_code1, --负债账户
gcc.segment2 accts_pay_code2,
gcc.segment3 accts_pay_code3,
gcc.segment4 accts_pay_code4,
gcc.segment5 accts_pay_code5,
gcc.segment6 accts_pay_code6,
gcc.segment7 accts_pay_code7,
gcc.segment8 accts_pay_code8,
gcc1.segment1 prepay_code1, --预付款账户
gcc1.segment2 prepay_code2,
gcc1.segment3 prepay_code3,
gcc1.segment4 prepay_code4,
gcc1.segment5 prepay_code5,
gcc1.segment6 prepay_code6,
gcc1.segment7 prepay_code7,
gcc1.segment8 prepay_code8,
gcc2.segment1 future_dated_payment1, --应付票据
gcc2.segment2 future_dated_payment2,
gcc2.segment3 future_dated_payment3,
gcc2.segment4 future_dated_payment4,
gcc2.segment5 future_dated_payment5,
gcc2.segment6 future_dated_payment6,
gcc2.segment7 future_dated_payment7,
gcc2.segment8 future_dated_payment8,
hp.person_first_name first_name, --名
hp.person_last_name last_name, --姓
hp.person_middle_name middle_name, --中间名
hcpp.phone_number phone_number1, --电话(联系人)
hcpf.phone_number fax_number1, --传真(联系人)
hcpe.email_address email_address, --EMAIL
ieba.bank_account_num bank_account_num,
ieba.bank_account_name bank_account_name,
ieba.country_code country1,
hz.party_name bank_name,
hz1.party_name branch_name,
ieba.attribute1 deposit_bank_type,
ieba.attribute2 bank_province,
ieba.attribute3 bank_city,
ieba.attribute4 bank_number,
ipm.payment_method_name,
po.end_date_active,
hps.status,
po.vendor_id,
ps.vendor_site_id,
ieba.bank_id,
ieba.branch_id,
po.attribute1 wm_coa_int,
po.attribute2 taxpayer_type,
hps.end_date_active org_end_time,
ieba.end_date bank_num_end_time,
decode(sign(po.last_update_date - ps.LAST_UPDATE_DATE),1,ps.LAST_UPDATE_DATE,po.last_update_date) last_update_date
,ppf.employee_number -- add by ran FROM po_vendors po,
po_vendor_sites_all pvsa,
hz_organization_profiles hop,
ap_supplier_sites_all ps,
hz_party_sites hps,
fnd_lookup_values flv,
hz_locations hl,
hr_operating_units hr,
gl_code_combinations gcc,
gl_code_combinations gcc1,
gl_code_combinations gcc2,
hz_relationships hr1,
hz_parties hp,
hz_contact_points hcpp1,
hz_contact_points hcpf1,
hz_contact_points hcpp,
hz_contact_points hcpf,
hz_contact_points hcpe,
--iby_account_owners iao,--deleted by jenrry 20170627
iby_ext_bank_accounts ieba,
hz_parties hz,
hz_parties hz1,
iby.iby_external_payees_all iep,
iby.iby_ext_party_pmt_mthds ieppm,
iby_payment_methods_vl ipm
,per_people_f ppf --add by ran
,hz_parties hp1
,iby_pmt_instr_uses_all uses--add by jenrry 20170627 WHERE po.party_id = hop.party_id(+)
AND po.party_id = hps.party_id(+)
AND hps.party_site_id = ps.party_site_id(+)
AND ps.vendor_id(+) = po.vendor_id
AND po.vendor_id = pvsa.vendor_id(+)
AND ps.inactive_date(+) IS NULL
AND pvsa.vendor_site_id = ps.vendor_site_id(+)
AND pvsa.org_id = ps.org_id(+)
AND hop.effective_end_date(+) IS NULL
AND flv.lookup_type(+) = 'VENDOR TYPE'
AND po.vendor_type_lookup_code = flv.lookup_code(+)
AND flv.language(+) = userenv('lang')
AND hps.location_id = hl.location_id(+)
AND hr.organization_id(+) = pvsa.org_id
AND hcpp1.owner_table_id(+) = hps.party_site_id
AND hcpf1.owner_table_id(+) = hps.party_site_id
AND hcpp1.owner_table_name(+) = 'HZ_PARTY_SITES'
AND hcpf1.owner_table_name(+) = 'HZ_PARTY_SITES'
AND hcpp1.contact_point_type(+) = 'PHONE'
AND hcpp1.phone_line_type(+) = 'GEN'
AND hcpf1.contact_point_type(+) = 'PHONE'
AND hcpf1.phone_line_type(+) = 'FAX'
AND hcpp1.primary_flag(+) = 'Y'
AND hcpf1.primary_flag(+) = 'Y'
AND gcc.code_combination_id(+) = ps.accts_pay_code_combination_id
AND gcc1.code_combination_id(+) = ps.prepay_code_combination_id
AND gcc2.code_combination_id(+) = ps.future_dated_payment_ccid
AND hr1.object_id(+) = po.party_id
AND hp.party_id(+) = hr1.subject_id
AND hcpp.owner_table_id(+) = hr1.party_id
AND hcpf.owner_table_id(+) = hr1.party_id
AND hcpe.owner_table_id(+) = hr1.party_id
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
--AND po.party_id = iao.account_owner_party_id(+) --deleted by jenrry 20170627
--AND iao.ext_bank_account_id = ieba.ext_bank_account_id(+) --deleted by jenrry 20170627
and uses.instrument_type(+) = 'BANKACCOUNT' --add by jenrry 20170627
AND iep.ext_payee_id+1 = uses.ext_pmt_party_id(+) --add by jenrry 20170627
AND iep.payment_function(+) = 'PAYABLES_DISB' --add by jenrry 20170627
AND uses.instrument_id = ieba.ext_bank_account_id(+) --add by jenrry 20170627
and iep.ORG_ID(+) = ps.ORG_ID --add by jenrry 20170627
--AND iao.primary_flag(+) = 'Y' --deleted by jenrry 20170627
AND ieba.bank_id = hz.party_id(+)
AND ieba.branch_id = hz1.party_id(+)
AND iep.party_site_id(+) = ps.party_site_id --这个用来过滤费用员工供应商,貌似做完员工费用报表,系统自动生成一个员工供应商,但界面查询不到
AND iep.supplier_site_id(+) = pvsa.vendor_site_id
AND iep.payee_party_id(+) = po.party_id /*--the same as iep.payee_party_id = hzp.party_id*/
AND iep.ext_payee_id = ieppm.ext_pmt_party_id(+)
AND hp1.person_identifier = ppf.person_id(+) --add by ran
AND ieppm.payment_method_code = ipm.payment_method_code(+)
and hp1.PARTY_ID = po.PARTY_ID
and ppf.EFFECTIVE_END_DATE(+) > sysdate
;
Oracle EBS AP 供应商取值的更多相关文章
- Oracle EBS AP 供应商API
--创建供应商地址上的电话号码 created by jenrry 20170419 DECLARE l_return_status VARCHAR2(1); l_msg_count NUMBER; ...
- Oracle EBS AP 供应商地点失效
/* 供应商地点失效 creation: created by jenrry 20161108 1.00 */ DECLARE lv_return_status ) := NULL; ln_msg_c ...
- Oracle EBS FA 资产取值
SELECT fb.book_type_code, fth.ASSET_NUMBER, fdh.units_assigned, fdh.assigned_to, pf.FULL_NAME, fl.se ...
- Oracle EBS 应收事务处理取值
SELECT ct.org_id ,ct.attribute1 bu_id --核算主体编号 ,ct.attribute2 dept_id --部门编号 ,hca.account_number ,hp ...
- Oracle EBS 应收发票取值
SELECT ct.trx_number ,ctl.description ,fnd_flex_ext.get_segs('SQLGL' ,'GL#' ,gcc.chart_of_accounts_i ...
- Oracle EBS AR 收款取值
select hr.name, a.autoapply_flag, a.AUTOMATCH_SET_ID, a.LEGAL_ENTITY_ID, a.RECEIPT_NUMBER, a.type, a ...
- Oracle EBS AP 已经完全付款的发票仍然可以选择并进行零金额的付款
1>找出相应的发票; SELECT DISTINCT ai.invoice_id, ai.invoice_num invoice_num, pv.segment1 vendor_num, pv. ...
- Oracle EBS AP更新供应商地址
SELECT pvs.vendor_site_id, pvs.party_site_id, hps.party_site_name, hps.object_version_number, hps.pa ...
- Oracle EBS AP取消核销
--取消核销 created by jenrry 20170425 DECLARE l_result BOOLEAN; l_msg_count NUMBER; l_result_n varchar2( ...
随机推荐
- APP 渠道推广【摘自网络】
渠道的合作方式无非三种,一种是付费合作,那很简单,谈好价格付钱.第二种是免费,主要是就是首发,还有就是跟渠道的运营小伙伴搞好关系让帮忙给个免费的位置等,第三种是活动奖品合作,简而言之,就是渠道商会逢年 ...
- visual studio 2008 快捷键
Ctrl+m+Crtr+o折叠所有大纲Ctrl+M+Crtr+P: 停止大纲显示Ctrl+K+Crtr+C: 注释选定内容Ctrl+K+Crtr+U: 取消选定注释内容Ctrl+J : 列出成员 智能 ...
- Nginx配置访问权限
基于IP配置Nginx的访问权限 Nginx配置通过两种途径支持基本访问权限的控制,其中一种是由HTTP标准模块ngx_http_access_module支持的,通过IP来判断客户端是否拥有对Ngi ...
- 数据库--oracle图形化管理工具和新增自定义用户
oracle数据库图形化管理工具: 1 navicat工具很小,操作mySQL和SQLServer非常好用,但对于oracle体验性就有点差,要自己下载编码和替换oci文件.下面是解决的方法教程链接 ...
- URL编码分析与乱码解决方案
一.问题的由来 URL就是网址,只要上网,就一定会用到. 一般来说,URL只能使用英文字母.阿拉伯数字和某些标点符号,不能使用其他文字和符号.比如,世界上有英文字母的网址"http://ww ...
- Linux 文件流管理
1. 打开/关闭文件 1). 打开文件 / fopen 作用: 打开一个文件,将其与文件流联系起来,方便后续的操作 头文件: #include <stdio.h> 函数原型: FILE * ...
- webapi找到了与该请求匹配的多个操作
关于这个问题是路由在找方法的时候层没有指定对,同一个链接,同样的参数导致路由找不到方法导致的报错,可以在WebApiConfig中多配置一层,比如"api/{controller}/{act ...
- C#中const 和 readonly 修饰符的用法详解
1.const是不变常量,在编译的时候就需要有确定的值,只能用于数值和字符串,或者引用类型只能为null.(这里为什么要把字符串单独拿出来?是因为字符串string是引用类型,但是使用的时候却感觉是值 ...
- ASP.NET 预编译笔记
本来下写篇总结,但感觉自己语言不知道怎么组织.就算了. aspnet_compiler的问题: 一开始 aspnet_compiler -v \ -p F: E: -fixednames e ...
- execl中设置的格式无法实现
在一次项目中,需要导出execl表,并且要给表中的表格设置格式,因为每列的格式都不一样,需要单独设置设置这些格式,在后期使用中因为导入的数据过多,是的后面的单元格中设置的格式无法实现. 每次打开exe ...