DBA Data[Home] [Help]

APPS.ARPT_SQL_FUNC_UTIL dependencies on HZ_CUSTOMER_PROFILES

Line 1783: FROM hz_customer_profiles cust,

1779: BEGIN
1780:
1781: SELECT NVL(site.override_terms, cust.override_terms)
1782: INTO l_override_terms
1783: FROM hz_customer_profiles cust,
1784: hz_customer_profiles site
1785: WHERE cust.cust_account_id = p_customer_id
1786: AND cust.site_use_id IS NULL
1787: AND site.cust_account_id (+) = cust.cust_account_id

Line 1784: hz_customer_profiles site

1780:
1781: SELECT NVL(site.override_terms, cust.override_terms)
1782: INTO l_override_terms
1783: FROM hz_customer_profiles cust,
1784: hz_customer_profiles site
1785: WHERE cust.cust_account_id = p_customer_id
1786: AND cust.site_use_id IS NULL
1787: AND site.cust_account_id (+) = cust.cust_account_id
1788: AND site.site_use_id (+) = NVL(p_site_use_id,-44444);

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

2650:
2651: /* 2362943:given the statement or dunning site_use_id return bill_to id */
2652: /*
2653: 2357301 : After the code changes for bug2335304
2654: It is now possible to have an hz_customer_profiles cp row
2655: where site_use_id is for a site with purpose in (STMTS, DUN)
2656:
2657: In such cases, this function will return the following :
2658:

Line 2663: have a row in hz_customer_profiles

2659: if cp.site_use_id = p_site_use_id exists
2660: return p_site_use_id
2661: if cp.site_use_id = p_site_use_id DOES NOT exist
2662: - return the site_use_id for this same cust_acct_site_id that does
2663: have a row in hz_customer_profiles
2664:
2665: So technically, this no longer returns the site_use_id with the BILL_TO purpose
2666: but rather it returns the site_use_id that exists in hz_customer_profiles
2667: the function should really be get_site_with_profile

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

2662: - return the site_use_id for this same cust_acct_site_id that does
2663: have a row in hz_customer_profiles
2664:
2665: So technically, this no longer returns the site_use_id with the BILL_TO purpose
2666: but rather it returns the site_use_id that exists in hz_customer_profiles
2667: the function should really be get_site_with_profile
2668:
2669: Bug 4128837 : The whole premise of the new get_bill_id was written under
2670: the assumption that a distinct cust_acct_site_id, can only have one row

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

2667: the function should really be get_site_with_profile
2668:
2669: Bug 4128837 : The whole premise of the new get_bill_id was written under
2670: the assumption that a distinct cust_acct_site_id, can only have one row
2671: in hz_customer_profiles. This was based on the current Customer Form behavior
2672:
2673: However, it has been noted that old data actually shows that a cust_acct_site_id
2674: with 2 or more business purposes can have multiple rows in the profiles table
2675: and this was causing ORA-1422 error. The fix on the exception block ensures that

Line 2692: FROM hz_customer_profiles

2688: -- if found, regardless of it's site_use_code, return that site_use_id
2689:
2690: SELECT distinct site_use_id
2691: INTO l_site_with_profile
2692: FROM hz_customer_profiles
2693: WHERE site_use_id = p_site_use_id;
2694:
2695: return l_site_with_profile;
2696:

Line 2702: -- Find site_use_id from hz_customer_profiles,

2698: WHEN NO_DATA_FOUND THEN
2699:
2700: BEGIN
2701:
2702: -- Find site_use_id from hz_customer_profiles,
2703: -- that uses the same cust_acct_site_id as p_site_use_id
2704:
2705: select site_use_id
2706: into l_site_with_profile

Line 2707: from hz_customer_profiles

2703: -- that uses the same cust_acct_site_id as p_site_use_id
2704:
2705: select site_use_id
2706: into l_site_with_profile
2707: from hz_customer_profiles
2708: where site_use_id in ( select site_use_id
2709: from hz_cust_site_uses
2710: where cust_acct_site_id =
2711: ( SELECT cust_acct_site_id

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

2722: -- there are no site level profiles
2723: return null;
2724: WHEN TOO_MANY_ROWS THEN
2725: -- Bug 4128837 : this is the case for historical "bad" data,
2726: -- wherein one cust_acct_site_id can have multiple rows in hz_customer_profiles
2727: -- In this case, use the BILL_TO site (since this is the profile that
2728: -- users can access in the customer standard form)
2729:
2730: BEGIN

Line 2734: from hz_customer_profiles

2730: BEGIN
2731:
2732: select site_use_id
2733: into l_site_with_profile
2734: from hz_customer_profiles
2735: where site_use_id in ( select site_use_id
2736: from hz_cust_site_uses
2737: where cust_acct_site_id =
2738: ( SELECT cust_acct_site_id

Line 2763: FROM hz_customer_profiles

2759:
2760: BEGIN
2761: SELECT statement_cycle_id
2762: INTO l_cycle_id
2763: FROM hz_customer_profiles
2764: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2765:
2766: RETURN l_cycle_id;
2767: END;

Line 2778: FROM hz_customer_profiles

2774:
2775: BEGIN
2776: SELECT nvl(send_statements ,'N')
2777: INTO l_send
2778: FROM hz_customer_profiles
2779: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2780:
2781: RETURN l_send;
2782: END;

Line 2793: FROM hz_customer_profiles

2789:
2790: BEGIN
2791: SELECT nvl(credit_balance_statements ,'N')
2792: INTO l_cred_bal
2793: FROM hz_customer_profiles
2794: WHERE site_use_id = arpt_sql_func_util.get_bill_id(p_site_use_id);
2795:
2796: RETURN l_cred_bal;
2797: END;