DBA Data[Home] [Help]

APPS.ARP_CMERGE_ARCUS dependencies on HZ_CUST_ACCOUNT_ROLES

Line 2355: | merge in HZ_CUST_ACCOUNT_ROLES with

2351: | PROCEDURE
2352: | ra_cont
2353: |
2354: | DESCRIPTION
2355: | merge in HZ_CUST_ACCOUNT_ROLES with
2356: | role_type = 'CONTACT'
2357: |
2358: | SCOPE - PRIVATE
2359: |

Line 2382: l_party_id HZ_CUST_ACCOUNT_ROLES.PARTY_ID%TYPE;

2378: set_num NUMBER,
2379: process_mode VARCHAR2
2380: ) IS
2381:
2382: l_party_id HZ_CUST_ACCOUNT_ROLES.PARTY_ID%TYPE;
2383:
2384: CURSOR c1 IS
2385: SELECT cust_account_role_id
2386: FROM hz_cust_account_roles yt, ra_customer_merges m

Line 2386: FROM hz_cust_account_roles yt, ra_customer_merges m

2382: l_party_id HZ_CUST_ACCOUNT_ROLES.PARTY_ID%TYPE;
2383:
2384: CURSOR c1 IS
2385: SELECT cust_account_role_id
2386: FROM hz_cust_account_roles yt, ra_customer_merges m
2387: WHERE cust_acct_site_id = m.duplicate_address_id
2388: AND m.process_flag = 'N'
2389: AND m.request_id = req_id
2390: AND m.set_number = set_num

Line 2396: FROM hz_cust_account_roles yt, ra_customer_merges m

2392: FOR UPDATE NOWAIT;
2393:
2394: CURSOR c2 IS
2395: SELECT cust_account_role_id
2396: FROM hz_cust_account_roles yt, ra_customer_merges m
2397: WHERE cust_account_id = m.duplicate_id
2398: AND m.process_flag = 'N'
2399: AND m.request_id = req_id
2400: AND m.set_number = set_num

Line 2407: FROM HZ_CUST_ACCOUNT_ROLES yt,ra_customer_merges m,HZ_CUST_ACCOUNTS ca,hz_relationships rel

2403: FOR UPDATE NOWAIT;
2404: ----Bug No: 5067291
2405: CURSOR c3 is
2406: SELECT yt.party_id
2407: FROM HZ_CUST_ACCOUNT_ROLES yt,ra_customer_merges m,HZ_CUST_ACCOUNTS ca,hz_relationships rel
2408: WHERE m.customer_id=ca.cust_account_id
2409: AND m.duplicate_id = yt.cust_account_id
2410: AND rel.party_id = yt.party_id
2411: AND rel.subject_type = 'PERSON'

Line 2429: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );

2425: /* locking tables by opening and closing cursors */
2426: IF process_mode = 'LOCK' then
2427:
2428: arp_message.set_name( 'AR', 'AR_LOCKING_TABLE' );
2429: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2430:
2431: OPEN c1;
2432: CLOSE c1;
2433:

Line 2443: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );

2439: FETCH c3 INTO l_party_id;
2440: IF c3%FOUND THEN
2441: /*********************Inactivate account site/account role...Bug No. 5067291*********/
2442: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
2443: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2444: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2445: SET status = 'I',
2446: last_update_date = sysdate,
2447: last_updated_by = arp_standard.profile.user_id,

Line 2444: UPDATE HZ_CUST_ACCOUNT_ROLES yt

2440: IF c3%FOUND THEN
2441: /*********************Inactivate account site/account role...Bug No. 5067291*********/
2442: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
2443: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2444: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2445: SET status = 'I',
2446: last_update_date = sysdate,
2447: last_updated_by = arp_standard.profile.user_id,
2448: last_update_login = arp_standard.profile.last_update_login,

Line 2457: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );

2453: WHERE party_id = l_party_id
2454: AND nvl(status,'A') ='A';
2455:
2456: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
2457: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2458:
2459:
2460: g_count := sql%rowcount;
2461:

Line 2470: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );

