DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_AMT_BUS

Source


1 Package Body pay_amt_bus as
2 /* $Header: pyamtrhi.pkb 120.0.12000000.1 2007/01/17 15:30:47 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33);  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_module_type_id              number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_module_type_id                       in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   --
26   -- Declare local variables
27   --
28   l_security_group_id number;
29   l_proc              varchar2(72);
30   l_legislation_code  varchar2(150);
31   --
32 begin
33   --
34   l_proc :=  g_package||'set_security_group_id';
35   --
36   hr_utility.set_location('Entering:'|| l_proc, 10);
37   --
38   -- Ensure that all the mandatory parameter are not null
39   --
40   hr_api.mandatory_arg_error
41     (p_api_name           => l_proc
42     ,p_argument           => 'module_type_id'
43     ,p_argument_value     => p_module_type_id
44     );
45   --
46   --
47   hr_utility.set_location(' Leaving:'|| l_proc, 20);
48   --
49 end set_security_group_id;
50 --
51 --  ---------------------------------------------------------------------------
52 --  |---------------------< return_legislation_code >-------------------------|
53 --  ---------------------------------------------------------------------------
54 --
55 Function return_legislation_code
56   (p_module_type_id                       in     number
57   )
58   Return Varchar2 Is
59   --
60   --
61   -- Declare local variables
62   --
63   l_legislation_code  varchar2(150);
64   l_proc              varchar2(72);
65   --
66 Begin
67   --
68   l_proc :=  g_package||'return_legislation_code';
69   --
70   hr_utility.set_location('Entering:'|| l_proc, 10);
71   --
72   -- Ensure that all the mandatory parameter are not null
73   --
74   hr_api.mandatory_arg_error
75     (p_api_name           => l_proc
76     ,p_argument           => 'module_type_id'
77     ,p_argument_value     => p_module_type_id
78     );
79   --
80   hr_utility.set_location(' Leaving:'|| l_proc, 40);
81   return l_legislation_code;
82 end return_legislation_code;
83 --
84 -- ----------------------------------------------------------------------------
85 -- |-----------------------< chk_non_updateable_args >------------------------|
86 -- ----------------------------------------------------------------------------
87 -- {Start Of Comments}
88 --
89 -- Description:
90 --   This procedure is used to ensure that non updateable attributes have
91 --   not been updated. If an attribute has been updated an error is generated.
92 --
93 -- Pre Conditions:
94 --   g_old_rec has been populated with details of the values currently in
95 --   the database.
96 --
97 -- In Arguments:
98 --   p_rec has been populated with the updated values the user would like the
99 --   record set to.
100 --
101 -- Post Success:
102 --   Processing continues if all the non updateable attributes have not
103 --   changed.
104 --
105 -- Post Failure:
106 --   An application error is raised if any of the non updatable attributes
107 --   have been altered.
108 --
109 -- {End Of Comments}
110 -- ----------------------------------------------------------------------------
111 Procedure chk_non_updateable_args
112   (p_rec in pay_amt_shd.g_rec_type
113   ) IS
114 --
115   l_proc     varchar2(72);
116 --
117 Begin
118   --
119   l_proc := g_package || 'chk_non_updateable_args';
120   --
121   -- Only proceed with the validation if a row exists for the current
122   -- record in the HR Schema.
123   --
124   IF NOT pay_amt_shd.api_updating
125       (p_module_type_id                    => p_rec.module_type_id
126       ,p_object_version_number             => p_rec.object_version_number
127       ) THEN
128      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
129      fnd_message.set_token('PROCEDURE ', l_proc);
130      fnd_message.set_token('STEP ', '5');
131      fnd_message.raise_error;
132   END IF;
133   --
134   -- EDIT_HERE: Add checks to ensure non-updateable args have
135   --            not been updated.
136   --
137 End chk_non_updateable_args;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |---------------------------< insert_validate >----------------------------|
141 -- ----------------------------------------------------------------------------
142 Procedure insert_validate
143   (p_rec                          in pay_amt_shd.g_rec_type
144   ) is
145 --
146   l_proc  varchar2(72);
147 --
148 Begin
149   l_proc := g_package||'insert_validate';
150   --
151   hr_utility.set_location('Entering:'||l_proc, 5);
152   --
153   -- Call all supporting business operations
154   --
155   --
156   -- Validate Dependent Attributes
157   --
158   --
159   hr_utility.set_location(' Leaving:'||l_proc, 10);
160 End insert_validate;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |---------------------------< update_validate >----------------------------|
164 -- ----------------------------------------------------------------------------
165 Procedure update_validate
166   (p_rec                          in pay_amt_shd.g_rec_type
167   ) is
168 --
169   l_proc  varchar2(72);
170 --
171 Begin
172   l_proc := g_package||'update_validate';
173   --
174   hr_utility.set_location('Entering:'||l_proc, 5);
175   --
176   -- Call all supporting business operations
177   --
178   --
179   -- Validate Dependent Attributes
180   --
181   chk_non_updateable_args
182     (p_rec              => p_rec
183     );
184   --
185   --
186   hr_utility.set_location(' Leaving:'||l_proc, 10);
187 End update_validate;
188 --
189 -- ----------------------------------------------------------------------------
190 -- |---------------------------< delete_validate >----------------------------|
191 -- ----------------------------------------------------------------------------
192 Procedure delete_validate
193   (p_rec                          in pay_amt_shd.g_rec_type
194   ) is
195 --
196   l_proc  varchar2(72);
197 --
198 Begin
199   l_proc := g_package||'delete_validate';
200   --
201   hr_utility.set_location('Entering:'||l_proc, 5);
202   --
203   -- Call all supporting business operations
204   --
205   hr_utility.set_location(' Leaving:'||l_proc, 10);
206 End delete_validate;
207 --
208 begin
209   g_package := '  pay_amt_bus.';  -- Global package name
210 end pay_amt_bus;