[Home] [Help]
PACKAGE: APPS.OTA_TPS_BUS1
Source
1 PACKAGE OTA_TPS_BUS1 AUTHID CURRENT_USER AS
2 /* $Header: ottpsrhi.pkh 120.0 2005/05/29 07:50:07 appldev noship $ */
3 -- ----------------------------------------------------------------------------
4 -- |---------------------------------< chk_unique >----------------------------------|
5 -- ----------------------------------------------------------------------------
6 -- {Start Of Comments}
7 --
8 -- Description:
9 -- This procedure enforces the rules :
10 -- The combination of time_period_id, organization_id, person_id is unique
11 --
12 -- Prerequisites:
13 --
14 -- In Parameters:
15 --
16 -- p_training_plan_id
17 -- p_object_version_number
18 -- p_organization_id
19 -- p_person_id
20 -- p_time_period_id
21
22 -- Post Success:
23 -- Processing continues
24 --
25 -- Post Failure:
26 -- If an existing combination is found, an error message will be raised.
27 --
28 -- Developer Implementation Notes:
29 -- None.
30 --
31 -- Access Status:
32 -- Internal Development Use Only.
33 --
34 -- {End Of Comments}
35 -- ----------------------------------------------------------------------------
36 PROCEDURE chk_unique
37 (p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
38 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE
39 ,p_organization_id IN ota_training_plans.organization_id%TYPE
40 ,p_person_id IN ota_training_plans.person_id%TYPE
41 ,p_time_period_id IN ota_training_plans.time_period_id%TYPE
42 ) ;
43 -- ----------------------------------------------------------------------------
44 -- |---------------------------------< chk_org_person >----------------------------------|
45 -- ----------------------------------------------------------------------------
46 -- {Start Of Comments}
47 --
48 -- Description:
49 -- This procedure enforces the rules :
50 -- The person_id and Organization_id cannot both be null or both be set
51 --
52 -- Prerequisites:
53 --
54 -- In Parameters:
55 --
56 -- p_organization_id
57 -- p_person_id
58 --
59 -- Post Success:
60 -- Processing continues
61 --
62 -- Post Failure:
63 -- If the parameters are set incorrectly, an error message will be raised.
64 --
65 -- Developer Implementation Notes:
66 -- Call for Insert checking only.
67 --
68 -- Access Status:
69 -- Internal Row Handler Use Only.
70 --
71 -- {End Of Comments}
72 -- ----------------------------------------------------------------------------
73 PROCEDURE chk_org_person
74 (p_organization_id IN ota_training_plans.organization_id%TYPE
75 ,p_person_id IN ota_training_plans.person_id%TYPE
76 ,p_contact_id IN ota_training_plans.contact_id%TYPE
77 ) ;
78 -- ----------------------------------------------------------------------------
79 -- |---------------------------------< chk_organization_id >----------------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This procedure enforces the rules :
85 -- The organization_id must exist and be in the same business group
86 -- as the training plan.
87 --
88 -- Prerequisites:
89 --
90 -- In Parameters:
91 --
92 -- p_organization_id
93 -- p_business_group_id
94 --
95 -- Post Success:
96 -- Processing continues
97 --
98 -- Post Failure:
99 -- If an error has occurred, an error message will be raised.
100 --
101 -- Developer Implementation Notes:
102 -- Call for insert checking only.
103 --
104 -- Access Status:
105 -- Internal Row Handler Use Only.
106 --
107 -- {End Of Comments}
108 -- ----------------------------------------------------------------------------
109 PROCEDURE chk_organization_id
110 (p_organization_id IN ota_training_plans.organization_id%TYPE
111 ,p_business_group_id IN ota_training_plans.business_group_id%TYPE
112 );
113 -- ----------------------------------------------------------------------------
114 -- |---------------------------------< chk_person_id >----------------------------------|
115 -- ----------------------------------------------------------------------------
116 -- {Start Of Comments}
117 --
118 -- Description:
119 -- This procedure enforces the rules :
120 -- The person_id must exist and be in the same business group
121 -- as the training plan.
122 --
123 -- Prerequisites:
124 --
125 -- In Parameters:
126 --
127 -- p_effective_date
128 -- p_person_id
129 -- p_business_group_id
130 --
131 -- Post Success:
132 -- Processing continues
133 --
134 -- Post Failure:
135 -- If an error has occurred, an error message will be raised.
136 --
137 -- Developer Implementation Notes:
138 -- Call for insert checking only.
139 --
140 -- Access Status:
141 -- Internal Row Handler Use Only.
142 --
143 -- {End Of Comments}
144 -- ----------------------------------------------------------------------------
145 PROCEDURE chk_person_id
146 (p_effective_date IN date
147 ,p_person_id IN ota_training_plans.person_id%TYPE
148 ,p_business_group_id IN ota_training_plans.business_group_id%TYPE
149 ) ;
150 -- ----------------------------------------------------------------------------
151 -- |---------------------------------< chk_plan_status_type_id >----------------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 -- This procedure enforces the rules :
157 -- The plan_status_type_id must exist in hr_lookups under the correct lookup type.
158 -- as the training plan.
159 --
160 -- Prerequisites:
161 --
162 -- In Parameters:
163 --
164 -- p_effective_date
165 -- p_plan_status_type_id
166 --
167 -- Post Success:
168 -- Processing continues
169 --
170 -- Post Failure:
171 -- If an error has occurred, an error message will be raised.
172 --
173 -- Developer Implementation Notes:
174 -- None.
175 --
176 -- Access Status:
177 -- Internal Row Handler Use Only.
178 --
179 -- {End Of Comments}
180 -- ----------------------------------------------------------------------------
181 PROCEDURE chk_plan_status_type_id
182 (p_effective_date IN date
183 ,p_plan_status_type_id IN ota_training_plans.plan_status_type_id%TYPE
184 ) ;
185 -- ----------------------------------------------------------------------------
186 -- |---------------------------------< chk_time_period_id >----------------------------------|
187 -- ----------------------------------------------------------------------------
188 -- {Start Of Comments}
189 --
190 -- Description:
191 -- This procedure enforces the rules :
192 -- The time period cannot change if the plan has members.
193 -- The time period must exist in per_time_periods
194 --
195 -- Prerequisites:
196 --
197 -- In Parameters:
198 --
199 -- p_training_plan_id
200 -- p_object_version_number
201 -- p_time_period_id
202 -- p_business_group_id
203 --
204 -- Post Success:
205 -- Processing continues
206 --
207 -- Post Failure:
208 -- If an error has occurred, an error message will be raised.
209 --
210 -- Developer Implementation Notes:
211 -- None.
212 --
213 -- Access Status:
214 -- Internal Development Use Only.
215 --
216 -- {End Of Comments}
217 -- ----------------------------------------------------------------------------
218 PROCEDURE chk_time_period_id
219 (p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
220 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE
221 ,p_time_period_id IN ota_training_plans.time_period_id%TYPE
222 ,p_business_group_id IN ota_training_plans.business_group_id%TYPE
223 ) ;
224 -- ----------------------------------------------------------------------------
225 -- |---------------------------------< chk_period_overlap >----------------------------------|
226 -- ----------------------------------------------------------------------------
227 -- {Start Of Comments}
228 --
229 -- Description:
230 -- This procedure enforces the rules :
231 -- No two training plans for the same organization or person can exist
232 -- if they both have a status other than CANCELLED.
233 --
234 -- Prerequisites:
235 --
236 -- In Parameters:
237 --
238 -- p_training_plan_id
239 -- p_object_version_number
240 -- p_plan_status_type_id
241 -- p_time_period_id
242 -- p_person_id
243 -- p_organization_id
244 --
245 -- Post Success:
246 -- Processing continues
247 --
248 -- Post Failure:
249 -- If an error has occurred, an error message will be raised.
250 --
251 -- Developer Implementation Notes:
252 -- None.
253 --
254 -- Access Status:
255 -- Internal Development Use Only.
256 --
257 -- ----------------------------------------------------------------------------
258 PROCEDURE chk_period_overlap
259 (p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
260 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE
261 ,p_plan_status_type_id IN ota_training_plans.plan_status_type_id%TYPE
262 ,p_time_period_id IN ota_training_plans.time_period_id%TYPE
263 ,p_person_id IN ota_training_plans.person_id%TYPE
264 ,p_organization_id IN ota_training_plans.organization_id%TYPE
265 );
266 -- ----------------------------------------------------------------------------
267 -- |---------------------------------< chk_currency_code >----------------------------------|
268 -- ----------------------------------------------------------------------------
269 -- {Start Of Comments}
270 --
271 -- Description:
272 -- This procedure enforces the rules :
273 -- The currency code must exist in FND_CURRENCIES
274 --
275 -- Prerequisites:
276 --
277 -- In Parameters:
278 --
279 -- p_budget_currency
280 -- p_training_plan_id
281 -- p_business_group_id
282 -- p_object_version_number
283 --
284 -- Post Success:
285 -- Processing continues
286 --
287 -- Post Failure:
288 -- If an error has occurred, an error message will be raised.
289 --
290 -- Developer Implementation Notes:
291 -- None.
292 --
293 -- Access Status:
294 -- Internal Development Use Only.
295 --
296 -- {End Of Comments}
297 -- ----------------------------------------------------------------------------
298 PROCEDURE chk_currency_code
299 ( p_budget_currency IN ota_training_plans.budget_currency%TYPE
300 ,p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
301 ,p_business_group_id IN ota_training_plans.business_group_id%TYPE
302 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE
303 );
304 -- ----------------------------------------------------------------------------
305 -- |---------------------------------< chk_name >-----------------------------|
306 -- ----------------------------------------------------------------------------
307 -- {Start Of Comments}
308 --
309 -- Description:
310 -- This procedure enforces the rules :
311 -- The name field must not be null.
312 -- The name must be unique within business group for org plans, whereas for
313 -- non-org plans unique within business group and person plans.
314 --
315 -- Prerequisites:
316 --
317 -- In Parameters:
318 --
319 -- p_name
320 --
321 -- Post Success:
322 -- Processing continues
323 --
324 -- Post Failure:
325 -- If an error has occurred, an error message will be raised.
326 --
327 -- Developer Implementation Notes:
328 -- None.
329 --
330 -- Access Status:
331 -- Internal Development Use Only.
332 --
333 -- {End Of Comments}
334 -- ----------------------------------------------------------------------------
335 PROCEDURE chk_name
336 (p_name IN ota_training_plans.name%TYPE
337 ,p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
338 ,p_person_id IN ota_training_plans.person_id%TYPE
339 ,p_contact_id IN ota_training_plans.contact_id%TYPE
340 ,p_business_group_id IN ota_training_plans.business_group_id%TYPE
341 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE
342 );
343 -- ----------------------------------------------------------------------------
344 -- |------------------------< chk_del_training_plan_id >---------------------|
345 -- ----------------------------------------------------------------------------
346 -- {Start Of Comments}
347 --
348 -- Description:
349 -- This procedure enforces the rules :
350 -- A training plan cannot be deleted if
351 -- - Budget records exist in PER_BUDGET_ELEMENTS
352 -- - Cost records exist in OTA_TRAINING_PLAN_COSTS
353 -- - Member records exist in OTA_TRAINING_PLAN_MEMBERS
354 --
355 -- Prerequisites:
356 --
357 -- In Parameters:
358 --
359 -- p_training_plan_id
360 --
361 -- Post Success:
362 -- Processing continues
363 --
364 -- Post Failure:
365 -- If an error has occurred or a record is found preventing the plan from
366 -- being deleted ,an error message will be raised.
367 --
368 -- Developer Implementation Notes:
369 -- None.
370 --
371 -- Access Status:
372 -- Internal Development Use Only.
373 --
374 -- {End Of Comments}
375 -- ----------------------------------------------------------------------------
376 PROCEDURE chk_del_training_plan_id
377 (p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
378 ) ;
379
380 -- ----------------------------------------------------------------------------
381 -- |---------------------------< chk_plan_source >----------------------------|
382 -- ----------------------------------------------------------------------------
383 -- {Start Of Comments}
384 --
385 -- Description:
386 -- This procedure enforces the rules :
387 -- The plan_source must exist in hr_lookups under the correct lookup type.
388 -- as the training plan.
389 --
390 -- Prerequisites:
391 --
392 -- In Parameters:
393 --
394 -- p_effective_date
395 -- p_plan_source
396 --
397 -- Post Success:
398 -- Processing continues
399 --
400 -- Post Failure:
401 -- If an error has occurred, an error message will be raised.
402 --
403 -- Developer Implementation Notes:
404 -- None.
405 --
406 -- Access Status:
407 -- Internal Row Handler Use Only.
408 --
409 -- {End Of Comments}
410 -- ----------------------------------------------------------------------------
411
412
413 PROCEDURE chk_plan_source (p_training_plan_id IN NUMBER
414 ,p_plan_source IN VARCHAR2
415 ,p_effective_date IN DATE );
416
417 -- ----------------------------------------------------------------------------
418 -- |---------------------------< chk_tp_date_range >----------------------------|
419 -- ----------------------------------------------------------------------------
420 -- {Start Of Comments}
421 --
422 -- Description:
423 -- This procedure enforces the rules :
424 -- Training plan start date should not be less than sysdate.
425 -- End date cannot be less than start date.
426 -- The Training plan component dates are always within the
427 -- range of Training plan dates called only on update
428 --
429 -- Prerequisites:
430 --
431 -- In Parameters:
432 --
433 -- p_start_date
434 -- p_end_date
435 -- p_object_version_number
436 -- p_training_plan_id
437 --
438 -- Post Success:
439 -- Processing continues
440 --
441 -- Post Failure:
442 -- If an error has occurred, an error message will be raised.
443 --
444 -- Developer Implementation Notes:
445 -- None.
446 --
447 -- Access Status:
448 -- Internal Row Handler Use Only.
449 --
450 -- {End Of Comments}
451 -- ----------------------------------------------------------------------------
452
453 PROCEDURE chk_tp_date_range (p_training_plan_id IN ota_training_plans.training_plan_id%TYPE
454 ,p_start_date IN ota_training_plans.start_date%TYPE
455 ,p_end_date IN ota_training_plans.end_date%TYPE DEFAULT NULL
456 ,p_object_version_number IN ota_training_plans.object_version_number%TYPE);
457
458 END ota_tps_bus1;