DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_NZ_ASSIGNMENT_LEG_HOOK

Source


1 PACKAGE BODY hr_nz_assignment_leg_hook AS
2 /* $Header: hrnzlhas.pkb 120.0 2005/05/31 01:39:03 appldev noship $ */
3 /*
4  ******************************************************************
5  *                                                                *
6  *  Copyright (C) 1999 Oracle Corporation Australia Ltd.,         *
7  *                     Brisbane, Australia.                       *
8  *                                                                *
9  *  All rights reserved.                                          *
10  *                                                                *
11  *  This material has been provided pursuant to an agreement      *
12  *  containing restrictions on its use.  the material is also     *
13  *  protected by copyright law.  no part of this material may     *
14  *  be copied or distributed, transmitted or transcribed, in      *
15  *  any form or by any means, electronic, mechanical, magnetic,   *
16  *  manual, or otherwise, or disclosed to third parties without   *
17  *  the express written permission of Oracle Corporation          *
18  *  Australia Ltd,.                                               *
19  *                                                                *
20  ******************************************************************/
21 
22 /*
23 	Filename: hrnzlhas.pkb (BODY)
24     Author: Philip Macdonald
25  	Description: Creates the user hook seed data for the HR_ASSIGNMENT_API package procedures.
26 
27  	File Information
28  	================
29 
30 	Note for Oracle HRMS Developers: The data defined in the
31 	create API calls cannot be changed once this script has
32 	been shipped to customers. Explicit update or delete API
33 	calls will need to be added to the end of the script.
34 
35 
36  	Change List
37  	-----------
38 
39  	Version Date      Author     ER/CR No. Description of Change
40  	-------+---------+-----------+---------+--------------------------
41  	110.0   25-Jun-99 P.Macdonald           Created
42 
43  ================================================================= */
44   --
45   -- Package Variables
46   --
47   g_package  VARCHAR2(33) := 'hr_nz_assignment_leg_hook.';
48 
49   PROCEDURE set_upd_bus_grp_id( p_assignment_id NUMBER, p_effective_date DATE ) IS
50 
51     CURSOR csr_get_business_group_id(c_assignment_id  per_assignments_f.assignment_id%TYPE
52 									,c_effective_date DATE) IS
53      SELECT     paf.business_group_id
54      FROM       per_assignments_f      paf
55                ,per_business_groups    pbg
56      WHERE      paf.assignment_id       = c_assignment_id
57      AND        paf.business_group_id   = pbg.business_group_id
58      AND   		c_effective_date BETWEEN paf.effective_start_date AND paf.effective_end_date
59      AND        pbg.legislation_code    = 'NZ';
60 
61     l_business_group_id     per_business_groups.business_group_id%TYPE;
62     l_proc                  VARCHAR2(72) := g_package||'set_bus_grp_id';
63 
64   BEGIN
65     hr_utility.set_location('Entering:'|| l_proc, 10);
66     OPEN    csr_get_business_group_id(p_assignment_id,p_effective_date);
67     FETCH   csr_get_business_group_id INTO    l_business_group_id;
68     IF (csr_get_business_group_id%NOTFOUND)
69 	THEN
70       -- Assignment not valid for current legislation
71       CLOSE csr_get_business_group_id;
72       hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
73       hr_utility.set_message_token('LEG_CODE','NZ');
74       hr_utility.raise_error;
75     END IF;
76     CLOSE csr_get_business_group_id;
77     fnd_profile.put('PER_BUSINESS_GROUP_ID',l_business_group_id);
78     hr_utility.set_location(' Leaving:'||l_proc, 20);
79   END set_upd_bus_grp_id;
80 --
81 PROCEDURE set_cre_bus_grp_id( p_person_id NUMBER, p_effective_date DATE ) IS
82 --
83     CURSOR csr_get_business_group_id (c_person_id  per_people_f.person_id%TYPE
84 									 ,c_effective_date DATE) IS
85      SELECT     ppf.business_group_id
86      FROM       per_people_f       ppf
87                ,per_business_groups    pbg
88      WHERE      ppf.person_id           = c_person_id
89      AND        ppf.business_group_id   = pbg.business_group_id
90      AND   		c_effective_date BETWEEN ppf.effective_start_date AND ppf.effective_end_date
91      AND        pbg.legislation_code    = 'NZ';
92 --
93     l_business_group_id     per_business_groups.business_group_id%TYPE;
94     l_proc                  VARCHAR2(72) := g_package||'set_bus_grp_id';
95 --
96   BEGIN
97     hr_utility.set_location('Entering:'|| l_proc, 10);
98     OPEN    csr_get_business_group_id(p_person_id, p_effective_date);
99     FETCH   csr_get_business_group_id INTO l_business_group_id;
100     IF (csr_get_business_group_id%NOTFOUND)
101 	THEN
102       -- Person not valid for current legislation
103       CLOSE csr_get_business_group_id;
104       hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
105       hr_utility.set_message_token('LEG_CODE','NZ');
106       hr_utility.raise_error;
107     END IF;
108     CLOSE csr_get_business_group_id;
109     fnd_profile.put('PER_BUSINESS_GROUP_ID',l_business_group_id);
110     hr_utility.set_location(' Leaving:'||l_proc, 20);
111   END set_cre_bus_grp_id;
112   --
113 END hr_nz_assignment_leg_hook;