2466:
2467: /************** account site level update ************/
2468:
2469: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
2470: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2471:
2472: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2473: SET (cust_account_id, cust_acct_site_id) = (
2474: SELECT MIN(m.customer_id), MIN(m.customer_address_id)

Line 2472: UPDATE HZ_CUST_ACCOUNT_ROLES yt

2468:
2469: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE');
2470: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2471:
2472: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2473: SET (cust_account_id, cust_acct_site_id) = (
2474: SELECT MIN(m.customer_id), MIN(m.customer_address_id)
2475: FROM ra_customer_merges m
2476: WHERE yt.cust_account_id = m.duplicate_id

Line 2505: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );

2501:
2502: /************** account level update ************/
2503:
2504: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE' );
2505: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2506:
2507: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2508: SET cust_account_id = (
2509: SELECT m.customer_id

Line 2507: UPDATE HZ_CUST_ACCOUNT_ROLES yt

2503:
2504: arp_message.set_name( 'AR', 'AR_UPDATING_TABLE' );
2505: arp_message.set_token( 'TABLE_NAME', 'HZ_CUST_ACCOUNT_ROLES', FALSE );
2506:
2507: UPDATE HZ_CUST_ACCOUNT_ROLES yt
2508: SET cust_account_id = (
2509: SELECT m.customer_id
2510: FROM ra_customer_merges m
2511: WHERE yt.cust_account_id = m.duplicate_id

Line 2538: FROM hz_cust_account_roles r, ra_customer_merges m

2534: -- Start Bug 4712462
2535: FOR rec IN (
2536: SELECT min(cust_account_role_id) cust_account_role_id, cust_account_id,
2537: nvl(cust_acct_site_id,-1) cust_acct_site_id,party_id
2538: FROM hz_cust_account_roles r, ra_customer_merges m
2539: where m.request_id = req_id AND m.set_number = set_num
2540: AND r.cust_account_id = m.customer_id AND m.process_flag = 'N'
2541: GROUP BY cust_account_id,cust_acct_site_id,status,party_id
2542: HAVING NVL(STATUS,'A') ='A' AND count(1) > 1) LOOP

Line 2543: UPDATE hz_cust_account_roles SET status ='I'

2539: where m.request_id = req_id AND m.set_number = set_num
2540: AND r.cust_account_id = m.customer_id AND m.process_flag = 'N'
2541: GROUP BY cust_account_id,cust_acct_site_id,status,party_id
2542: HAVING NVL(STATUS,'A') ='A' AND count(1) > 1) LOOP
2543: UPDATE hz_cust_account_roles SET status ='I'
2544: WHERE cust_account_role_id <> rec.cust_account_role_id
2545: AND cust_account_id = rec.cust_account_id
2546: AND party_id = rec.party_id
2547: AND nvl(cust_acct_site_id,-1) = rec.cust_acct_site_id

Line 2983: | merge in HZ_CUST_ACCOUNT_ROLES with

2979: | PROCEDURE
2980: | do_cust_merge_contacts
2981: |
2982: | DESCRIPTION
2983: | merge in HZ_CUST_ACCOUNT_ROLES with
2984: | role_type = 'CONTACT' in account level
2985: |
2986: | SCOPE - PRIVATE
2987: |

Line 3058: FROM hz_cust_account_roles acct_role,

3054: --FOR PARTY REL REC
3055: rel.relationship_id,
3056: -- FOR ORG-CONTACT REC
3057: org.org_contact_id
3058: FROM hz_cust_account_roles acct_role,
3059: hz_org_contacts org,
3060: hz_relationships rel,
3061: hz_cust_accounts acct
3062: WHERE acct_role.role_type = 'CONTACT'

Line 3101: UPDATE hz_cust_account_roles

3097: p_to_party_id,
3098: x_org_party_id );
3099:
3100: -- Update the customer org contact with the new org contact id.
3101: UPDATE hz_cust_account_roles
3102: SET party_id = x_org_party_id
3103: WHERE cust_account_role_id = l_cust_acct_role_id;
3104:
3105: END LOOP;

Line 3123: | merge in HZ_CUST_ACCOUNT_ROLES with

3119: | PROCEDURE
3120: | do_site_merge_contacts
3121: |
3122: | DESCRIPTION
3123: | merge in HZ_CUST_ACCOUNT_ROLES with
3124: | role_type = 'CONTACT' in account site level
3125: |
3126: | SCOPE - PRIVATE
3127: |

Line 3217: FROM hz_cust_account_roles acct_role,

3213: org.org_contact_id
3214: --as per discussion with Gautam Prothia, we ignore party_site_id in customer
3215: --merge context
3216: -- org.party_site_id
3217: FROM hz_cust_account_roles acct_role,
3218: hz_org_contacts org,
3219: hz_relationships rel,
3220: hz_cust_accounts acct
3221: WHERE acct_role.role_type = 'CONTACT'

Line 3304: UPDATE hz_cust_account_roles

3300: p_to_party_id,
3301: x_org_party_id );
3302:
3303: -- Update the customer org contact with the new org contact id.
3304: UPDATE hz_cust_account_roles
3305: SET party_id = x_org_party_id
3306: WHERE cust_account_role_id = l_cust_acct_role_id;
3307:
3308: END LOOP;

Line 6852: ---------Insert into hz_cust_account_roles_m--------------

6848: arp_message.set_line(SQL%ROWCOUNT||' '|| 'Row(s) inserted in HZ_CUST_ACCOUNTS_M');
6849:
6850:
6851:
6852: ---------Insert into hz_cust_account_roles_m--------------
6853: --Because roles can be set up at acct and site level, we need to select
6854: --distict duplicate and customer_merge_header_id if acct with multiple sites
6855: --have roles set up at account level.
6856:

Line 6857: INSERT INTO hz_cust_account_roles_m(

6853: --Because roles can be set up at acct and site level, we need to select
6854: --distict duplicate and customer_merge_header_id if acct with multiple sites
6855: --have roles set up at account level.
6856:
6857: INSERT INTO hz_cust_account_roles_m(
6858: customer_merge_header_id,
6859: cust_account_role_id ,
6860: party_id ,
6861: cust_account_id ,

Line 7005: and cm.duplicate_id <> cm.customer_id), hz_cust_account_roles ar

7001: from ra_customer_merges cm
7002: where cm.process_flag = 'N'
7003: and cm.request_id = req_id
7004: and cm.set_number = set_num
7005: and cm.duplicate_id <> cm.customer_id), hz_cust_account_roles ar
7006: WHERE ( ar.cust_account_id = duplicate_id OR
7007: ar.cust_acct_site_id = duplicate_address_id )
7008: AND ar.role_type = 'CONTACT';
7009:

Line 7010: arp_message.set_line(SQL%ROWCOUNT||' '|| 'Row(s) inserted in HZ_CUST_ACCOUNT_ROLES_M');

7006: WHERE ( ar.cust_account_id = duplicate_id OR
7007: ar.cust_acct_site_id = duplicate_address_id )
7008: AND ar.role_type = 'CONTACT';
7009:
7010: arp_message.set_line(SQL%ROWCOUNT||' '|| 'Row(s) inserted in HZ_CUST_ACCOUNT_ROLES_M');
7011:
7012: ---------Insert into hz_customer_profiles_m--------------
7013: --Because profiles can be set up at acct and site use level, we need to select
7014: --distict duplicate and customer_merge_header_id if acct with multiple sites