JG_AR_CREATE_ERD_INV_V

Details

  • Schema: FUSION

  • Object owner: AR

  • Object type: VIEW

Columns

Name

GDF_PARTY_ID

GDF_PARTY_SITE_ID

GDF_CUST_ACCOUNT_ID

GDF_CUST_ACCT_SITE_ID

GDF_BILL_SITE_USE_ID

CREATE_ERD_INV

Query

SQL_Statement

(SELECT c.party_id gdf_party_id,

cas.party_site_id gdf_party_site_id,

cas.cust_account_id gdf_cust_account_id,

cas.cust_acct_site_id gdf_cust_acct_site_id,

cas.site_use_id gdf_bill_site_use_id,

NVL (cas.create_option, NVL (ca.create_option, 'N')) create_erd_inv

FROM

(SELECT omcas.party_site_id,

omcas.cust_account_id,

omcas.cust_acct_site_id,

omcasu.site_use_id site_use_id,

xcede2.createerdiffinv create_option

FROM

hz_cust_site_uses_all omcasu,

hz_cust_acct_sites_all omcas,

(SELECT hcp.cust_account_id cust_account_id

,hcp.site_use_id site_use_id

,hcpc.global_attribute2 createerdiffinv

FROM hz_cust_profile_classes hcpc

,hz_customer_profiles_f hcp

WHERE hcpc.profile_class_id = hcp.profile_class_id

AND hcpc.status = 'A'

AND trunc(sysdate) between hcp.effective_start_date

and hcp.effective_end_date)xcede2

WHERE xcede2.cust_account_id(+) = omcas.cust_account_id

AND xcede2.site_use_id = omcasu.site_use_id

AND omcas.cust_acct_site_id = omcasu.cust_acct_site_id

AND omcasu.site_use_code = 'BILL_TO'

) cas,

(SELECT hcp.cust_account_id cust_account_id

,hcpc.global_attribute2 create_option

FROM hz_cust_profile_classes hcpc

,hz_customer_profiles_f hcp

WHERE hcpc.profile_class_id = hcp.profile_class_id

AND hcp.site_use_id IS NULL

AND hcpc.status = 'A'

AND trunc(sysdate) between hcp.effective_start_date

and hcp.effective_end_date)ca,

hz_cust_accounts c

WHERE cas.cust_account_id = ca.cust_account_id(+)

AND cas.cust_account_id = c.cust_account_id

)