DBA Data[Home] [Help]

PACKAGE BODY: APPS.ISC_DEPOT_PARTY_MERGE_PKG

Source


1 PACKAGE BODY ISC_DEPOT_PARTY_MERGE_PKG AS
2 /* $Header: iscdepotetlpb.pls 120.0 2005/05/25 17:21:47 appldev noship $ */
3 procedure REPAIR_ORDERS_F_M(
4                         p_entity_name in varchar2,
5                         p_from_id in number,
6                         p_to_id in out nocopy number,
7                         p_from_fk_id in number,
8                         p_to_fk_id in number,
9                         p_parent_entity_name in varchar2,
10                         p_batch_id in number,
11                         p_batch_party_id in number,
12                         p_return_status in out nocopy varchar2)
13 IS
14 
15   l_merge_reason_code	hz_merge_batch.merge_reason_code%type;
16 
17 BEGIN
18 
19   arp_message.set_line('ISC_DEPOT_PARTY_MERGE_PKG.REPAIR_ORDERS_F_M()+');
20 
21   p_return_status := FND_API.G_RET_STS_SUCCESS;
22 
23   SELECT merge_reason_code
24      INTO   l_merge_reason_code
25      FROM   hz_merge_batch
26     WHERE  batch_id  = p_batch_id;
27 
28    IF l_merge_reason_code = 'DUPLICATE' THEN
29       -- if reason code is duplicate then allow the party merge to happen without
30       -- any validations.
31       NULL;
32    ELSE
33       -- if there are any validations to be done, include it in this section
34       NULL;
35    END IF;
36 
37    -- If the parent has NOT changed (ie. Parent getting transferred) then nothing
38    -- needs to be done. Set Merged To Id is same as Merged From Id and return
39 
40    IF p_from_fk_id = p_to_fk_id THEN
41       p_to_id := p_from_id;
42       RETURN;
43    ELSE
44     update isc_dr_repair_orders_f
45     set customer_id = p_to_fk_id,
46         last_update_date = hz_utility_pub.last_update_date,
47       	last_updated_by = hz_utility_pub.user_id,
48      	last_update_login = hz_utility_pub.last_update_login
49     where customer_id = p_from_fk_id;
50   END IF;
51 
52 END REPAIR_ORDERS_F_M;
53 END ISC_DEPOT_PARTY_MERGE_PKG;