Oralce ERP中AP模块Vender银行信息查询语句

Oralce ERP中AP模块Vender中银行信息查询语句

银行信息主要涉及信息表串联,其中有个各弹性栏位,各公司会有不同,这个使用时如有涉视自家情况微调及可;

SQL

create or replace view q_ap_s_bank as
select pv.vendor_id vendor_id,
ss.vendor_site_id vendor_site_id,
hopbank.bank_or_branch_number bank_number,
hopbranch.bank_or_branch_number branch_number,
hopbank.organization_name bank_name,
hopbranch.organization_name branch_name,
eba.bank_account_num bank_account_num,
eba.bank_account_name bank_account_name,
eba.CURRENCY_CODE BANK_CURRENCY_CODE,
piu.start_date bank_use_start_date,
piu.end_date bank_use_end_date,
piu.order_of_preference bank_priority,
hzswft.eft_swift_code bank_swift_code,
eba.ATTRIBUTE1 bank_deff,
banchtype.class_code bank_type,
eba.country_code bank_country_code
from iby_ext_bank_accounts eba,
iby_external_payees_all payee,
iby_pmt_instr_uses_all piu,
ap_supplier_sites_all ss,
ap_suppliers pv,
hz_organization_profiles hopbank,
hz_organization_profiles hopbranch,
hz_contact_points hzswft,
hz_code_assignments banchtype
where 1=1
and eba.bank_id = hopbank.party_id
and eba.branch_id = hopbranch.party_id
and payee.payment_function = ‘PAYABLES_DISB’
and payee.party_site_id = ss.party_site_id
and payee.supplier_site_id = ss.vendor_site_id
and payee.org_id = ss.org_id
and payee.org_type = ‘OPERATING_UNIT’
and payee.ext_payee_id = piu.ext_pmt_party_id
and piu.payment_flow = ‘DISBURSEMENTS’
and piu.instrument_type = ‘BANKACCOUNT’
and piu.instrument_id = eba.ext_bank_account_id
and piu.start_date < sysdate
and ( piu.end_date is null or
piu.end_date > sysdate
)
and ss.vendor_id = pv.vendor_id
and eba.BRANCH_ID=hzswft.owner_table_ID(+)
and eba.BRANCH_ID=banchtype.owner_table_ID
and banchtype.class_code=‘SWIFT’
–and pv.vendor_id in (select vendor_id from vendors);
And hzswft.owner_table_name(+) = ‘HZ_PARTIES’
And hzswft.contact_point_type(+) = ‘EFT’
And hzswft.status(+) = ‘A’
AND piu.order_of_preference=1;

你可能感兴趣的:(Oracle,EBS,sql)