DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_MX_EX_EMPLOYEE_API

Source


1 PACKAGE BODY hr_mx_ex_employee_api AS
2 /* $Header: pemxwrxe.pkb 120.0 2005/05/31 11:38 appldev noship $ */
3 --
4   g_package  VARCHAR2(33);
5   g_debug    BOOLEAN;
6 -- -----------------------------------------------------------------------------
7 -- |------------------------< mx_final_process_emp >--------------------------|
8 -- -----------------------------------------------------------------------------
9 --
10 PROCEDURE mx_final_process_emp
11   (p_validate                      IN     BOOLEAN  DEFAULT FALSE
12   ,p_period_of_service_id          IN     NUMBER
13   ,p_ss_leaving_reason             IN     VARCHAR2 DEFAULT HR_API.G_VARCHAR2
14   ,p_object_version_number         IN OUT NOCOPY NUMBER
15   ,p_final_process_date            IN OUT NOCOPY DATE
16   ,p_org_now_no_manager_warning       OUT NOCOPY BOOLEAN
17   ,p_asg_future_changes_warning       OUT NOCOPY BOOLEAN
18   ,p_entries_changed_warning          OUT NOCOPY VARCHAR2
19   )
20 IS
21     -- Declare cursors and local variables
22     l_proc               VARCHAR2(72);
23     l_business_group_id  per_periods_of_service.business_group_id%TYPE;
24 
25     CURSOR csr_get_bg IS
26     SELECT business_group_id
27       FROM per_periods_of_service
28      WHERE period_of_service_id = p_period_of_service_id;
29     --
30   BEGIN
31 
32     l_proc  := g_package||'mx_final_process_emp';
33 
34   if g_debug then
35    hr_utility.set_location('Entering:'|| l_proc, 10);
36   end if;
37 
38   -----------------------------------------------------------------
39   -- Fetch Business Group ID for the given Period of Service.
40   -----------------------------------------------------------------
41   OPEN csr_get_bg;
42   FETCH csr_get_bg INTO l_business_group_id;
43 
44   IF csr_get_bg%NOTFOUND THEN
45 
46      if g_debug then
47        hr_utility.set_location(l_proc, 20);
48      end if;
49 
50      CLOSE csr_get_bg;
51      hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
52      hr_utility.raise_error;
53   END IF;
54   --
55   CLOSE csr_get_bg;
56 
57   -----------------------------------------------------------------
58   -- Check if the business group lies within 'MX' legislation
59   -----------------------------------------------------------------
60   hr_mx_utility.check_bus_grp(l_business_group_id, 'MX');
61 
62  if g_debug then
63   hr_utility.set_location(l_proc, 30);
64  end if;
65 
66     --
67   -----------------------------------------------------------------
68    -- Validate the Leaving Reason entered, if any.
69   -----------------------------------------------------------------
70    per_mx_validations.check_SS_Leaving_Reason(p_ss_leaving_reason);
71 
72    if g_debug then
73        hr_utility.set_location(l_proc, 40);
74    end if;
75 
76   -----------------------------------------------------------------
77    -- Load the Leaving Reason onto the Global Variable.
78   -----------------------------------------------------------------
79    hr_mx_assignment_api.g_leaving_reason := p_ss_leaving_reason;
80 
81     -----------------------------------------
82     -- Call the person business process
83     -----------------------------------------
84     hr_ex_employee_api.final_process_emp
85   (p_validate                      =>	p_validate
86   ,p_period_of_service_id          =>	p_period_of_service_id
87   ,p_object_version_number         =>	p_object_version_number
88   ,p_final_process_date            =>	p_final_process_date
89   ,p_org_now_no_manager_warning    =>	p_org_now_no_manager_warning
90   ,p_asg_future_changes_warning    =>	p_asg_future_changes_warning
91   ,p_entries_changed_warning       =>	p_entries_changed_warning );
92 
93   --
94    if g_debug then
95        hr_utility.set_location('Leaving: '||l_proc, 50);
96    end if;
97   --
98   END mx_final_process_emp;
99 
100 BEGIN
101 
102   g_package  :=  'hr_mx_ex_employee_api.';
103   g_debug    :=  hr_utility.debug_enabled;
104 
105 END hr_mx_ex_employee_api;