DBA Data[Home] [Help]

APPS.ARPT_SQL_FUNC_UTIL dependencies on HZ_CUSTOMER_PROFILES

Line 1873: FROM hz_customer_profiles cust,

1869: BEGIN
1870:
1871: SELECT NVL(site.override_terms, cust.override_terms)
1872: INTO l_override_terms
1873: FROM hz_customer_profiles cust,
1874: hz_customer_profiles site
1875: WHERE cust.cust_account_id = p_customer_id
1876: AND cust.site_use_id IS NULL
1877: AND site.cust_account_id (+) = cust.cust_account_id

Line 1874: hz_customer_profiles site

1870:
1871: SELECT NVL(site.override_terms, cust.override_terms)
1872: INTO l_override_terms
1873: FROM hz_customer_profiles cust,
1874: hz_customer_profiles site
1875: WHERE cust.cust_account_id = p_customer_id
1876: AND cust.site_use_id IS NULL
1877: AND site.cust_account_id (+) = cust.cust_account_id
1878: AND site.site_use_id (+) = NVL(p_site_use_id,-44444);

Line 2773: It is now possible to have an hz_customer_profiles cp row

2769:
2770: /* 2362943:given the statement or dunning site_use_id return bill_to id */
2771: /*
2772: 2357301 : After the code changes for bug2335304
2773: It is now possible to have an hz_customer_profiles cp row
2774: where site_use_id is for a site with purpose in (STMTS, DUN)
2775:
2776: In such cases, this function will return the following :
2777:

Line 2782: have a row in hz_customer_profiles

2778: if cp.site_use_id = p_site_use_id exists
2779: return p_site_use_id
2780: if cp.site_use_id = p_site_use_id DOES NOT exist
2781: - return the site_use_id for this same cust_acct_site_id that does
2782: have a row in hz_customer_profiles
2783:
2784: So technically, this no longer returns the site_use_id with the BILL_TO purpose
2785: but rather it returns the site_use_id that exists in hz_customer_profiles
2786: the function should really be get_site_with_profile

Line 2785: but rather it returns the site_use_id that exists in hz_customer_profiles

2781: - return the site_use_id for this same cust_acct_site_id that does
2782: have a row in hz_customer_profiles
2783:
2784: So technically, this no longer returns the site_use_id with the BILL_TO purpose
2785: but rather it returns the site_use_id that exists in hz_customer_profiles
2786: the function should really be get_site_with_profile
2787:
2788: Bug 4128837 : The whole premise of the new get_bill_id was written under
2789: the assumption that a distinct cust_acct_site_id, can only have one row

Line 2790: in hz_customer_profiles. This was based on the current Customer Form behavior

2786: the function should really be get_site_with_profile
2787:
2788: Bug 4128837 : The whole premise of the new get_bill_id was written under
2789: the assumption that a distinct cust_acct_site_id, can only have one row
2790: in hz_customer_profiles. This was based on the current Customer Form behavior
2791:
2792: However, it has been noted that old data actually shows that a cust_acct_site_id
2793: with 2 or more business purposes can have multiple rows in the profiles table
2794: and this was causing ORA-1422 error. The fix on the exception block ensures that

Line 2811: FROM hz_customer_profiles

2807: -- if found, regardless of it's site_use_code, return that site_use_id
2808:
2809: SELECT distinct site_use_id
2810: INTO l_site_with_profile
2811: FROM hz_customer_profiles
2812: WHERE site_use_id = p_site_use_id;
2813:
2814: return l_site_with_profile;
2815:

Line 2821: -- Find site_use_id from hz_customer_profiles,

2817: WHEN NO_DATA_FOUND THEN
2818:
2819: BEGIN
2820:
2821: -- Find site_use_id from hz_customer_profiles,
2822: -- that uses the same cust_acct_site_id as p_site_use_id
2823:
2824: select site_use_id
2825: into l_site_with_profile

Line 2826: from hz_customer_profiles

2822: -- that uses the same cust_acct_site_id as p_site_use_id
2823:
2824: select site_use_id
2825: into l_site_with_profile
2826: from hz_customer_profiles
2827: where site_use_id in ( select site_use_id
2828: from hz_cust_site_uses
2829: where cust_acct_site_id =
2830: ( SELECT cust_acct_site_id

Line 2845: -- wherein one cust_acct_site_id can have multiple rows in hz_customer_profiles

2841: -- there are no site level profiles
2842: return null;
2843: WHEN TOO_MANY_ROWS THEN
2844: -- Bug 4128837 : this is the case for historical "bad" data,
2845: -- wherein one cust_acct_site_id can have multiple rows in hz_customer_profiles
2846: -- In this case, use the BILL_TO site (since this is the profile that
2847: -- users can access in the customer standard form)
2848:
2849: BEGIN

Line 2853: from hz_customer_profiles

2849: BEGIN
2850:
2851: select site_use_id
2852: into l_site_with_profile
2853: from hz_customer_profiles
2854: where site_use_id in ( select site_use_id
2855: from hz_cust_site_uses
2856: where cust_acct_site_id =
2857: ( SELECT cust_acct_site_id

Line 2882: FROM hz_customer_profiles

2878:
2879: BEGIN
2880: SELECT statement_cycle_id
2881: INTO l_cycle_id
2882: FROM hz_customer_profiles
2883: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2884:
2885: RETURN l_cycle_id;
2886: END;

Line 2897: FROM hz_customer_profiles

2893:
2894: BEGIN
2895: SELECT nvl(send_statements ,'N')
2896: INTO l_send
2897: FROM hz_customer_profiles
2898: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2899:
2900: RETURN l_send;
2901: END;

Line 2912: FROM hz_customer_profiles

2908:
2909: BEGIN
2910: SELECT nvl(credit_balance_statements ,'N')
2911: INTO l_cred_bal
2912: FROM hz_customer_profiles
2913: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2914:
2915: RETURN l_cred_bal;
2916: END;