ebs 供应商地点信息_供应商,地址,业务实体,地点关联银行账户
在此記錄一下自己學(xué)習(xí)過(guò)程。新手,請(qǐng)多多指教,謝謝。
最近客戶有需求,找出供應(yīng)商對(duì)應(yīng)的銀行信息,查看了下網(wǎng)上帖子,發(fā)現(xiàn)都是從供應(yīng)商及供應(yīng)商地點(diǎn)層發(fā)起,去查找對(duì)應(yīng)的銀行信息,但是,供應(yīng)商維護(hù)銀行界面共有四個(gè)層級(jí),依次為:供應(yīng)商,
地址,地址-業(yè)務(wù)實(shí)體,地點(diǎn)??四個(gè)層級(jí)分別可以關(guān)聯(lián)銀行賬戶,且結(jié)合發(fā)票工作臺(tái)和付款工作臺(tái)界面, 其在錄入供應(yīng)商、業(yè)務(wù)實(shí)體、地點(diǎn)之后,會(huì)自動(dòng)帶出對(duì)應(yīng)的銀行賬戶,且以此從四個(gè)層級(jí)中查找。
,有結(jié)合IBY_EXTERNAL_PAYEES_ALL 這個(gè)表,個(gè)人覺(jué)得這個(gè)表才是真正四個(gè)層級(jí)關(guān)聯(lián)銀行的 關(guān)鍵點(diǎn),從這個(gè)表入手,找出供應(yīng)商四個(gè)層級(jí)關(guān)聯(lián)的所有銀行信息。
-- EMPLOYEE
SELECT? ???ASP.VENDOR_ID AS 供應(yīng)商ID,
ASP.VENDOR_NAME AS 供應(yīng)商名稱,
ASP.SEGMENT1 AS 供應(yīng)商編號(hào),
ASP.VENDOR_TYPE_LOOKUP_CODE AS 供應(yīng)商類型,
ASP.START_DATE_ACTIVE AS 供應(yīng)商起始日期,
ASP.ENABLED_FLAG AS 供應(yīng)商啟用標(biāo)識(shí),
ASP.END_DATE_ACTIVE AS 供應(yīng)商終止日期,
ASP.PARTY_ID,
IEB.ext_bank_account_id,
IEB.bank_party_id,IEB.bank_name AS 銀行,
IEB.bank_branch_name AS 分行,
IEB.branch_party_id AS 分行id,
IEB.bank_account_id,
IEB.bank_account_number AS 銀行賬戶,
IEB.primary_acct_owner_party_id AS 賬戶主要責(zé)任人ID,
IEB.primary_acct_owner_name AS 賬戶主要責(zé)任人,
IAO.END_DATE AS 賬戶責(zé)任人終止日期,
IAO.PRIMARY_FLAG AS 賬戶主要責(zé)任人標(biāo)識(shí),
IEB.start_date AS 銀行起始日期,
IEB.end_date AS 銀行終止日期,
(SELECT T.Start_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行起始日期,
(SELECT T.End_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行終止日期,
IEP.PAYEE_PARTY_ID,
IEP.PAYMENT_FUNCTION,
IEP.PARTY_SITE_ID,
NULL AS 地址名稱,
NULL??AS 地址是否有效,
ASS.ORG_ID AS 業(yè)務(wù)實(shí)體ID,
(SELECT T.DESCRIPTION
FROM FND_FLEX_VALUES_VL??T,
FND_FLEX_VALUE_SETS S
WHERE 1 = 1
AND T.FLEX_VALUE_SET_ID =S.FLEX_VALUE_SET_ID
AND S.FLEX_VALUE_SET_NAME = 'XXX-COMPANY'
AND T.FLEX_VALUE = (SELECT SUBSTR(HOU.SHORT_CODE, 4) FROM HR_OPERATING_UNITS HOU
WHERE HOU.ORGANIZATION_ID =ASS.ORG_ID)
AND T.ENABLED_FLAG = 'Y'
AND SYSDATE < NVL(T.END_DATE_ACTIVE,SYSDATE + 1))??AS 業(yè)務(wù)實(shí)體名稱,
(SELECT HOU.date_from FROM??HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=ASS.ORG_ID )AS 業(yè)務(wù)實(shí)體生效日期,
(SELECT HOU.date_to FROM??HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=ASS.ORG_ID )??AS 業(yè)務(wù)實(shí)體失效日期,
ASS.VENDOR_SITE_ID,
ASS.VENDOR_SITE_CODE? ? AS 地點(diǎn)名稱,
ASS.INACTIVE_DATE AS 地點(diǎn)失效日期,
USES.INSTRUMENT_PAYMENT_USE_ID,
USES.EXT_PMT_PARTY_ID,
USES.INSTRUMENT_ID,
USES.PAYMENT_FUNCTION,
USES.START_DATE AS 銀行賬戶起始日期,
USES.END_DATE AS 銀行賬戶終止日期
FROM AP_SUPPLIERS ASP,
IBY_EXT_BANK_ACCOUNTS_V IEB,
IBY_EXTERNAL_PAYEES_ALL??IEP,
IBY_PMT_INSTR_USES_ALL??USES,
IBY_ACCOUNT_OWNERS IAO,
AP_SUPPLIER_SITES_ALL ASS
WHERE 1=1
AND IEP.EXT_PAYEE_ID = USES.EXT_PMT_PARTY_ID
AND IEP.PAYMENT_FUNCTION ='PAYABLES_DISB'
AND USES.INSTRUMENT_ID =IEB.EXT_BANK_ACCOUNT_ID
AND IEP.PAYEE_PARTY_ID = ASP.PARTY_ID
AND IEP.PARTY_SITE_ID IS NULL
AND IEP.SUPPLIER_SITE_ID IS NULL
AND IEP.ORG_ID IS NULL
AND ASP.VENDOR_TYPE_LOOKUP_CODE='EMPLOYEE'
AND ASS.VENDOR_ID=ASP.VENDOR_ID
AND USES.INSTRUMENT_TYPE = 'BANKACCOUNT'
AND IAO.ACCOUNT_OWNER_PARTY_ID=ASP.PARTY_ID
AND IAO.EXT_BANK_ACCOUNT_ID(+)=IEB.ext_bank_account_id
AND ASP.VENDOR_NAME='&VENDOR_NAME'
UNION ALL
--VENDOR
--第一層(供應(yīng)商關(guān)聯(lián)銀行)
SELECT? ???ASP.VENDOR_ID AS 供應(yīng)商ID,
ASP.VENDOR_NAME AS 供應(yīng)商名稱,
ASP.SEGMENT1 AS 供應(yīng)商編號(hào),
ASP.VENDOR_TYPE_LOOKUP_CODE AS 供應(yīng)商類型,
ASP.START_DATE_ACTIVE AS 供應(yīng)商起始日期,
ASP.ENABLED_FLAG AS 供應(yīng)商啟用標(biāo)識(shí),
ASP.END_DATE_ACTIVE AS 供應(yīng)商終止日期,
ASP.PARTY_ID,
IEB.ext_bank_account_id,
IEB.bank_party_id,IEB.bank_name AS 銀行,
IEB.bank_branch_name AS 分行,
IEB.branch_party_id AS 分行id,
IEB.bank_account_id,
IEB.bank_account_number AS 銀行賬戶,
IEB.primary_acct_owner_party_id AS 賬戶主要責(zé)任人ID,
IEB.primary_acct_owner_name AS 賬戶主要責(zé)任人,
IAO.END_DATE AS 賬戶責(zé)任人終止日期,
IAO.PRIMARY_FLAG AS 賬戶主要責(zé)任人標(biāo)識(shí),
IEB.start_date AS 銀行起始日期,
IEB.end_date AS 銀行終止日期,
(SELECT T.Start_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行起始日期,
(SELECT T.End_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行終止日期,
IEP.PAYEE_PARTY_ID,
IEP.PAYMENT_FUNCTION,
IEP.PARTY_SITE_ID,
NULL AS 地址名稱,
NULL??AS 地址是否有效,
IEP.ORG_ID AS 業(yè)務(wù)實(shí)體ID,
NULL??AS 業(yè)務(wù)實(shí)體名稱,
NULL AS 業(yè)務(wù)實(shí)體生效日期,
NULL??AS 業(yè)務(wù)實(shí)體失效日期,
IEP.SUPPLIER_SITE_ID,
NULL ,
NULL ,
USES.INSTRUMENT_PAYMENT_USE_ID,
USES.EXT_PMT_PARTY_ID,
USES.INSTRUMENT_ID,
USES.PAYMENT_FUNCTION,
USES.START_DATE AS 銀行賬戶起始日期,
USES.END_DATE AS 銀行賬戶終止日期
FROM AP_SUPPLIERS ASP,
IBY_EXT_BANK_ACCOUNTS_V IEB,
IBY_EXTERNAL_PAYEES_ALL??IEP,
IBY_ACCOUNT_OWNERS IAO,
IBY_PMT_INSTR_USES_ALL??USES
WHERE 1=1
AND IEP.EXT_PAYEE_ID = USES.EXT_PMT_PARTY_ID
AND IEP.PAYMENT_FUNCTION ='PAYABLES_DISB'
AND USES.INSTRUMENT_ID =IEB.EXT_BANK_ACCOUNT_ID
AND IEP.PAYEE_PARTY_ID = ASP.PARTY_ID
AND IEP.PARTY_SITE_ID IS NULL
AND IEP.SUPPLIER_SITE_ID IS NULL
AND IEP.ORG_ID IS NULL
AND ASP.VENDOR_TYPE_LOOKUP_CODE='VENDOR'
AND USES.INSTRUMENT_TYPE = 'BANKACCOUNT'
AND IAO.ACCOUNT_OWNER_PARTY_ID=ASP.PARTY_ID
AND IAO.EXT_BANK_ACCOUNT_ID(+)=IEB.ext_bank_account_id
AND ASP.VENDOR_NAME='&VENDOR_NAME'
UNION ALL
--第二層(地址關(guān)聯(lián)銀行)
SELECT ASP.VENDOR_ID AS 供應(yīng)商ID,
ASP.VENDOR_NAME AS 供應(yīng)商名稱,
ASP.SEGMENT1 AS 供應(yīng)商編號(hào),
ASP.VENDOR_TYPE_LOOKUP_CODE AS 供應(yīng)商類型,
ASP.START_DATE_ACTIVE AS 供應(yīng)商起始日期,
ASP.ENABLED_FLAG AS 供應(yīng)商啟用標(biāo)識(shí),
ASP.END_DATE_ACTIVE AS 供應(yīng)商終止日期,
ASP.PARTY_ID,
IEB.ext_bank_account_id,
IEB.bank_party_id,IEB.bank_name AS 銀行,
IEB.bank_branch_name AS 分行,
IEB.branch_party_id AS 分行id,
IEB.bank_account_id,
IEB.bank_account_number AS 銀行賬戶,
IEB.primary_acct_owner_party_id AS 賬戶主要責(zé)任人ID,
IEB.primary_acct_owner_name AS 賬戶主要責(zé)任人,
IAO.END_DATE AS 賬戶責(zé)任人終止日期,
IAO.PRIMARY_FLAG AS 賬戶主要責(zé)任人標(biāo)識(shí),
IEB.start_date AS 銀行起始日期,
IEB.end_date AS 銀行終止日期,
(SELECT T.Start_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行起始日期,
(SELECT T.End_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行終止日期,
IEP.PAYEE_PARTY_ID,
IEP.PAYMENT_FUNCTION,
IEP.PARTY_SITE_ID,
(SELECT HPS.PARTY_SITE_NAME FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY'
))??AS 地址名稱,
DECODE( (SELECT HPS.STATUS FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY')),'A','有效','無(wú)效') AS 地址是否有效,
IEP.ORG_ID,
NULL AS 業(yè)務(wù)實(shí)體,
NULL??AS 業(yè)務(wù)實(shí)體生效日期,
NULL??AS 業(yè)務(wù)實(shí)體失效日期,
IEP.SUPPLIER_SITE_ID,
NULL,
NULL,
USES.INSTRUMENT_PAYMENT_USE_ID,
USES.EXT_PMT_PARTY_ID,
USES.INSTRUMENT_ID,
USES.PAYMENT_FUNCTION,
USES.START_DATE AS 銀行賬戶起始日期,
USES.END_DATE AS 銀行賬戶終止日期
FROM AP_SUPPLIERS ASP,
IBY_EXT_BANK_ACCOUNTS_V IEB,
IBY_EXTERNAL_PAYEES_ALL??IEP,
IBY_ACCOUNT_OWNERS IAO,
IBY_PMT_INSTR_USES_ALL??USES
WHERE 1=1
AND IEP.EXT_PAYEE_ID = USES.EXT_PMT_PARTY_ID
AND IEP.PAYMENT_FUNCTION ='PAYABLES_DISB'
AND USES.INSTRUMENT_ID =IEB.EXT_BANK_ACCOUNT_ID
AND IEP.PAYEE_PARTY_ID = ASP.PARTY_ID
AND IEP.PARTY_SITE_ID IS NOT NULL
AND IEP.SUPPLIER_SITE_ID IS NULL
AND IEP.ORG_ID IS NULL
AND ASP.VENDOR_TYPE_LOOKUP_CODE='VENDOR'
AND USES.INSTRUMENT_TYPE = 'BANKACCOUNT'
AND IAO.ACCOUNT_OWNER_PARTY_ID=ASP.PARTY_ID
AND IAO.EXT_BANK_ACCOUNT_ID(+)=IEB.ext_bank_account_id
AND ASP.VENDOR_NAME='&VENDOR_NAME'
UNION ALL
--第三層(地址-業(yè)務(wù)實(shí)體關(guān)聯(lián)銀行)
SELECT ASP.VENDOR_ID AS 供應(yīng)商ID,
ASP.VENDOR_NAME AS 供應(yīng)商名稱,
ASP.SEGMENT1 AS 供應(yīng)商編號(hào),
ASP.VENDOR_TYPE_LOOKUP_CODE AS 供應(yīng)商類型,
ASP.START_DATE_ACTIVE AS 供應(yīng)商起始日期,
ASP.ENABLED_FLAG AS 供應(yīng)商啟用標(biāo)識(shí),
ASP.END_DATE_ACTIVE AS 供應(yīng)商終止日期,
ASP.PARTY_ID,
IEB.ext_bank_account_id,
IEB.bank_party_id,IEB.bank_name AS 銀行,
IEB.bank_branch_name AS 分行,
IEB.branch_party_id AS 分行id,
IEB.bank_account_id,
IEB.bank_account_number AS 銀行賬戶,
IEB.primary_acct_owner_party_id AS 賬戶主要責(zé)任人ID,
IEB.primary_acct_owner_name AS 賬戶主要責(zé)任人,
IAO.END_DATE AS 賬戶責(zé)任人終止日期,
IAO.PRIMARY_FLAG AS 賬戶主要責(zé)任人標(biāo)識(shí),
IEB.start_date AS 銀行起始日期,
IEB.end_date AS 銀行終止日期,
(SELECT T.Start_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行起始日期,
(SELECT T.End_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行終止日期,
IEP.PAYEE_PARTY_ID,
IEP.PAYMENT_FUNCTION,
IEP.PARTY_SITE_ID,
(SELECT HPS.PARTY_SITE_NAME FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY'
))??AS 地址名稱,
DECODE( (SELECT HPS.STATUS FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY')),'A','有效','無(wú)效') AS 地址是否有效,
IEP.ORG_ID,
(SELECT TRIM(SUBSTR(HOU.name,4)) FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID)
--AND SYSDATE BETWEEN NVL(HOU.DATE_FROM,SYSDATE-1) AND NVL(HOU.DATE_TO,SYSDATE+1)
AS 業(yè)務(wù)實(shí)體,
(SELECT HOU.date_from FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID)AS 業(yè)務(wù)實(shí)體生效日期,
(SELECT HOU.date_to FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID) AS 業(yè)務(wù)實(shí)體失效日期,
IEP.SUPPLIER_SITE_ID,
NULL? ? AS 地點(diǎn),
NULL??AS 地點(diǎn)失效日期,
USES.INSTRUMENT_PAYMENT_USE_ID,
USES.EXT_PMT_PARTY_ID,
USES.INSTRUMENT_ID,
USES.PAYMENT_FUNCTION,
USES.START_DATE AS 銀行賬戶起始日期,
USES.END_DATE AS 銀行賬戶終止日期
FROM AP_SUPPLIERS ASP,
IBY_EXT_BANK_ACCOUNTS_V IEB,
IBY_EXTERNAL_PAYEES_ALL??IEP,
IBY_ACCOUNT_OWNERS IAO,
IBY_PMT_INSTR_USES_ALL??USES
WHERE 1=1
AND IEP.EXT_PAYEE_ID = USES.EXT_PMT_PARTY_ID
AND IEP.PAYMENT_FUNCTION ='PAYABLES_DISB'
AND USES.INSTRUMENT_ID =IEB.EXT_BANK_ACCOUNT_ID
AND IEP.PAYEE_PARTY_ID = ASP.PARTY_ID
AND IEP.PARTY_SITE_ID IS NOT NULL
AND IEP.SUPPLIER_SITE_ID IS NULL
AND IEP.ORG_ID IS NOT NULL
AND USES.INSTRUMENT_TYPE = 'BANKACCOUNT'
AND ASP.VENDOR_TYPE_LOOKUP_CODE='VENDOR'
AND IAO.ACCOUNT_OWNER_PARTY_ID=ASP.PARTY_ID
AND IAO.EXT_BANK_ACCOUNT_ID(+)=IEB.ext_bank_account_id
AND ASP.VENDOR_NAME='&VENDOR_NAME'
UNION ALL
--第四層(地點(diǎn)關(guān)聯(lián)銀行)
SELECT ASP.VENDOR_ID AS 供應(yīng)商ID,
ASP.VENDOR_NAME AS 供應(yīng)商名稱,
ASP.SEGMENT1 AS 供應(yīng)商編號(hào),
ASP.VENDOR_TYPE_LOOKUP_CODE AS 供應(yīng)商類型,
ASP.START_DATE_ACTIVE AS 供應(yīng)商起始日期,
ASP.ENABLED_FLAG AS 供應(yīng)商啟用標(biāo)識(shí),
ASP.END_DATE_ACTIVE AS 供應(yīng)商終止日期,
ASP.PARTY_ID,
IEB.ext_bank_account_id,
IEB.bank_party_id,IEB.bank_name AS 銀行,
IEB.bank_branch_name AS 分行,
IEB.branch_party_id AS 分行id,
IEB.bank_account_id,
IEB.bank_account_number AS 銀行賬戶,
IEB.primary_acct_owner_party_id AS 賬戶主要責(zé)任人ID,
IEB.primary_acct_owner_name AS 賬戶主要責(zé)任人,
IAO.END_DATE AS 賬戶責(zé)任人終止日期,
IAO.PRIMARY_FLAG AS 賬戶主要責(zé)任人標(biāo)識(shí),
IEB.start_date AS 銀行起始日期,
IEB.end_date AS 銀行終止日期,
(SELECT T.Start_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行起始日期,
(SELECT T.End_Date FROM IBY_EXT_BANK_BRANCHES_V T WHERE T.Branch_Party_Id=IEB.branch_party_id) AS 分行終止日期,
IEP.PAYEE_PARTY_ID,
IEP.PAYMENT_FUNCTION,
IEP.PARTY_SITE_ID,
(SELECT HPS.PARTY_SITE_NAME FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY'
))??AS 地址名稱,
DECODE( (SELECT HPS.STATUS FROM??HZ_PARTY_SITES HPS
WHERE? ? IEP.PARTY_SITE_ID=HPS.PARTY_SITE_ID
--AND HPS.STATUS='A'
AND EXISTS (SELECT 1
FROM HZ_PARTY_SITES HPS,hz_party_site_uses PURCHASE,hz_party_site_uses PAY
WHERE HPS.PARTY_SITE_ID=PURCHASE.PARTY_SITE_ID
AND HPS.PARTY_SITE_ID=PAY.PARTY_SITE_ID
AND PURCHASE.SITE_USE_TYPE='PURCHASING'
AND PAY.SITE_USE_TYPE='PAY')),'A','有效','無(wú)效') AS 地址是否有效,
IEP.ORG_ID,
(SELECT TRIM(SUBSTR(HOU.name,4)) FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID)
--AND SYSDATE BETWEEN NVL(HOU.DATE_FROM,SYSDATE-1) AND NVL(HOU.DATE_TO,SYSDATE+1)
AS 業(yè)務(wù)實(shí)體,
(SELECT HOU.date_from FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID)AS 業(yè)務(wù)實(shí)體生效日期,
(SELECT HOU.date_to FROM? ?HR_ORGANIZATION_UNITS HOU WHERE HOU.organization_id=IEP.ORG_ID) AS 業(yè)務(wù)實(shí)體失效日期,
IEP.SUPPLIER_SITE_ID,
(SELECT ASS.VENDOR_SITE_CODE FROM AP_SUPPLIER_SITES_ALL ASS
WHERE ASS.VENDOR_SITE_ID=IEP.SUPPLIER_SITE_ID
AND ASS.PURCHASING_SITE_FLAG='Y'
AND ASS.PAY_SITE_FLAG='Y'
)? ???AS 地點(diǎn),
(SELECT ASS.INACTIVE_DATE FROM AP_SUPPLIER_SITES_ALL ASS
WHERE ASS.VENDOR_SITE_ID=IEP.SUPPLIER_SITE_ID
AND ASS.PURCHASING_SITE_FLAG='Y'
AND ASS.PAY_SITE_FLAG='Y'
)AS 地點(diǎn)失效日期,
USES.INSTRUMENT_PAYMENT_USE_ID,
USES.EXT_PMT_PARTY_ID,
USES.INSTRUMENT_ID,
USES.PAYMENT_FUNCTION,
USES.START_DATE AS 銀行賬戶起始日期,
USES.END_DATE AS 銀行賬戶終止日期
FROM AP_SUPPLIERS ASP,
IBY_EXT_BANK_ACCOUNTS_V IEB,
IBY_EXTERNAL_PAYEES_ALL??IEP,
IBY_ACCOUNT_OWNERS IAO,
IBY_PMT_INSTR_USES_ALL??USES
WHERE 1=1
AND ASP.VENDOR_TYPE_LOOKUP_CODE='VENDOR'
AND IEP.EXT_PAYEE_ID = USES.EXT_PMT_PARTY_ID
AND IEP.PAYMENT_FUNCTION ='PAYABLES_DISB'
AND USES.INSTRUMENT_ID =IEB.EXT_BANK_ACCOUNT_ID
AND IEP.PAYEE_PARTY_ID = ASP.PARTY_ID
AND IEP.PARTY_SITE_ID IS NOT NULL
AND IEP.SUPPLIER_SITE_ID IS NOT NULL
AND IEP.ORG_ID IS NOT NULL
AND USES.INSTRUMENT_TYPE = 'BANKACCOUNT'
AND IAO.ACCOUNT_OWNER_PARTY_ID=ASP.PARTY_ID
AND IAO.EXT_BANK_ACCOUNT_ID(+)=IEB.ext_bank_account_id
AND ASP.VENDOR_NAME='&VENDOR_NAME'
;
總結(jié)
以上是生活随笔為你收集整理的ebs 供应商地点信息_供应商,地址,业务实体,地点关联银行账户的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: spring整合atomikos实现分布
- 下一篇: docker 端口映射 udp_Dock