1 Package pay_ipd_bus AUTHID CURRENT_USER as
2 /* $Header: pyipdrhi.pkh 120.1 2011/11/09 12:39:23 rsahai ship $ */
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_paye_details_id
15 -- already exists.
16 --
17 -- In Arguments:
18 -- p_paye_details_id
19 --
20 --
21 -- Post Success:
22 -- The security_group_id will be set in CLIENT_INFO.
23 --
24 -- Post Failure:
25 -- An error is raised if the value does not exist.
26 --
27 -- Access Status:
28 -- Internal Development Use Only.
29 --
30 -- {End Of Comments}
31 -- ---------------------------------------------------------------------------
32 procedure set_security_group_id
33 (p_paye_details_id in number
34 );
35 --
36 --
37 -- ---------------------------------------------------------------------------
38 -- |---------------------< return_legislation_code >-------------------------|
39 -- ---------------------------------------------------------------------------
40 -- {Start Of Comments}
41 --
42 -- Description:
43 -- Return the legislation code for a specific primary key value
44 --
45 -- Prerequisites:
46 -- The primary key identified by p_paye_details_id
47 -- already exists.
48 --
49 -- In Arguments:
50 -- p_paye_details_id
51 --
52 --
53 -- Post Success:
54 -- The business group's legislation code will be returned.
55 --
56 -- Post Failure:
57 -- An error is raised if the value does not exist.
58 --
59 -- Access Status:
60 -- Internal Development Use Only.
61 --
62 -- {End Of Comments}
63 -- ---------------------------------------------------------------------------
64 FUNCTION return_legislation_code
65 (p_paye_details_id in number
66 ) RETURN varchar2;
67 --
68 --
69 -- ---------------------------------------------------------------------------
70 -- |---------------------< chk_assignment_id >-------------------------|
71 -- ---------------------------------------------------------------------------
72 -- {Start Of Comments}
73 --
74 -- Description:
75 -- check if assignment already exists and valid as of the effectuve date
76 --
77 -- Prerequisites:
78 --
79 -- In Arguments:
80 -- p_effective_date
81 -- p_assignment_id
82 --
83 --
84 -- Post Success:
85 -- processing continues as no error is raised.
86 --
87 -- Post Failure:
88 -- An error is raised if the assignment does not exist.
89 --
90 -- Access Status:
91 -- Internal Development Use Only.
92 --
93 -- {End Of Comments}
94 -- ---------------------------------------------------------------------------
95 PROCEDURE chk_assignment_id
96 (p_effective_date IN DATE
97 , p_assignment_id IN NUMBER
98 );
99 --
100 --
101 -- ---------------------------------------------------------------------------
102 -- |---------------------< chk_info_source >-------------------------|
103 -- ---------------------------------------------------------------------------
104 -- {Start Of Comments}
105 --
106 -- Description:
107 -- check if info_source already exists in lookup_type IE_PAYE_INFO_SOURCE
108 --
109 -- Prerequisites:
110 --
111 -- In Arguments:
112 -- p_effective_date
113 -- p_info_source
114 --
115 --
116 -- Post Success:
117 -- processing continues as no error is raised.
118 --
119 -- Post Failure:
120 -- An error is raised if the info_source does not exist.
121 --
122 -- Access Status:
123 -- Internal Development Use Only.
124 --
125 -- {End Of Comments}
126 -- ---------------------------------------------------------------------------
127 PROCEDURE chk_info_source
128 (p_effective_date IN DATE
129 , p_info_source IN VARCHAR2
130 );
131 --
132 --
133 -- ---------------------------------------------------------------------------
134 -- |---------------------< get_comm_period_no >-------------------------|
135 -- ---------------------------------------------------------------------------
136 -- {Start Of Comments}
137 --
138 -- Description:
139 -- Derive value of comm_period_no
140 --
141 -- Prerequisites:
142 --
143 -- In Arguments:
144 -- p_effective_date
145 -- p_assignemnt_id
146 --
147 --
148 -- Post Success:
149 -- returns value of commencement period number.
150 --
151 -- Post Failure:
152 --
153 --
154 -- Access Status:
155 -- Internal Development Use Only.
156 --
157 -- {End Of Comments}
158 -- ---------------------------------------------------------------------------
159 FUNCTION get_comm_period_no
160 ( p_effective_date IN DATE
161 , p_assignment_id IN NUMBER ) RETURN NUMBER;
162 --
163 --
164 --
165 -- ---------------------------------------------------------------------------
166 -- |---------------------< chk_comm_period_no >-------------------------|
167 -- ---------------------------------------------------------------------------
168 -- {Start Of Comments}
169 --
170 -- Description:
171 -- check if comm_period_no is valid
172 --
173 -- Prerequisites:
174 --
175 -- In Arguments:
176 -- p_effective_date
177 -- p_comm_period_no
178 -- p_assignment_id
179 --
180 --
181 -- Post Success:
182 -- processing continues as no error is raised.
183 --
184 -- Post Failure:
185 -- An error is raised if the comm_period_no is not valid
186 --
187 -- Access Status:
188 -- Internal Development Use Only.
189 --
190 -- {End Of Comments}
191 -- ---------------------------------------------------------------------------
192 PROCEDURE chk_comm_period_no
193 (p_effective_date IN DATE
194 , p_comm_period_no IN NUMBER
195 , p_assignment_id IN NUMBER
196 );
197 --
198 --
199 -- ---------------------------------------------------------------------------
200 -- |---------------------< chk_tax_basis >-------------------------|
201 -- ---------------------------------------------------------------------------
202 -- {Start Of Comments}
203 --
204 -- Description:
205 -- check if tax_basis already exists in lookup_type IE_PAYE_TAX_BASIS
206 --
207 -- Prerequisites:
208 --
209 -- In Arguments:
210 -- p_effective_date
211 -- p_tax_basis
212 --
213 --
214 -- Post Success:
215 -- processing continues as no error is raised.
216 --
217 -- Post Failure:
218 -- An error is raised if the info_source does not exist.
219 --
220 -- Access Status:
221 -- Internal Development Use Only.
222 --
223 -- {End Of Comments}
224 -- ---------------------------------------------------------------------------
225 PROCEDURE chk_tax_basis
226 (p_effective_date IN DATE
227 , p_tax_basis IN VARCHAR2
228 );
229 --
230 --
231 -- ---------------------------------------------------------------------------
232 -- |---------------------< chk_tax_assess_basis >-------------------------|
233 -- ---------------------------------------------------------------------------
234 -- {Start Of Comments}
235 --
236 -- Description:
237 -- check if tax_assess_basis already exists in lookup_type IE_PAYE_ASSESS_BASIS
238 --
239 -- Prerequisites:
240 --
241 -- In Arguments:
242 -- p_effective_date
243 -- p_tax_assess_basis
244 --
245 --
246 -- Post Success:
247 -- processing continues as no error is raised.
248 --
249 -- Post Failure:
250 -- An error is raised if the info_source does not exist.
251 --
252 -- Access Status:
253 -- Internal Development Use Only.
254 --
255 -- {End Of Comments}
256 -- ---------------------------------------------------------------------------
257 PROCEDURE chk_tax_assess_basis
258 (p_effective_date IN DATE
259 , p_tax_assess_basis IN VARCHAR2
260 );
261 --
262 --
263 -- ---------------------------------------------------------------------------
264 -- |---------------------< chk_cert_start_end_dates >-------------------------|
265 -- ---------------------------------------------------------------------------
266 -- {Start Of Comments}
267 --
268 -- Description:
269 -- check if certificate start dates is before or equal to certificate end date
270 --
271 -- Prerequisites:
272 --
273 -- In Arguments:
274 -- p_certificate_start_date
275 -- p_certificate_end_date
276 --
277 --
278 -- Post Success:
279 -- processing continues as no error is raised.
280 --
281 -- Post Failure:
282 -- An error is raised if the certificate_start_date is after
283 -- certificate_end_Date
284 --
285 -- Access Status:
286 -- Internal Development Use Only.
287 --
288 -- {End Of Comments}
289 -- ---------------------------------------------------------------------------
290 PROCEDURE chk_cert_start_end_dates
291 (p_certificate_start_date IN DATE
292 , p_certificate_end_date IN DATE
293 );
294 --
295 --
296 -- ---------------------------------------------------------------------------
297 -- |---------------------< chk_duplicate_record >-------------------------|
298 -- ---------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- check if PAYE record already exists for the assignment
303 --
304 -- Prerequisites:
305 --
306 -- In Arguments:
307 -- p_assignment_id
308 --
309 --
310 --
311 -- Post Success:
312 -- processing continues as no error is raised.
313 --
314 -- Post Failure:
315 -- An error is raised if PAYE record already exists for the assignment
316 --
317 -- Access Status:
318 -- Internal Development Use Only.
319 --
320 -- {End Of Comments}
321 -- ---------------------------------------------------------------------------
322 PROCEDURE chk_duplicate_record
323 ( p_assignment_id IN NUMBER
324 , p_validation_start_date IN DATE
325 , p_validation_end_date IN DATE --Bug 4154171 Added new parameter p_effective_date
326 );
327 --
328 --
329 -- ---------------------------------------------------------------------------
330 -- |---------------------< chk_tax_basis_amounts >-------------------------|
331 -- ---------------------------------------------------------------------------
332 -- {Start Of Comments}
333 --
334 -- Description:
335 -- check if amounts are valid for the given tax basis, for 'Emergency'
336 -- tax basis weekly and monthly tax credits ans std rate cut-off amounts must
337 -- be null and for other values of tax basis weekly or monthly amounts
338 -- (depending on payroll frequency) must be not null.
339 --
340 -- Prerequisites:
341 --
342 -- In Arguments:
343 -- p_effective_date
344 -- p_assignment_id
345 -- p_tax_basis
346 -- p_weekly_tax_credit
347 -- p_weekly_std_rate_cut_off
348 -- p_monthly_tax_credit
349 -- p_monthly_std_rate_cut_off
350 --
351 --
352 -- Post Success:
353 -- processing continues as no error is raised.
354 --
355 -- Post Failure:
356 -- An error is raised if amonts are not valid for the given tax basis and payroll
357 -- frequency
358 --
359 -- Access Status:
360 -- Internal Development Use Only.
361 --
362 -- {End Of Comments}
363 -- ---------------------------------------------------------------------------
364 PROCEDURE chk_tax_basis_amounts
365 (p_effective_date IN DATE
366 , p_assignment_id IN NUMBER
367 , p_tax_basis IN VARCHAR2
368 , p_weekly_tax_credit IN NUMBER
369 , p_weekly_std_rate_cut_off IN NUMBER
370 , p_monthly_tax_credit IN NUMBER
371 , p_monthly_std_rate_cut_off IN NUMBER
372 );
373 --
374 --
375 -- ----------------------------------------------------------------------------
376 -- |---------------------------< insert_validate >----------------------------|
377 -- ----------------------------------------------------------------------------
378 -- {Start Of Comments}
379 --
380 -- Description:
381 -- This procedure controls the execution of all insert business rules
382 -- validation.
383 --
384 -- Prerequisites:
385 -- This private procedure is called from ins procedure.
386 --
387 -- In Parameters:
388 -- A Pl/Sql record structre.
389 --
390 -- Post Success:
391 -- Processing continues.
392 --
393 -- Post Failure:
394 -- If a business rules fails the error will not be handled by this procedure
395 -- unless explicity coded.
396 --
397 -- Developer Implementation Notes:
398 -- For insert, your business rules should be executed from this procedure and
399 -- should ideally (unless really necessary) just be straight procedure or
400 -- function calls. Try and avoid using conditional branching logic.
401 --
402 -- Access Status:
403 -- Internal Row Handler Use Only.
404 --
405 -- {End Of Comments}
406 -- ----------------------------------------------------------------------------
407 Procedure insert_validate
408 (p_rec in pay_ipd_shd.g_rec_type
409 ,p_effective_date in date
410 ,p_datetrack_mode in varchar2
411 ,p_validation_start_date in date
412 ,p_validation_end_date in date
413 );
414 --
415 -- ----------------------------------------------------------------------------
416 -- |---------------------------< update_validate >----------------------------|
417 -- ----------------------------------------------------------------------------
418 -- {Start Of Comments}
419 --
420 -- Description:
421 -- This procedure controls the execution of all update business rules
422 -- validation.
423 --
424 -- Prerequisites:
425 -- This private procedure is called from upd procedure.
426 --
427 -- In Parameters:
428 -- A Pl/Sql record structre.
429 --
430 -- Post Success:
431 -- Processing continues.
432 --
433 -- Post Failure:
434 -- If a business rules fails the error will not be handled by this procedure
435 -- unless explicity coded.
436 --
437 -- Developer Implementation Notes:
438 -- For update, your business rules should be executed from this procedure and
439 -- should ideally (unless really necessary) just be straight procedure or
440 -- function calls. Try and avoid using conditional branching logic.
441 --
442 -- Access Status:
443 -- Internal Row Handler Use Only.
444 --
445 -- {End Of Comments}
446 -- ----------------------------------------------------------------------------
447 Procedure update_validate
451 ,p_validation_start_date in date
448 (p_rec in pay_ipd_shd.g_rec_type
449 ,p_effective_date in date
450 ,p_datetrack_mode in varchar2
452 ,p_validation_end_date in date
453 );
454 --
455 -- ----------------------------------------------------------------------------
456 -- |---------------------------< delete_validate >----------------------------|
457 -- ----------------------------------------------------------------------------
458 -- {Start Of Comments}
459 --
460 -- Description:
461 -- This procedure controls the execution of all delete business rules
462 -- validation.
463 --
464 -- Prerequisites:
465 -- This private procedure is called from del procedure.
466 --
467 -- In Parameters:
468 -- A Pl/Sql record structure.
469 --
470 -- Post Success:
471 -- Processing continues.
472 --
473 -- Post Failure:
474 -- If a business rules fails the error will not be handled by this procedure
475 -- unless explicity coded.
476 --
477 -- Developer Implementation Notes:
478 -- For delete, your business rules should be executed from this procedure and
479 -- should ideally (unless really necessary) just be straight procedure or
480 -- function calls. Try and avoid using conditional branching logic.
481 --
482 -- Access Status:
483 -- Internal Row Handler Use Only.
484 --
485 -- {End Of Comments}
486 -- ----------------------------------------------------------------------------
487 Procedure delete_validate
488 (p_rec in pay_ipd_shd.g_rec_type
489 ,p_effective_date in date
490 ,p_datetrack_mode in varchar2
491 ,p_validation_start_date in date
492 ,p_validation_end_date in date
493 );
494 --
495 end pay_ipd_bus;