DBA Data[Home] [Help]

VIEW: APPS.IEX_STATEMENT_V

Source

View Text - Preformatted

SELECT sh.rowid row_id, sh.statement_date statement_date, sc.name name, sh.finance_charges finance_charges, party.party_name party_name, cust_acct.account_number account_number, sh.bill_to_location bill_to_location, sh.customer_id customer_id, sh.currency_code currency_code, sh.total_amount_due total_amount_due, sh.is_it_a_reprint is_it_a_reprint, sh.line_cluster_id line_cluster_id, sh.last_updated_by last_updated_by, sh.last_update_date last_update_date, sh.last_update_login last_update_login, sh.created_by created_by,sh.creation_date creation_date, sh.site_use_id site_use_id FROM ar_statements_history sh, hz_cust_accounts cust_acct, hz_parties party, hz_customer_profiles cp, ar_statement_cycles sc, hz_cust_site_uses su, hz_cust_site_uses su2, hz_cust_acct_sites acct_site WHERE cust_acct.cust_account_id = sh.customer_id AND cust_acct.party_id = party.party_id AND cp.cust_account_profile_id = decode(hzp_cust_pkg.get_statement_site (cust_acct.cust_account_id),NULL,sh.site_customer_profile_id, sh.cust_customer_profile_id) AND sc.statement_cycle_id = nvl(sh.statement_cycle_id, cp.statement_cycle_id) AND su.site_use_id(+) = hzp_cust_pkg.get_statement_site(cust_acct.cust_account_id) AND acct_site.cust_account_id = sh.customer_id AND su2.cust_acct_site_id = acct_site.cust_acct_site_id AND su2.site_use_code IN('BILL_TO', 'DRAWEE') AND su2.location =sh.bill_to_location
View Text - HTML Formatted

SELECT SH.ROWID ROW_ID
, SH.STATEMENT_DATE STATEMENT_DATE
, SC.NAME NAME
, SH.FINANCE_CHARGES FINANCE_CHARGES
, PARTY.PARTY_NAME PARTY_NAME
, CUST_ACCT.ACCOUNT_NUMBER ACCOUNT_NUMBER
, SH.BILL_TO_LOCATION BILL_TO_LOCATION
, SH.CUSTOMER_ID CUSTOMER_ID
, SH.CURRENCY_CODE CURRENCY_CODE
, SH.TOTAL_AMOUNT_DUE TOTAL_AMOUNT_DUE
, SH.IS_IT_A_REPRINT IS_IT_A_REPRINT
, SH.LINE_CLUSTER_ID LINE_CLUSTER_ID
, SH.LAST_UPDATED_BY LAST_UPDATED_BY
, SH.LAST_UPDATE_DATE LAST_UPDATE_DATE
, SH.LAST_UPDATE_LOGIN LAST_UPDATE_LOGIN
, SH.CREATED_BY CREATED_BY
, SH.CREATION_DATE CREATION_DATE
, SH.SITE_USE_ID SITE_USE_ID
FROM AR_STATEMENTS_HISTORY SH
, HZ_CUST_ACCOUNTS CUST_ACCT
, HZ_PARTIES PARTY
, HZ_CUSTOMER_PROFILES CP
, AR_STATEMENT_CYCLES SC
, HZ_CUST_SITE_USES SU
, HZ_CUST_SITE_USES SU2
, HZ_CUST_ACCT_SITES ACCT_SITE
WHERE CUST_ACCT.CUST_ACCOUNT_ID = SH.CUSTOMER_ID
AND CUST_ACCT.PARTY_ID = PARTY.PARTY_ID
AND CP.CUST_ACCOUNT_PROFILE_ID = DECODE(HZP_CUST_PKG.GET_STATEMENT_SITE (CUST_ACCT.CUST_ACCOUNT_ID)
, NULL
, SH.SITE_CUSTOMER_PROFILE_ID
, SH.CUST_CUSTOMER_PROFILE_ID)
AND SC.STATEMENT_CYCLE_ID = NVL(SH.STATEMENT_CYCLE_ID
, CP.STATEMENT_CYCLE_ID)
AND SU.SITE_USE_ID(+) = HZP_CUST_PKG.GET_STATEMENT_SITE(CUST_ACCT.CUST_ACCOUNT_ID)
AND ACCT_SITE.CUST_ACCOUNT_ID = SH.CUSTOMER_ID
AND SU2.CUST_ACCT_SITE_ID = ACCT_SITE.CUST_ACCT_SITE_ID
AND SU2.SITE_USE_CODE IN('BILL_TO'
, 'DRAWEE')
AND SU2.LOCATION =SH.BILL_TO_LOCATION