[Home] [Help]
PACKAGE BODY: APPS.IRC_RSE_BUS
Source
1 Package Body irc_rse_bus as
2 /* $Header: irrserhi.pkb 120.0 2005/07/26 15:17:04 mbocutt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' irc_rse_bus.'; -- Global package name
9 --
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< chk_df >----------------------------------|
13 -- ----------------------------------------------------------------------------
14 --
15 -- Description:
16 -- Validates all the Descriptive Flexfield values.
17 --
18 -- Prerequisites:
19 -- All other columns have been validated. Must be called as the
20 -- last step from insert_validate and update_validate.
21 --
22 -- In Arguments:
23 -- p_rec
24 --
25 -- Post Success:
26 -- If the Descriptive Flexfield structure column and data values are
27 -- all valid this procedure will end normally and processing will
28 -- continue.
29 --
30 -- Post Failure:
31 -- If the Descriptive Flexfield structure column value or any of
32 -- the data values are invalid then an application error is raised as
33 -- a PL/SQL exception.
34 --
35 -- Access Status:
36 -- Internal Row Handler Use Only.
37 --
38 -- ----------------------------------------------------------------------------
39 procedure chk_df
40 (p_rec in irc_rse_shd.g_rec_type
41 ) is
42 --
43 l_proc varchar2(72) := g_package || 'chk_df';
44 --
45 begin
46 hr_utility.set_location('Entering:'||l_proc,10);
47 --
48 if ((p_rec.recruiting_site_id is not null) and (
49 nvl(irc_rse_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
50 nvl(p_rec.attribute_category, hr_api.g_varchar2) or
51 nvl(irc_rse_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
52 nvl(p_rec.attribute1, hr_api.g_varchar2) or
53 nvl(irc_rse_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
54 nvl(p_rec.attribute2, hr_api.g_varchar2) or
55 nvl(irc_rse_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
56 nvl(p_rec.attribute3, hr_api.g_varchar2) or
57 nvl(irc_rse_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
58 nvl(p_rec.attribute4, hr_api.g_varchar2) or
59 nvl(irc_rse_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
60 nvl(p_rec.attribute5, hr_api.g_varchar2) or
61 nvl(irc_rse_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
62 nvl(p_rec.attribute6, hr_api.g_varchar2) or
63 nvl(irc_rse_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
64 nvl(p_rec.attribute7, hr_api.g_varchar2) or
65 nvl(irc_rse_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
66 nvl(p_rec.attribute8, hr_api.g_varchar2) or
67 nvl(irc_rse_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
68 nvl(p_rec.attribute9, hr_api.g_varchar2) or
69 nvl(irc_rse_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
70 nvl(p_rec.attribute10, hr_api.g_varchar2) or
71 nvl(irc_rse_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
72 nvl(p_rec.attribute11, hr_api.g_varchar2) or
73 nvl(irc_rse_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
74 nvl(p_rec.attribute12, hr_api.g_varchar2) or
75 nvl(irc_rse_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
76 nvl(p_rec.attribute13, hr_api.g_varchar2) or
77 nvl(irc_rse_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
78 nvl(p_rec.attribute14, hr_api.g_varchar2) or
79 nvl(irc_rse_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
80 nvl(p_rec.attribute15, hr_api.g_varchar2) or
81 nvl(irc_rse_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
82 nvl(p_rec.attribute16, hr_api.g_varchar2) or
83 nvl(irc_rse_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
84 nvl(p_rec.attribute17, hr_api.g_varchar2) or
85 nvl(irc_rse_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
86 nvl(p_rec.attribute18, hr_api.g_varchar2) or
87 nvl(irc_rse_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
88 nvl(p_rec.attribute19, hr_api.g_varchar2) or
89 nvl(irc_rse_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
90 nvl(p_rec.attribute20, hr_api.g_varchar2) or
91 nvl(irc_rse_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
92 nvl(p_rec.attribute21, hr_api.g_varchar2) or
93 nvl(irc_rse_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
94 nvl(p_rec.attribute22, hr_api.g_varchar2) or
95 nvl(irc_rse_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
96 nvl(p_rec.attribute23, hr_api.g_varchar2) or
97 nvl(irc_rse_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
98 nvl(p_rec.attribute24, hr_api.g_varchar2) or
99 nvl(irc_rse_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
100 nvl(p_rec.attribute25, hr_api.g_varchar2) or
101 nvl(irc_rse_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
102 nvl(p_rec.attribute26, hr_api.g_varchar2) or
103 nvl(irc_rse_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
104 nvl(p_rec.attribute27, hr_api.g_varchar2) or
105 nvl(irc_rse_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
106 nvl(p_rec.attribute28, hr_api.g_varchar2) or
107 nvl(irc_rse_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
108 nvl(p_rec.attribute29, hr_api.g_varchar2) or
109 nvl(irc_rse_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
110 nvl(p_rec.attribute30, hr_api.g_varchar2) ))
111 or (p_rec.recruiting_site_id is null) then
112 --
113 hr_utility.set_location('Inside the ff stuff',20);
114 --
115 -- Only execute the validation if absolutely necessary:
116 -- a) During update, the structure column value or any
117 -- of the attribute values have actually changed.
118 -- b) During insert.
119 --
120 hr_dflex_utility.ins_or_upd_descflex_attribs
121 (p_appl_short_name => 'PER'
122 ,p_descflex_name => 'IRC_ALL_RECRUITING_SITES'
123 ,p_attribute_category => p_rec.attribute_category
124 ,p_attribute1_name => 'ATTRIBUTE1'
125 ,p_attribute1_value => p_rec.attribute1
126 ,p_attribute2_name => 'ATTRIBUTE2'
127 ,p_attribute2_value => p_rec.attribute2
128 ,p_attribute3_name => 'ATTRIBUTE3'
129 ,p_attribute3_value => p_rec.attribute3
130 ,p_attribute4_name => 'ATTRIBUTE4'
131 ,p_attribute4_value => p_rec.attribute4
132 ,p_attribute5_name => 'ATTRIBUTE5'
133 ,p_attribute5_value => p_rec.attribute5
134 ,p_attribute6_name => 'ATTRIBUTE6'
135 ,p_attribute6_value => p_rec.attribute6
136 ,p_attribute7_name => 'ATTRIBUTE7'
137 ,p_attribute7_value => p_rec.attribute7
138 ,p_attribute8_name => 'ATTRIBUTE8'
139 ,p_attribute8_value => p_rec.attribute8
140 ,p_attribute9_name => 'ATTRIBUTE9'
141 ,p_attribute9_value => p_rec.attribute9
142 ,p_attribute10_name => 'ATTRIBUTE10'
143 ,p_attribute10_value => p_rec.attribute10
144 ,p_attribute11_name => 'ATTRIBUTE11'
145 ,p_attribute11_value => p_rec.attribute11
146 ,p_attribute12_name => 'ATTRIBUTE12'
147 ,p_attribute12_value => p_rec.attribute12
148 ,p_attribute13_name => 'ATTRIBUTE13'
149 ,p_attribute13_value => p_rec.attribute13
150 ,p_attribute14_name => 'ATTRIBUTE14'
151 ,p_attribute14_value => p_rec.attribute14
152 ,p_attribute15_name => 'ATTRIBUTE15'
153 ,p_attribute15_value => p_rec.attribute15
154 ,p_attribute16_name => 'ATTRIBUTE16'
155 ,p_attribute16_value => p_rec.attribute16
156 ,p_attribute17_name => 'ATTRIBUTE17'
157 ,p_attribute17_value => p_rec.attribute17
158 ,p_attribute18_name => 'ATTRIBUTE18'
159 ,p_attribute18_value => p_rec.attribute18
160 ,p_attribute19_name => 'ATTRIBUTE19'
161 ,p_attribute19_value => p_rec.attribute19
162 ,p_attribute20_name => 'ATTRIBUTE20'
163 ,p_attribute20_value => p_rec.attribute20
164 ,p_attribute21_name => 'ATTRIBUTE21'
165 ,p_attribute21_value => p_rec.attribute21
166 ,p_attribute22_name => 'ATTRIBUTE22'
167 ,p_attribute22_value => p_rec.attribute22
168 ,p_attribute23_name => 'ATTRIBUTE23'
169 ,p_attribute23_value => p_rec.attribute23
170 ,p_attribute24_name => 'ATTRIBUTE24'
171 ,p_attribute24_value => p_rec.attribute24
172 ,p_attribute25_name => 'ATTRIBUTE25'
173 ,p_attribute25_value => p_rec.attribute25
174 ,p_attribute26_name => 'ATTRIBUTE26'
175 ,p_attribute26_value => p_rec.attribute26
176 ,p_attribute27_name => 'ATTRIBUTE27'
177 ,p_attribute27_value => p_rec.attribute27
178 ,p_attribute28_name => 'ATTRIBUTE28'
179 ,p_attribute28_value => p_rec.attribute28
180 ,p_attribute29_name => 'ATTRIBUTE29'
181 ,p_attribute29_value => p_rec.attribute29
182 ,p_attribute30_name => 'ATTRIBUTE30'
183 ,p_attribute30_value => p_rec.attribute30
184 );
185 end if;
186 --
187 hr_utility.set_location(' Leaving:'||l_proc,20);
188 end chk_df;
189 --
190 -- ----------------------------------------------------------------------------
191 -- |-----------------------< chk_non_updateable_args >------------------------|
192 -- ----------------------------------------------------------------------------
193 -- {Start Of Comments}
194 --
195 -- Description:
196 -- This procedure is used to ensure that non updateable attributes have
197 -- not been updated. If an attribute has been updated an error is generated.
198 --
199 -- Pre Conditions:
200 -- g_old_rec has been populated with details of the values currently in
201 -- the database.
202 --
203 -- In Arguments:
204 -- p_rec has been populated with the updated values the user would like the
205 -- record set to.
206 --
207 -- Post Success:
208 -- Processing continues if all the non updateable attributes have not
209 -- changed.
210 --
211 -- Post Failure:
212 -- An application error is raised if any of the non updatable attributes
213 -- have been altered.
214 --
215 -- {End Of Comments}
216 -- ----------------------------------------------------------------------------
217 Procedure chk_non_updateable_args
218 (p_effective_date in date
219 ,p_rec in irc_rse_shd.g_rec_type
220 ) IS
221 --
222 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
223 --
224 Begin
225 --
226 -- Only proceed with the validation if a row exists for the current
227 -- record in the HR Schema.
228 --
229 IF NOT irc_rse_shd.api_updating
230 (p_recruiting_site_id => p_rec.recruiting_site_id
231 ,p_object_version_number => p_rec.object_version_number
232 ) THEN
233 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
234 fnd_message.set_token('PROCEDURE ', l_proc);
235 fnd_message.set_token('STEP ', '5');
236 fnd_message.raise_error;
237 END IF;
238 --
239 End chk_non_updateable_args;
240 --
241 -- ----------------------------------------------------------------------------
242 -- |--------------------------------< chk_internal >--------------------------|
243 -- ----------------------------------------------------------------------------
244 -- {Start Of Comments}
245 --
246 -- Description:
247 -- This procedure ensures that INTERNAL has a value of 'Y' or 'N'.
248 --
249 -- Pre Conditions:
250 -- g_old_rec has been populated with details of the values currently in
251 -- the database.
252 --
253 -- In Arguments:
254 -- p_internal
255 -- p_recruiting_site_id
256 -- p_object_version_number
257 --
258 -- Post Success:
259 -- Processing continues if INTERNAL is valid.
260 --
261 -- Post Failure:
262 -- An application error is raised external is invalid.
263 --
264 -- {End Of Comments}
265 -- ----------------------------------------------------------------------------
266 Procedure chk_internal
267 (p_internal in irc_all_recruiting_sites.internal%TYPE
268 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
269 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
270 ) IS
271 --
272 l_proc varchar2(72) := g_package || 'chk_internal';
273 l_api_updating boolean;
274 --
275 begin
276 hr_utility.set_location('Entering:'||l_proc,10);
277 l_api_updating := irc_rse_shd.api_updating
278 (p_recruiting_site_id => p_recruiting_site_id
279 ,p_object_version_number => p_object_version_number
280 );
281 --
282 hr_utility.set_location(l_proc,20);
283 if (l_api_updating and
284 p_internal <>
285 NVL(irc_rse_shd.g_old_rec.internal,hr_api.g_varchar2)
286 ) or (NOT l_api_updating) then
287 -- Check that internal has a valid value of either 'Y' or 'N'
288 hr_utility.set_location(l_proc,30);
289 if not p_internal in ('Y','N') then
290 hr_utility.set_location(l_proc,40);
291 fnd_message.set_name('PER','IRC_412093_BAD_INTERNAL');
292 fnd_message.raise_error;
293 end if;
294 end if;
295 hr_utility.set_location(' Leaving:'||l_proc,50);
296 exception
297 when app_exception.application_exception then
298 if hr_multi_message.exception_add
299 (p_associated_column1 =>
300 'IRC_ALL_RECRUITING_SITES.INTERNAL'
301 ) then
302 hr_utility.set_location(' Leaving:'||l_proc,60);
303 raise;
304 end if;
305 hr_utility.set_location(' Leaving:'||l_proc,70);
306 end chk_internal;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |--------------------------------< chk_external >--------------------------|
310 -- ----------------------------------------------------------------------------
311 -- {Start Of Comments}
312 --
313 -- Description:
314 -- This procedure ensures that EXTERNAL has a value of 'Y' or 'N'.
315 --
316 -- Pre Conditions:
317 -- g_old_rec has been populated with details of the values currently in
318 -- the database.
319 --
320 -- In Arguments:
321 -- p_external
322 -- p_recruiting_site_id
323 -- p_object_version_number
324 --
325 -- Post Success:
326 -- Processing continues if EXTERNAL is valid.
327 --
328 -- Post Failure:
329 -- An application error is raised if EXTERNAL is invalid.
330 --
331 -- {End Of Comments}
332 -- ----------------------------------------------------------------------------
333 Procedure chk_external
334 (p_external in irc_all_recruiting_sites.external%TYPE
335 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
336 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
337 ) IS
338 --
342 begin
339 l_proc varchar2(72) := g_package || 'chk_external';
340 l_api_updating boolean;
341 --
343 hr_utility.set_location('Entering:'||l_proc,10);
344 l_api_updating := irc_rse_shd.api_updating
345 (p_recruiting_site_id => p_recruiting_site_id
346 ,p_object_version_number => p_object_version_number
347 );
348 --
349 hr_utility.set_location(l_proc,20);
350 if (l_api_updating and
351 p_external <>
352 NVL(irc_rse_shd.g_old_rec.external,hr_api.g_varchar2)
353 ) or (NOT l_api_updating) then
354 -- Check that external has a valid value of either 'Y' or 'N'
355 hr_utility.set_location(l_proc,30);
356 if not p_external in ('Y','N') then
357 hr_utility.set_location(l_proc,40);
358 fnd_message.set_name('PER','IRC_412094_BAD_EXTERNAL');
359 fnd_message.raise_error;
360 end if;
361 end if;
362 hr_utility.set_location(' Leaving:'||l_proc,50);
363 exception
364 when app_exception.application_exception then
365 if hr_multi_message.exception_add
366 (p_associated_column1 =>
367 'IRC_ALL_RECRUITING_SITES.EXTERNAL'
368 ) then
369 hr_utility.set_location(' Leaving:'||l_proc,60);
370 raise;
371 end if;
372 hr_utility.set_location(' Leaving:'||l_proc,70);
373 end chk_external;
374 --
375 -- ----------------------------------------------------------------------------
376 -- |-----------------------------< chk_third_party >--------------------------|
377 -- ----------------------------------------------------------------------------
378 -- {Start Of Comments}
379 --
380 -- Description:
381 -- This procedure ensures that THIRD_PARTY has a value of 'Y' or 'N'.
382 --
383 -- Pre Conditions:
384 -- g_old_rec has been populated with details of the values currently in
385 -- the database.
386 --
387 -- In Arguments:
388 -- p_third_party
389 -- p_recruiting_site_id
390 -- p_object_version_number
391 --
392 -- Post Success:
393 -- Processing continues if THIRD_PARTY is valid.
394 --
395 -- Post Failure:
396 -- An application error is raised third_party is invalid.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure chk_third_party
401 (p_third_party in irc_all_recruiting_sites.third_party%TYPE
402 ,p_internal in irc_all_recruiting_sites.internal%TYPE
403 ,p_external in irc_all_recruiting_sites.external%TYPE
404 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
405 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
406 ) IS
407 --
408 l_proc varchar2(72) := g_package || 'chk_third_party';
409 l_api_updating boolean;
410 --
411 begin
412 hr_utility.set_location('Entering:'||l_proc,10);
413 l_api_updating := irc_rse_shd.api_updating
414 (p_recruiting_site_id => p_recruiting_site_id
415 ,p_object_version_number => p_object_version_number
416 );
417 --
418 hr_utility.set_location(l_proc,20);
419 if (l_api_updating and
420 p_third_party <>
421 NVL(irc_rse_shd.g_old_rec.third_party,hr_api.g_varchar2)
422 ) or (NOT l_api_updating) then
423 -- Check that third_party has a valid value of either 'Y' or 'N'
424 hr_utility.set_location(l_proc,30);
425 if not p_third_party in ('Y','N') then
426 hr_utility.set_location(l_proc,40);
427 fnd_message.set_name('PER','IRC_412095_BAD_THIRD_PARTY');
428 fnd_message.raise_error;
429 end if;
430 if((p_internal = 'Y' or p_external = 'Y')
431 AND
432 (p_third_party = 'Y')
433 ) then
434 hr_utility.set_location(l_proc,45);
435 fnd_message.set_name('PER','IRC_412095_BAD_THIRD_PARTY');
436 fnd_message.raise_error;
437 end if;
438 end if;
439 hr_utility.set_location(' Leaving:'||l_proc,50);
440 exception
441 when app_exception.application_exception then
442 if hr_multi_message.exception_add
443 (p_associated_column1 =>
444 'IRC_ALL_RECRUITING_SITES.THIRD_PARTY'
445 ) then
446 hr_utility.set_location(' Leaving:'||l_proc,60);
447 raise;
448 end if;
449 hr_utility.set_location(' Leaving:'||l_proc,70);
450 end chk_third_party;
451 --
452 -- ----------------------------------------------------------------------------
453 -- |------------------< chk_posting_cost_period >----------------------------|
454 -- ----------------------------------------------------------------------------
455 -- {Start Of Comments}
456 --
457 -- Description:
458 -- Checks that the value passed in for posting_cost_period is contained
459 -- as a lookup in IRC_POSTING_COST_FREQ
460 --
461 -- Pre Conditions:
462 -- g_old_rec has been populated with details of the values currently in
463 -- the database.
464 --
465 -- In Arguments:
466 -- p_posting_cost_period
467 -- p_effective_date
468 -- p_recruiting_site_id
469 -- p_object_version_number
470 --
471 -- Post Success:
472 -- Processing continues if posting_cost_period is valid.
476 --
473 --
474 -- Post Failure:
475 -- An application error is raised if posting_cost_period is invalid.
477 -- {End Of Comments}
478 Procedure chk_posting_cost_period
479 (
480 p_posting_cost_period in irc_all_recruiting_sites.posting_cost_period%TYPE
481 ,p_effective_date in date
482 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
483 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
484 )
485 is
486 --
487 l_proc varchar2(72):=g_package||'chk_posting_cost_period';
488 l_api_updating boolean;
489 --
490 begin
491 hr_utility.set_location('Entering:'|| l_proc, 1);
492 --
493 -- Check mandatory parameters have been set
494 --
495 hr_api.mandatory_arg_error
496 (p_api_name => l_proc
497 ,p_argument => 'effective_date'
498 ,p_argument_value => p_effective_date
499 );
500 --
501 -- Only proceed with the validation if :
502 -- a) The current g_old_rec is current
503 -- b) The value has changed.
504 -- c) A record is being inserted
505 --
506 l_api_updating := irc_rse_shd.api_updating
507 (p_recruiting_site_id => p_recruiting_site_id
508 ,p_object_version_number => p_object_version_number
509 );
510 --
511 if ((l_api_updating and nvl(irc_rse_shd.g_old_rec.posting_cost_period,
512 hr_api.g_varchar2)
513 <> nvl(p_posting_cost_period, hr_api.g_varchar2)
514 or p_posting_cost_period is not null)
515 or
516 (NOT l_api_updating and
517 p_posting_cost_period is not null)) then
518 --
519 hr_utility.set_location(l_proc, 2);
520 --
521 -- Check the value in p_posting_cost_period exists in hr_lookups
522 --
523 if hr_api.not_exists_in_hr_lookups
524 (p_effective_date => p_effective_date
525 ,p_lookup_type => 'IRC_POSTING_COST_FREQ'
526 ,p_lookup_code => p_posting_cost_period
527 ) then
528 hr_utility.set_location(l_proc, 10);
529 hr_utility.set_location(p_posting_cost_period, 10);
530 hr_utility.set_location(to_char(p_effective_date,'DD/MM/YYYY'), 10);
531 hr_utility.set_message(800,'IRC_412103_BAD_LOOKUP_PERIOD');
532 hr_utility.raise_error;
533 end if;
534 --
535 hr_utility.set_location(' Leaving:'|| l_proc, 15);
536 end if;
537 exception
538 when app_exception.application_exception then
539 if hr_multi_message.exception_add
540 (p_associated_column1 =>
541 'IRC_ALL_RECRUITING_SITES.POSTING_COST_PERIOD'
542 ) then
543 hr_utility.set_location(' Leaving:'||l_proc,80);
544 raise;
545 end if;
546 hr_utility.set_location(' Leaving exception handler:'||l_proc,90);
547 end chk_posting_cost_period;
548 --
549 -- ----------------------------------------------------------------------------
550 -- |-------------------------< chk_posting_cost >----------------------------|
551 -- ----------------------------------------------------------------------------
552 -- {Start Of Comments}
553 --
554 -- Description:
555 -- Check that if any of the following fields are entered, all of them must be
556 -- present: Posting Cost; Posting Cost Period; Currency
557 --
558 --
559 -- Pre Conditions:
560 -- g_old_rec has been populated with details of the values currently in
561 -- the database.
562 --
563 -- In Arguments:
564 -- p_posting_cost
565 -- p_posting_cost_period
566 -- p_posting_cost_currency
567 -- p_effective_date
568 -- p_recruiting_site_id
569 -- p_object_version_number
570 --
571 -- Post Success:
572 -- Processing continues if all are present or none are present
573 --
574 -- Post Failure:
575 -- An application error is raised.
576 --
577 -- {End Of Comments}
578 Procedure chk_posting_cost
579 (
580 p_posting_cost in irc_all_recruiting_sites.posting_cost%TYPE
581 ,p_posting_cost_period in irc_all_recruiting_sites.posting_cost_period%TYPE
582 ,p_posting_cost_currency in irc_all_recruiting_sites.posting_cost_currency%TYPE
583 ,p_effective_date in date
584 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
585 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
586 )
587 is
588 --
589 l_proc varchar2(72):=g_package||'chk_posting_cost';
590 l_api_updating boolean;
591 --
592 l_posting_cost irc_all_recruiting_sites.posting_cost%TYPE;
593 l_posting_cost_period irc_all_recruiting_sites.posting_cost_period%TYPE;
594 l_posting_cost_currency irc_all_recruiting_sites.posting_cost_currency%TYPE;
595 begin
596 hr_utility.set_location('Entering:'|| l_proc, 1);
597 --
598 -- Check mandatory parameters have been set
599 --
600 hr_api.mandatory_arg_error
601 (p_api_name => l_proc
602 ,p_argument => 'effective_date'
603 ,p_argument_value => p_effective_date
604 );
605 --
606 hr_utility.set_location(l_proc, 2);
607 -- Only proceed with the validation if :
608 -- a) The current g_old_rec is current
609 -- b) The value has changed.
613 (p_recruiting_site_id => p_recruiting_site_id
610 -- c) A record is being inserted
611 --
612 l_api_updating := irc_rse_shd.api_updating
614 ,p_object_version_number => p_object_version_number
615 );
616 --
617 hr_utility.set_location(l_proc, 3);
618 if ((l_api_updating and (nvl(irc_rse_shd.g_old_rec.posting_cost,
619 hr_api.g_number)
620 <> nvl(p_posting_cost , hr_api.g_number)
621 or nvl(irc_rse_shd.g_old_rec.posting_cost_period,
622 hr_api.g_varchar2)
623 <> nvl(p_posting_cost_period, hr_api.g_varchar2)
624 or nvl(irc_rse_shd.g_old_rec.posting_cost_currency,
625 hr_api.g_varchar2)
626 <> nvl(p_posting_cost_currency, hr_api.g_varchar2)
627 )
628 )
629 or
630 (NOT l_api_updating)) then
631 hr_utility.set_location(l_proc, 4);
632 --
633 -- Now, we know we're either inserting or updating one of the three
634 -- values has changed.
635 --
636 if ((l_api_updating and p_posting_cost <> hr_api.g_number)
637 or p_posting_cost is null
638 or not l_api_updating) then
639 hr_utility.set_location(l_proc, 10);
640 l_posting_cost := p_posting_cost;
641 else
642 hr_utility.set_location(l_proc, 20);
643 l_posting_cost := irc_rse_shd.g_old_rec.posting_cost;
644 end if;
645 --
646 if ((l_api_updating and p_posting_cost_period <> hr_api.g_varchar2)
647 or p_posting_cost_period is null
648 or not l_api_updating) then
649 hr_utility.set_location(l_proc, 30);
650 l_posting_cost_period := p_posting_cost_period;
651 else
652 hr_utility.set_location(l_proc, 40);
653 l_posting_cost_period := irc_rse_shd.g_old_rec.posting_cost_period;
654 end if;
655 --
656 hr_utility.set_location('posting_cost_currency:'||p_posting_cost_currency, 10);
657 hr_utility.set_location('hr_api.g_varchar2:'||hr_api.g_varchar2, 10);
658 if ((l_api_updating and p_posting_cost_currency <> hr_api.g_varchar2)
659 or p_posting_cost_currency is null
660 or not l_api_updating) then
661 hr_utility.set_location(l_proc, 50);
662 l_posting_cost_currency := p_posting_cost_currency;
663 else
664 hr_utility.set_location(l_proc, 60);
665 l_posting_cost_currency := irc_rse_shd.g_old_rec.posting_cost_currency;
666 end if;
667 --
668 if ( l_posting_cost_currency
669 || l_posting_cost
670 || l_posting_cost_period is not null
671 and ( l_posting_cost_currency is null
672 or l_posting_cost is null
673 or l_posting_cost_period is null)
674 ) then
675 --
676 hr_utility.set_location(l_proc,70);
677 fnd_message.set_name('PER','IRC_412104_BAD_CURRENCY_COMBO');
678 fnd_message.raise_error;
679 end if;
680 --
681 end if;
682 hr_utility.set_location(' Leaving:'|| l_proc, 80);
683 exception
684 when app_exception.application_exception then
685 hr_utility.set_location('exception handler'||l_proc, 90);
686 if hr_multi_message.exception_add
687 (p_associated_column1 =>
688 'IRC_ALL_RECRUITING_SITES.POSTING_COST'
689 ,p_associated_column2 =>
690 'IRC_ALL_RECRUITING_SITES.POSTING_COST_PERIOD'
691 ,p_associated_column3 =>
692 'IRC_ALL_RECRUITING_SITES.POSTING_COST_CURRENCY'
693 ) then
694 hr_utility.set_location(' Leaving:'||l_proc,90);
695 raise;
696 end if;
697 hr_utility.set_location(' Leaving exception handler:'||l_proc,100);
698 end chk_posting_cost;
699 --
700 -- ----------------------------------------------------------------------------
701 -- |-----------------------------< chk_date_from_to>-------------------------|
702 -- ----------------------------------------------------------------------------
703 --
704 -- Description
705 -- Validate the date_from and date_to fields to make sure
706 -- 1) The date_to in on or after the date_from date
707 -- The date_from and the date_to can both (or either) be null.
708 --
709 -- Pre-conditions
710 -- None
711 --
712 -- In Arguments:
713 -- p_date_from
714 -- p_date_to
715 -- p_recruiting_site_id
716 -- p_object_version_number
717 --
718 -- Post Success:
719 -- If all test pass, processing continues.
720 -- Post Failure:
721 -- If the date_from is after the date_to, processing halts.
722 -- Access Status:
723 -- Internal Table Handler Use Only.
724 --
725 Procedure chk_date_from_to
726 (p_date_from in irc_all_recruiting_sites.date_from%TYPE
727 ,p_date_to in irc_all_recruiting_sites.date_to%TYPE
728 ,p_recruiting_site_id in irc_all_recruiting_sites.recruiting_site_id%TYPE
729 ,p_object_version_number in irc_all_recruiting_sites.object_version_number%TYPE
730 )
731 is
732 --
733 l_proc varchar2(72):=g_package||'chk_date_from_to';
734 l_api_updating boolean;
735 --
736 begin
740 -- Only proceed with the validation if :
737 hr_utility.set_location('Entering:'|| l_proc, 1);
738 --
739 --
741 -- a) The current g_old_rec is current.
742 -- b) The date_from has changed.
743 -- c) The date_to has changed.
744 -- d) a record is being inserted.
745 --
746 l_api_updating := irc_rse_shd.api_updating
747 (p_recruiting_site_id => p_recruiting_site_id
748 ,p_object_version_number => p_object_version_number
749 );
750 --
751 if (((l_api_updating and nvl(irc_rse_shd.g_old_rec.date_from,
752 hr_api.g_date)
753 <> nvl(p_date_from, hr_api.g_date))
754 or
755 (l_api_updating and nvl(irc_rse_shd.g_old_rec.date_to,
756 hr_api.g_date)
757 <> nvl(p_date_to, hr_api.g_date))
758 )
759 or
760 (NOT l_api_updating)) then
761 --
762 -- If the date_from is greater then the date_to, raise an error
763 --
764 if ((p_date_from is not null) and (p_date_to is not null)
765 and (p_date_from > p_date_to)) then
766 --
767 hr_utility.set_message(800,'IRC_412107_RSE_DATE_FR_DATE_T0');
768 hr_utility.raise_error;
769 --
770 end if;
771 --
772 end if;
773 --
774 hr_utility.set_location(' Leaving:'|| l_proc, 15);
775 --
776 exception
777 when app_exception.application_exception then
778 if hr_multi_message.exception_add
779 (p_associated_column1 =>
780 'IRC_ALL_RECRUITING_SITES.DATE_FROM'
781 ,p_associated_column2 =>
782 'IRC_ALL_RECRUITING_SITES.DATE_TO'
783 ) then
784 hr_utility.set_location(' Leaving:'||l_proc,80);
785 raise;
786 end if;
787 hr_utility.set_location(' Leaving exception handler:'||l_proc,90);
788 end chk_date_from_to;
789 --
790 --
791 -- ----------------------------------------------------------------------------
792 -- |---------------------------< insert_validate >----------------------------|
793 -- ----------------------------------------------------------------------------
794 Procedure insert_validate
795 (p_effective_date in date
796 ,p_rec in irc_rse_shd.g_rec_type
797 ) is
798 --
799 l_proc varchar2(72) := g_package||'insert_validate';
800 --
801 Begin
802 hr_utility.set_location('Entering:'||l_proc, 5);
803 --
804 -- Call all supporting business operations
805 --
806 --
807 -- No business group context. HR_STANDARD_LOOKUPS used for validation."
808 --
809 -- Validate Dependent Attributes
810 chk_internal
811 ( p_internal => p_rec.internal
812 , p_recruiting_site_id => p_rec.recruiting_site_id
813 , p_object_version_number => p_rec.object_version_number
814 );
815 --
816 chk_external
817 ( p_external => p_rec.external
818 , p_recruiting_site_id => p_rec.recruiting_site_id
819 , p_object_version_number => p_rec.object_version_number
820 );
821 --
822 chk_third_party
823 (p_third_party => p_rec.third_party
824 ,p_internal => p_rec.internal
825 ,p_external => p_rec.external
826 ,p_recruiting_site_id => p_rec.recruiting_site_id
827 ,p_object_version_number => p_rec.object_version_number
828 );
829 --
830 chk_posting_cost_period
831 ( p_posting_cost_period => p_rec.posting_cost_period
832 , p_effective_date => p_effective_date
833 , p_recruiting_site_id => p_rec.recruiting_site_id
834 , p_object_version_number => p_rec.object_version_number
835 );
836 --
837 chk_posting_cost
838 ( p_posting_cost => p_rec.posting_cost
839 , p_posting_cost_period => p_rec.posting_cost_period
840 , p_posting_cost_currency => p_rec.posting_cost_currency
841 , p_effective_date => p_effective_date
842 , p_recruiting_site_id => p_rec.recruiting_site_id
843 , p_object_version_number => p_rec.object_version_number
844 );
845 --
846 chk_date_from_to
847 ( p_date_from => p_rec.date_from
848 , p_date_to => p_rec.date_to
849 , p_recruiting_site_id => p_rec.recruiting_site_id
850 , p_object_version_number => p_rec.object_version_number
851 );
852 --
853 irc_rse_bus.chk_df(p_rec);
854 --
855 hr_utility.set_location(' Leaving:'||l_proc, 10);
856 End insert_validate;
857 --
858 -- ----------------------------------------------------------------------------
859 -- |---------------------------< update_validate >----------------------------|
860 -- ----------------------------------------------------------------------------
861 Procedure update_validate
862 (p_effective_date in date
863 ,p_rec in irc_rse_shd.g_rec_type
864 ) is
865 --
866 l_proc varchar2(72) := g_package||'update_validate';
867 --
868 Begin
869 hr_utility.set_location('Entering:'||l_proc, 5);
870 --
871 -- Call all supporting business operations
872 --
873 --
874 -- No business group context. HR_STANDARD_LOOKUPS used for validation."
875 --
876 -- Validate Dependent Attributes
877 --
878 chk_non_updateable_args
879 (p_effective_date => p_effective_date
883 ( p_internal => p_rec.internal
880 ,p_rec => p_rec
881 );
882 chk_internal
884 , p_recruiting_site_id => p_rec.recruiting_site_id
885 , p_object_version_number => p_rec.object_version_number
886 );
887 --
888 chk_external
889 ( p_external => p_rec.external
890 , p_recruiting_site_id => p_rec.recruiting_site_id
891 , p_object_version_number => p_rec.object_version_number
892 );
893 --
894 chk_third_party
895 (p_third_party => p_rec.third_party
896 ,p_internal => p_rec.internal
897 ,p_external => p_rec.external
898 ,p_recruiting_site_id => p_rec.recruiting_site_id
899 ,p_object_version_number => p_rec.object_version_number
900 );
901 --
902 chk_posting_cost_period
903 ( p_posting_cost_period => p_rec.posting_cost_period
904 , p_effective_date => p_effective_date
905 , p_recruiting_site_id => p_rec.recruiting_site_id
906 , p_object_version_number => p_rec.object_version_number
907 );
908 --
909 chk_posting_cost
910 ( p_posting_cost => p_rec.posting_cost
911 , p_posting_cost_period => p_rec.posting_cost_period
912 , p_posting_cost_currency => p_rec.posting_cost_currency
913 , p_effective_date => p_effective_date
914 , p_recruiting_site_id => p_rec.recruiting_site_id
915 , p_object_version_number => p_rec.object_version_number
916 );
917 --
918 chk_date_from_to
919 ( p_date_from => p_rec.date_from
920 , p_date_to => p_rec.date_to
921 , p_recruiting_site_id => p_rec.recruiting_site_id
922 , p_object_version_number => p_rec.object_version_number
923 );
924 --
925 irc_rse_bus.chk_df(p_rec);
926 --
927 hr_utility.set_location(' Leaving:'||l_proc, 10);
928 End update_validate;
929 --
930 -- ----------------------------------------------------------------------------
931 -- |---------------------------< delete_validate >----------------------------|
932 -- ----------------------------------------------------------------------------
933 Procedure delete_validate
934 (p_rec in irc_rse_shd.g_rec_type
935 ) is
936 --
937 l_proc varchar2(72) := g_package||'delete_validate';
938 --
939 Begin
940 hr_utility.set_location('Entering:'||l_proc, 5);
941 --
942 -- Call all supporting business operations
943 --
944 hr_utility.set_location(' Leaving:'||l_proc, 10);
945 End delete_validate;
946 --
947 end irc_rse_bus;