1 Package pay_spr_bus as
2 /* $Header: pysprrhi.pkh 120.0 2005/05/29 08:54:16 appldev noship $ */
3 --
4 -- ---------------------------------------------------------------------------
5 -- |----------------------< set_security_group_id >--------------------------|
6 -- ---------------------------------------------------------------------------
7 -- {Start Of Comments}
8 --
9 -- Description:
10 -- Sets the security_group_id in CLIENT_INFO for the appropriate business
11 -- group context.
12 --
13 -- Prerequisites:
14 -- The primary key identified by p_security_profile_id
15 -- p_payroll_id
16 -- already exists.
17 --
18 -- In Arguments:
19 -- p_security_profile_id
20 -- p_payroll_id
21 --
22 --
23 -- Post Success:
24 -- The security_group_id will be set in CLIENT_INFO.
25 --
26 -- Post Failure:
27 -- An error is raised if the value does not exist.
28 --
29 -- Access Status:
30 -- Internal Development Use Only.
31 --
32 -- {End Of Comments}
33 -- ---------------------------------------------------------------------------
34 procedure set_security_group_id
35 (p_security_profile_id in number
36 ,p_payroll_id in number
37 ,p_associated_column1 in varchar2 default null
38 ,p_associated_column2 in varchar2 default null
39 );
40 --
41 --
42 -- ---------------------------------------------------------------------------
43 -- |---------------------< return_legislation_code >-------------------------|
44 -- ---------------------------------------------------------------------------
45 -- {Start Of Comments}
46 --
47 -- Description:
48 -- Return the legislation code for a specific primary key value
49 --
50 -- Prerequisites:
51 -- The primary key identified by p_security_profile_id
52 -- p_payroll_id
53 -- already exists.
54 --
55 -- In Arguments:
56 -- p_security_profile_id
57 -- p_payroll_id
58 --
59 --
60 -- Post Success:
61 -- The business group's legislation code will be returned.
62 --
63 -- Post Failure:
64 -- An error is raised if the value does not exist.
65 --
66 -- Access Status:
67 -- Internal Development Use Only.
68 --
69 -- {End Of Comments}
70 -- ---------------------------------------------------------------------------
71 FUNCTION return_legislation_code
72 (p_security_profile_id in number
73 ,p_payroll_id in number
74 ) RETURN varchar2;
75 --
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< insert_validate >----------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start of comments}
81 --
82 -- Description:
83 -- This procedure controls the execution of all insert business rules
84 -- validation.
85 --
86 -- Prerequisites:
87 -- This private procedure is called from ins procedure.
88 --
89 -- In Parameters:
90 -- A Pl/Sql record structure.
91 --
92 -- Post Success:
93 -- Processing continues.
94 --
95 -- Post Failure:
96 -- If a business rules fails the error will not be handled by this procedure
97 -- unless explicity coded.
98 --
99 -- Developer Implementation Notes:
100 -- For insert, your business rules should be executed from this procedure
101 -- and should ideally (unless really necessary) just be straight procedure
102 -- or function calls. Try and avoid using conditional branching logic.
103 --
104 -- Access Status:
105 -- Internal Row Handler Use Only.
106 --
107 -- {End of comments}
108 -- ----------------------------------------------------------------------------
109 Procedure insert_validate
110 (p_effective_date in date
111 ,p_rec in pay_spr_shd.g_rec_type
112 );
113 --
114 -- ----------------------------------------------------------------------------
115 -- |---------------------------< delete_validate >----------------------------|
116 -- ----------------------------------------------------------------------------
117 -- {Start Of Comments}
118 --
119 -- Description:
120 -- This procedure controls the execution of all delete business rules
121 -- validation.
122 --
123 -- Prerequisites:
124 -- This private procedure is called from del procedure.
125 --
126 -- In Parameters:
127 -- A Pl/Sql record structure.
128 --
129 -- Post Success:
130 -- Processing continues.
131 --
132 -- Post Failure:
133 -- If a business rules fails the error will not be handled by this procedure
134 -- unless explicity coded.
135 --
136 -- Developer Implementation Notes:
137 -- For delete, your business rules should be executed from this procedure
138 -- and should ideally (unless really necessary) just be straight procedure
139 -- or function calls. Try and avoid using conditional branching logic.
140 --
141 -- Access Status:
142 -- Internal Row Handler Use Only.
143 --
144 -- {End Of Comments}
145 -- ----------------------------------------------------------------------------
146 Procedure delete_validate
147 (p_rec in pay_spr_shd.g_rec_type
148 );
149 --
150 -- --------------------------------------------------------------------------
151 -- |----------------------------<chk_payroll_id>----------------------------|
152 -- --------------------------------------------------------------------------
153 --
154 -- {Start Of Comments}
155 -- Description:
156 -- This procedure Validates that the payroll_id passed exists and
157 -- belongs to the same business group as the security_profile_id.
158 --
159 -- In Parameters:
160 -- security_profile_id
161 -- payroll_id
162 --
163 -- Post Success:
164 -- Processing continues if the business_group_id is valid
165 --
166 -- Post Failure:
167 -- An appplication error is raised if business_group_id was not
168 -- returned meaning either the payroll_id or security_profile_id is
169 -- invalid
170 --
171 -- Access Status:
172 -- Internal Development Use Only.
173 -- {End Of Comments}
174 ------------------------------------------------------------------------------
175 procedure chk_payroll_id
176 (p_payroll_id in pay_all_payrolls_f.payroll_id%type
177 ,p_security_profile_id in pay_security_payrolls.security_profile_id%type
178 ,p_business_group_id out nocopy pay_all_payrolls_f.business_group_id%type
179 );
180 --
181 -- --------------------------------------------------------------------------
182 -- |-------------------------<chk_security_profile>-------------------------|
183 -- --------------------------------------------------------------------------
184 -- {Start Of Comments}
185 -- Description:
186 -- This procedure Validates that the security_profile passed exists or is
187 -- global
188 --
189 -- In Parameters:
190 -- security_profile_id
191 --
192 -- Post Success:
193 -- Processing continues if the business_group_id is valid
194 --
195 -- Post Failure:
196 -- An appplication error is raised if business_group_id is invalid
197 -- or global
198 --
199 -- Access Status:
200 -- Internal Development Use Only.
201 -- {End Of Comments}
202 ------------------------------------------------------------------------------
203 procedure chk_security_profile
204 (p_security_profile_id in per_security_profiles.security_profile_id%type
205 ,p_business_group_id out nocopy per_security_profiles.business_group_id%type
206 );
207 --
208 -- --------------------------------------------------------------------------
209 -- |-------------------------<chk_for_duplicate>----------------------------|
210 -- --------------------------------------------------------------------------
211 -- {Start Of Comments}
212 -- Description:
213 -- This procedure validates that the security payroll is unique for this
214 -- security profile.
215 --
216 -- In Parameters:
217 -- security_profile_id
218 -- payroll_id
219 --
220 -- Post Success:
221 -- Processing continues without error.
222 --
223 -- Post Failure:
224 -- An appplication error is raised if a duplicate security payroll is
225 -- found.
226 --
227 -- Access Status:
228 -- Internal Development Use Only.
229 -- {End Of Comments}
230 --
231 PROCEDURE chk_for_duplicate
232 (p_security_profile_id IN NUMBER
233 ,p_payroll_id IN NUMBER);
234 --
235 -- --------------------------------------------------------------------------
236 -- |-------------------------<chk_view_all_payrolls_flag>-------------------|
237 -- --------------------------------------------------------------------------
238 -- {Start Of Comments}
239 -- Description:
240 -- This procedure validates that the security profile's view all payrolls
241 -- flag is set to No (payroll restrictions can be added).
242 --
243 -- In Parameters:
244 -- security_profile_id
245 --
246 -- Post Success:
247 -- Processing continues without error.
248 --
249 -- Post Failure:
250 -- An appplication error is raised if the view all payrolls flag is not
251 -- No.
252 --
253 -- Access Status:
254 -- Internal Development Use Only.
255 -- {End Of Comments}
256 --
257 PROCEDURE chk_view_all_payrolls_flag
258 (p_security_profile_id IN NUMBER);
259 --
260 -- --------------------------------------------------------------------------
261 -- |-------------------------<set_view_all_payrolls_flag>-------------------|
262 -- --------------------------------------------------------------------------
263 -- {Start Of Comments}
264 -- Description:
265 -- This procedure will update the security profile's view all payrolls flag
266 -- to Yes after the last security payroll has been deleted.
267 --
268 -- In Parameters:
269 -- security_profile_id
270 --
271 -- Post Success:
272 -- The security profile is updated and processing continues without error.
273 --
274 -- Post Failure:
275 -- An unexpected error would have occured. This will be raised and will
276 -- cause a rollback.
277 --
278 -- Access Status:
279 -- Internal Development Use Only.
280 -- {End Of Comments}
281 --
282 PROCEDURE set_view_all_payrolls_flag
283 (p_security_profile_id IN NUMBER);
284 --
285 end pay_spr_bus;