DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_EN_VAL_PEE

Source


1 PACKAGE BODY IGS_EN_VAL_PEE AS
2 /* $Header: IGSEN53B.pls 115.7 2002/11/29 00:03:03 nsidana ship $ */
3   --
4   -- Validate the cp restriction on the PERSON exclusion effect table.
5   FUNCTION enrp_val_pee_crs_cp(
6   p_person_id IN NUMBER ,
7   p_s_encmb_effect_type IN VARCHAR2 ,
8   p_sequence_number IN NUMBER ,
9   p_course_cd IN VARCHAR2 ,
10   p_message_name OUT NOCOPY VARCHAR2)
11   RETURN BOOLEAN AS
12 
13   BEGIN
14   DECLARE
15   	v_person_id	IGS_PE_PERSENC_EFFCT.person_id%TYPE;
16   	CURSOR c_pee IS
17   		SELECT	pee.person_id
18   		FROM	IGS_PE_PERSENC_EFFCT	pee
19   		WHERE	pee.person_id = p_person_id AND
20   			pee.s_encmb_effect_type = p_s_encmb_effect_type AND
21   			pee.sequence_number <> p_sequence_number AND
22   			(	pee.expiry_dt IS NULL OR
23   				pee.expiry_dt > SYSDATE)	AND
24   			pee.course_cd = p_course_cd;
25   BEGIN
26   	--  Validate that there is not an existing RSTR_LE_CP  or
27   	--RSTR_GE_CP encumbrance effect for the nominated course code, when
28   	--attempting to apply credit point restriction effect.  Required to
29   	--prevent the situation of having a full-time and part-time
30   	--restriction applied to the same course.
31   	--  Note:course_cd is not part of the primary key of IGS_PE_PERSENC_EFFCT
32   	--It is included in the selection criteria as it is possible for course_based
33   	--IGS_PE_PERSENC_EFFCT records to exist for more than one records.
34   	--(ie the primary key will match. - uniqueness is enforced by a sequence
35   	-- number.
36   	--1.	Validate the input parameters.
37   	IF (p_person_id IS NULL OR
38   			p_course_cd IS NULL OR
39   			(p_s_encmb_effect_type NOT IN ('RSTR_LE_CP', 'RSTR_GE_CP'))) THEN
40   		p_message_name := null;
41   		RETURN TRUE;
42   	END IF;
43   	--2.	Select all IGS_PE_PERSENC_EFFCT's-
44   	OPEN c_pee;
45   	FETCH c_pee INTO v_person_id;
46   	IF (c_pee%NOTFOUND) THEN
47   		CLOSE c_pee;
48   		p_message_name := null;
49   		RETURN TRUE;
50   	ELSE
51   		CLOSE c_pee;
52   		p_message_name := 'IGS_GE_DUPLICATE_VALUE';
53   		RETURN FALSE;
54   	END IF;
55   END;
56   EXCEPTION
57   	WHEN OTHERS THEN
58 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
59 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_crs_cp');
60 		IGS_GE_MSG_STACK.ADD;
61        	        App_Exception.Raise_Exception;
62 
63 
64   END enrp_val_pee_crs_cp;
65   --
66   -- Validate the att type on the person exclusion effect table.
67   FUNCTION enrp_val_pee_crs_att(
68   p_person_id IN NUMBER ,
69   p_s_encmb_effect_type IN VARCHAR2 ,
70   p_sequence_number IN NUMBER ,
71   p_course_cd IN VARCHAR2 ,
72   p_message_name OUT NOCOPY VARCHAR2)
73   RETURN BOOLEAN AS
74 
75   BEGIN
76   DECLARE
77   	v_person_id	IGS_PE_PERSENC_EFFCT.person_id%TYPE;
78   	CURSOR c_pee IS
79   		SELECT	pee.person_id
80   		FROM	IGS_PE_PERSENC_EFFCT	pee
81   		WHERE	pee.person_id = p_person_id AND
82   			pee.s_encmb_effect_type = p_s_encmb_effect_type AND
83   			pee.sequence_number <> p_sequence_number AND
84   			(	pee.expiry_dt IS NULL OR
85   				pee.expiry_dt > SYSDATE)	AND
86   			pee.course_cd = p_course_cd;
87   BEGIN
88   	--  Validate that here is not an existing RSTR_AT_TY encumbrance
89   	--effect for the nominated course code.  Required to prevent the
90   	--situation of having a full-time and part-time restriction applied
91   	--to the same course.
92   	--  Note:course_cd is not part of the primary key of IGS_PE_PERSENC_EFFCT
93   	--  It is included in the selection criteria as it is possible for course_based
94   	-- IGS_PE_PERSENC_EFFCT records to exist for more than one records.
95   	-- (ie the primary key will match. - uniqueness is enforced by a sequence
96   	-- number.
97   	--1.	Validate the input parameters.
98   	IF (p_person_id IS NULL OR
99   			p_s_encmb_effect_type IS NULL OR
100   			p_course_cd IS NULL) THEN
101   		p_message_name := null;
102   		RETURN TRUE;
103   	END IF;
104   	--2.	Select all IGS_PE_PERSENC_EFFCT's-
105   	OPEN c_pee;
106   	FETCH c_pee INTO v_person_id;
107   	IF (c_pee%NOTFOUND) THEN
108   		CLOSE c_pee;
109   		p_message_name := null;
110   		RETURN TRUE;
111   	ELSE
112   		CLOSE c_pee;
113   		p_message_name := 'IGS_EN_ACTIVE_RSTR_AL_IY_EXIS';
114   		RETURN FALSE;
115   	END IF;
116   END;
117   EXCEPTION
118   	WHEN OTHERS THEN
119 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
120 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_crs_att');
121 		IGS_GE_MSG_STACK.ADD;
122 	       	        App_Exception.Raise_Exception;
123 
124 
125   END enrp_val_pee_crs_att;
126   --
127   -- bug id : 1956374
128   -- sjadhav , 28 -aug -2001
129   -- removed FUNCTION enrp_val_encmb_dt
130   -- removed FUNCTION enrp_val_encmb_dts
131   --
132   -- Validate that person doesn't already have a matching encumb effect.
133   FUNCTION enrp_val_pee_chk(
134   p_person_id IN NUMBER ,
135   p_encumbrance_type IN VARCHAR2 ,
136   p_pen_start_dt IN DATE ,
137   p_s_encmb_effect_type IN VARCHAR2 ,
138   p_pee_start_dt IN DATE ,
139   p_course_cd IN VARCHAR2 ,
140   p_message_name OUT NOCOPY VARCHAR2)
141   RETURN BOOLEAN AS
142   BEGIN
143   DECLARE
144 
145   	v_rec_found		BOOLEAN;
146   	CURSOR c_pee_no_course IS
147   		SELECT	person_id
148   		FROM	IGS_PE_PERSENC_EFFCT pee
149   		WHERE	pee.person_id		 = p_person_id		 AND
150   			pee.encumbrance_type	 = p_encumbrance_type	 AND
151   			pee.pen_start_dt	 = p_pen_start_dt	 AND
152   			pee.s_encmb_effect_type	 = p_s_encmb_effect_type AND
153   			pee.pee_start_dt	= p_pee_start_dt;
154   	CURSOR c_pee_course IS
155   		SELECT	person_id
156   		FROM	IGS_PE_PERSENC_EFFCT pee
157   		WHERE	pee.person_id		 = p_person_id		 AND
158   			pee.encumbrance_type	 = p_encumbrance_type	 AND
159   			pee.pen_start_dt	 = p_pen_start_dt	 AND
160   			pee.s_encmb_effect_type	 = p_s_encmb_effect_type AND
161   			pee.pee_start_dt	= p_pee_start_dt AND
162   			pee.course_cd		 = p_course_cd;
163   BEGIN
164   	-- This module validates that there are no matching
165   	-- IGS_PE_PERSENC_EFFCT records for the nominated encumbrance
166   	-- effect type.
167   	-- validate the input parameters
168   	IF (p_person_id IS NULL OR
169   	    p_encumbrance_type IS NULL OR
170   	    p_pen_start_dt IS NULL OR
171   	    p_s_encmb_effect_type IS NULL OR
172   	    p_pee_start_dt IS NULL) THEN
173   		p_message_name := null;
174   		RETURN TRUE;
175   	END IF;
176   	-- check if a IGS_PE_PERSENC_EFFCT record
177   	-- exists when the course_cd is not specified
178   	IF (p_course_cd IS NULL) THEN
179   		-- set that no records have yet been found
180   		v_rec_found := FALSE;
181   		FOR v_pee_no_course IN c_pee_no_course LOOP
182   			v_rec_found := TRUE;
183   		END LOOP;
184   		-- when no records are found
185   		IF (v_rec_found = FALSE) THEN
186   			p_message_name := null;
187   			RETURN TRUE;
188   		ELSE
189   			-- records were found
190   			p_message_name := 'IGS_GE_RECORD_ALREADY_EXISTS';
191   			RETURN FALSE;
192   		END IF;
193   	END IF;
194   	-- check if a IGS_PE_PERSENC_EFFCT record
195   	-- exists when the course_cd is specified
196   	IF (p_course_cd IS NOT NULL) THEN
197   		-- set that no records have yet been found
198   		v_rec_found := FALSE;
199   		FOR v_pee_course IN c_pee_course LOOP
200   			v_rec_found := TRUE;
201   		END LOOP;
202   		-- when no records are found
203   		IF (v_rec_found = FALSE) THEN
204   			p_message_name := null;
205   			RETURN TRUE;
206   		ELSE
207   			-- records were found
208   			p_message_name := 'IGS_GE_RECORD_ALREADY_EXISTS';
209   			RETURN FALSE;
210   		END IF;
211   	END IF;
212   	-- set the default return message number and type
213   	p_message_name := null;
214   	RETURN TRUE;
215   EXCEPTION
216   	WHEN OTHERS THEN
217 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
218 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_chk');
219 		IGS_GE_MSG_STACK.ADD;
220 	       	        App_Exception.Raise_Exception;
221 
222 
223   END;
224   END enrp_val_pee_chk;
225   --
226   -- Validate that person doesn't already have an open encumbrance effect.
227   FUNCTION enrp_val_pee_open(
228   p_person_id IN NUMBER ,
229   p_encumbrance_type IN VARCHAR2 ,
230   p_pen_start_dt IN DATE ,
231   p_s_encmb_effect_type IN VARCHAR2 ,
232   p_sequence_number IN NUMBER ,
233   p_course_cd IN VARCHAR2 ,
234   p_message_name OUT NOCOPY VARCHAR2)
235   RETURN BOOLEAN AS
236   BEGIN
237   DECLARE
238 
239   	v_rec_found		BOOLEAN;
240   	CURSOR c_pee_no_course IS
241   		SELECT	person_id
242   		FROM	IGS_PE_PERSENC_EFFCT pee
243   		WHERE	pee.person_id		 = p_person_id		 AND
244   			pee.encumbrance_type	 = p_encumbrance_type	 AND
245   			pee.pen_start_dt	 = p_pen_start_dt	 AND
246   			pee.s_encmb_effect_type	 = p_s_encmb_effect_type AND
247   			pee.sequence_number	 <>  p_sequence_number	 AND
248   			pee.expiry_dt 		IS NULL;
249   	CURSOR c_pee_course IS
250   		SELECT	person_id
251   		FROM	IGS_PE_PERSENC_EFFCT pee
252   		WHERE	pee.person_id		 = p_person_id		 AND
253   			pee.encumbrance_type	 = p_encumbrance_type	 AND
254   			pee.pen_start_dt	 = p_pen_start_dt	 AND
255   			pee.s_encmb_effect_type	 = p_s_encmb_effect_type AND
256   			pee.sequence_number	 <>  p_sequence_number	 AND
257   			pee.expiry_dt 		 IS NULL		 AND
258   			pee.course_cd		 = p_course_cd;
259   BEGIN
260   	-- This module validates that there are no other 'open ended'
261   	-- IGS_PE_PERSENC_EFFCT records for the nominated encumbrance
262   	-- effect type.
263   	-- validate the input parameters
264   	IF (p_person_id IS NULL OR
265   	    p_encumbrance_type IS NULL OR
266   	    p_pen_start_dt IS NULL OR
267   	    p_s_encmb_effect_type IS NULL OR
268   	    p_sequence_number IS NULL) THEN
269   		p_message_name := null;
270   		RETURN TRUE;
271   	END IF;
272   	-- check if a IGS_PE_PERSENC_EFFCT record
273   	-- exists when the course_cd is not specified
274   	IF (p_course_cd IS NULL) THEN
275   		-- set that no records have yet been found
276   		v_rec_found := FALSE;
277   		FOR v_pee_no_course IN c_pee_no_course LOOP
278   			v_rec_found := TRUE;
279   		END LOOP;
280   		-- when no records are found
281   		IF (v_rec_found = FALSE) THEN
282   			p_message_name := null;
283   			RETURN TRUE;
284   		ELSE
285   			-- records were found
286   			p_message_name := 'IGS_EN_PERS_ENCUMB_ALREADY_SP';
287   			RETURN FALSE;
288   		END IF;
289   	END IF;
290   	-- check if a IGS_PE_PERSENC_EFFCT record
291   	-- exists when the course_cd is specified
292   	IF (p_course_cd IS NOT NULL) THEN
293   		-- set that no records have yet been found
294   		v_rec_found := FALSE;
295   		FOR v_pee_course IN c_pee_course LOOP
296   			v_rec_found := TRUE;
297   		END LOOP;
298   		-- when no records are found
299   		IF (v_rec_found = FALSE) THEN
300   			p_message_name := null;
301   			RETURN TRUE;
302   		ELSE
303   			-- records were found
304   			p_message_name := 'IGS_EN_PRSN_ENCUMB_EFFECT';
305   			RETURN FALSE;
306   		END IF;
307   	END IF;
308   	-- set the default return message number and type
309   	p_message_name := null;
310   	RETURN TRUE;
311   EXCEPTION
312   	WHEN OTHERS THEN
313 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
314 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_open');
315 		IGS_GE_MSG_STACK.ADD;
316 	       	        App_Exception.Raise_Exception;
317 
318 
319   END;
320   END enrp_val_pee_open;
321   --
322   -- Validate the course code on the person exclusion effect table.
323   FUNCTION enrp_val_pee_crs(
324   p_person_id IN NUMBER ,
325   p_course_cd IN VARCHAR2 ,
326   p_message_name OUT NOCOPY VARCHAR2)
327   RETURN BOOLEAN AS
328 
329   BEGIN	-- enrp_val_pee_crs
330   	-- for a IGS_PE_PERSENC_EFFCT if the course_cd is set ensure
331   	-- that the person is enrolled in a course
332   DECLARE
333   	v_check		VARCHAR2(1);
334   	CURSOR	c_person_exist IS
335   		SELECT	'x'
336   		FROM	IGS_EN_STDNT_PS_ATT
337   		WHERE	person_id = p_person_id	AND
338   			course_cd = p_course_cd	AND
339   			course_attempt_status IN
340   				('ENROLLED', 'INACTIVE', 'INTERMIT');
341   BEGIN
342   	p_message_name := null;
343   	-- validate input parameter
344   	IF (p_person_id IS NULL OR
345   			p_course_cd IS NULL) THEN
346   		RETURN TRUE;
347   	END IF;
348   	-- check if the person is enrolled in the specified course
349   	OPEN c_person_exist;
350   	FETCH c_person_exist INTO v_check;
351   	IF (c_person_exist%NOTFOUND) THEN
352   		-- person is not enrolled in the specified course
353   		CLOSE c_person_exist;
354   		p_message_name := 'IGS_EN_PERSON_NOT_ENROLLED';
355   		RETURN FALSE;
356   	END IF;
357   	-- person is enrolled in the specified course
358   	CLOSE c_person_exist;
359   	RETURN TRUE;
360   END;
361   EXCEPTION
362   	WHEN OTHERS THEN
363 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
364 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_crs');
365 		IGS_GE_MSG_STACK.ADD;
366 	       	        App_Exception.Raise_Exception;
367 
368 
369   END enrp_val_pee_crs;
370   --
371   -- Validate whether or not a person is enrolled in any course.
372   FUNCTION enrp_val_pee_sca(
373   p_person_id IN NUMBER ,
374   p_message_name OUT NOCOPY VARCHAR2)
375   RETURN BOOLEAN AS
376 
377   BEGIN	-- enrp_val_pee_sca
378   	-- validate whether or not a person is enrolled in any course
379   DECLARE
380   	v_check		VARCHAR2(1);
381   	CURSOR	c_person_exist IS
382   		SELECT	'x'
383   		FROM	IGS_EN_STDNT_PS_ATT
384   		WHERE	person_id = p_person_id	AND
385   			course_attempt_status IN
386   			('ENROLLED', 'INACTIVE', 'INTERMIT');
387   BEGIN
388   	p_message_name := null;
389   	-- validate input parameters
390   	IF (p_person_id IS NULL) THEN
391   		RETURN TRUE;
392   	END IF;
393   	OPEN c_person_exist;
394   	FETCH c_person_exist INTO v_check;
395   	IF (c_person_exist%FOUND) THEN
396   		CLOSE c_person_exist;
397   		p_message_name := 'IGS_EN_PERS_ENRL_COURSE';
398   		RETURN FALSE;
399   	END IF;
400   	CLOSE c_person_exist;
401   	-- person is not enrolled in a course
402   	RETURN TRUE;
403   END;
404   EXCEPTION
405   	WHEN OTHERS THEN
406 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
407 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_sca');
408 		IGS_GE_MSG_STACK.ADD;
409 	       	        App_Exception.Raise_Exception;
410 
411 
412   END enrp_val_pee_sca;
413   --
414   -- Validate person is enrolled for encumbrance purposes
415   FUNCTION enrp_val_pee_enrol(
416   p_person_id IN NUMBER ,
417   p_effect_type IN VARCHAR2 ,
418   p_message_name OUT NOCOPY VARCHAR2)
419   RETURN BOOLEAN AS
420 
421   BEGIN	-- enrp_val_pee_enrol
422   	-- For a IGS_PE_PERSENC_EFFCT based on a s_encmb_effect_type which has
423   	-- the to_course_ind set, ensure that the person is enrolled in a course.
424   	-- If not, this type of effect cannot be created.
425   DECLARE
426   	v_check		VARCHAR2(1);
427   	CURSOR	c_seet_exist IS
428   		SELECT	'x'
429   		FROM	IGS_EN_ENCMB_EFCTTYP_V
430   		WHERE	S_ENCMB_EFFECT_TYPE = p_effect_type	AND
431   			apply_to_course_ind = 'Y';
432   	CURSOR	c_sca_exist IS
433   		SELECT	'x'
434   		FROM	IGS_EN_STDNT_PS_ATT	sca
438   	p_message_name := null;
435   		WHERE	sca.person_id = p_person_id	AND
436   			sca.course_attempt_status IN ('ENROLLED', 'INACTIVE', 'INTERMIT');
437   BEGIN
439   	-- validate the input parameters
440   	IF (p_person_id IS NULL OR p_effect_type IS NULL) THEN
441   		RETURN TRUE;
442   	END IF;
443   	-- Check if the apply_to_course_ind is set for the effect_type
444   	OPEN c_seet_exist;
445   	FETCH c_seet_exist INTO v_check;
446   	IF (c_seet_exist%NOTFOUND) THEN
447   		CLOSE c_seet_exist;
448   		RETURN TRUE;
449   	END IF;
450   	CLOSE c_seet_exist;
451   	-- Check if the person is enrolled in a course
452   	OPEN c_sca_exist;
453   	FETCH c_sca_exist INTO v_check;
454   	IF (c_sca_exist%FOUND) THEN
455   		CLOSE c_sca_exist;
456   		RETURN TRUE;
457   	ELSE
458   		CLOSE c_sca_exist;
459   		p_message_name := 'IGS_EN_EFFECT_TYPE_NOT_CREATE';
460   		RETURN FALSE;
461   	END IF;
462   END;
463   EXCEPTION
464   	WHEN OTHERS THEN
465 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
466 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_enrol');
467 		IGS_GE_MSG_STACK.ADD;
468 	       	        App_Exception.Raise_Exception;
469 
470 
471   END enrp_val_pee_enrol;
472   --
473   -- Validate the encumbrance effect course code
474   FUNCTION enrp_val_pee_crs_cd(
475   p_effect_type IN VARCHAR2 ,
476   p_course_cd IN VARCHAR2 ,
477   p_message_name OUT NOCOPY VARCHAR2)
478   RETURN BOOLEAN AS
479 
480   BEGIN	-- enrp_val_pee_crs_cd
481   	-- Validate if the course_cd can be set for the nominated s_encmb_effect_type
482   DECLARE
483   	v_check		VARCHAR2(1);
484   	CURSOR c_seet IS
485   		SELECT 'x'
486   		FROM 	IGS_EN_ENCMB_EFCTTYP_V
487   		WHERE	s_encmb_effect_type = p_effect_type	AND
488   			apply_to_course_ind = 'Y';
489   BEGIN
490   	-- course code is only specified and must be for encumbrance effect types
491   	-- which have the apply_to_course_ind set
492   	p_message_name := null;
493   	OPEN c_seet;
494   	FETCH c_seet INTO v_check;
495   	IF (c_seet%NOTFOUND) THEN
496   		CLOSE c_seet;
497   		IF (p_course_cd IS NULL) THEN
498   			-- course not set which is correct
499   			RETURN TRUE;
500   		ELSE
501   			-- course cannot be set
502   			p_message_name := 'IGS_EN_CANT_SPEC_COURS_CD';
503   			RETURN FALSE;
504   		END IF;
505   	ELSE -- effect has the course ind set
506   		CLOSE c_seet;
507   		IF (p_course_cd IS NULL) THEN
508   			-- course must be set
509   			p_message_name := 'IGS_EN_MUST_SPEC_COURS_CD';
510   			RETURN FALSE;
511   		ELSE
512   			RETURN TRUE;
513   		END IF;
514   	END IF;
515   END;
516   EXCEPTION
517   	WHEN OTHERS THEN
518 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
519 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_crs_cd');
520 		IGS_GE_MSG_STACK.ADD;
521 	       	        App_Exception.Raise_Exception;
522 
523 
524   END enrp_val_pee_crs_cd;
525   --
526   -- Validate the encumbrance effect restricted credit points
527   FUNCTION enrp_val_pee_rstr_cp(
528   p_effect_type IN VARCHAR2 ,
529   p_restricted_enrolment_cp IN NUMBER ,
530   p_message_name OUT NOCOPY VARCHAR2)
531   RETURN BOOLEAN AS
532   BEGIN
533   DECLARE
534 
535   BEGIN
536   	-- This module validates if the restricted enrolment credit points
537   	-- can be set for the nominated s_encmb_effect_type.
538   	-- validate that enrolment credit points are only specified (and must be)
539   	-- for the 'Restricted Credit Point' effects 'RSTR_LE_CP' and
540   	-- 'RSTR_GE_CP'.
541   	p_message_name := null;
542   	IF (p_effect_type IN ('RSTR_GE_CP', 'RSTR_LE_CP')) THEN
543   		IF (p_restricted_enrolment_cp IS NULL) THEN
544   			-- credit points must be set
545   			p_message_name := 'IGS_EN_SPEC_RESR_ENR_POINTS';
546   			RETURN FALSE;
547   		END IF;
548   	ELSE -- no credit point is set at all (i.e can only be
549   	     -- set if the s_encmb_effect_type is set)
550   		IF (p_restricted_enrolment_cp IS NOT NULL) THEN
551   			-- credit points cannot be set
552   			p_message_name := 'IGS_EN_CANT_SPEC_ENRL_CRDT';
553   			RETURN FALSE;
554   		END IF;
555   	END IF;
556   	RETURN TRUE;
557   EXCEPTION
558   	WHEN OTHERS THEN
559 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
560 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_rstr_cp');
561 		IGS_GE_MSG_STACK.ADD;
562 	       	        App_Exception.Raise_Exception;
563 
564 
565   END;
566   END enrp_val_pee_rstr_cp;
567   --
568   -- Validate the encumbrance effect attendance type
569   FUNCTION enrp_val_pee_rstr_at(
570   p_effect_type IN VARCHAR2 ,
571   p_restricted_attendance_type IN VARCHAR2 ,
572   p_message_name OUT NOCOPY VARCHAR2)
573   RETURN BOOLEAN AS
574 
575   BEGIN -- enrp_val_pee_rstr_at
576   DECLARE
577   BEGIN
578   	p_message_name := null;
579   	-- attendance type is only specified (and must be) for the
580   	-- Restricted Attendance Type' effect ('RSTR_AT_TY')
581   	IF (p_effect_type = 'RSTR_AT_TY') THEN
582   		IF (p_restricted_attendance_type IS NULL) THEN
583   			p_message_name := 'IGS_EN_REST_ATTN_NOT_NULL';
584   			RETURN FALSE;
585   		ELSE
586   			RETURN TRUE;
587   		END IF;
588   	END IF;
589   	IF (p_restricted_attendance_type IS NOT NULL) THEN
590   		p_message_name := 'IGS_EN_CAN_SPEC_RESTR_ATT';
591   		RETURN FALSE;
592   	ELSE
593   		RETURN TRUE;
594   	END IF;
595   END;
596   EXCEPTION
597   	WHEN OTHERS THEN
598 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
599 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_pee_rstr_at');
600 		IGS_GE_MSG_STACK.ADD;
601 	       	        App_Exception.Raise_Exception;
602 
603 
604   END enrp_val_pee_rstr_at;
605   --
606   -- bug id : 1956374
607   -- sjadhav , 28-aug-2001
608   -- removed FUNCTION enrp_val_encmb_dts
609   --
610   -- Validate the attendance type closed indicator.
611   FUNCTION enrp_val_att_closed(
612   p_attend_type IN VARCHAR2 ,
613   p_message_name OUT NOCOPY VARCHAR2)
614   RETURN BOOLEAN AS
615   BEGIN
616   DECLARE
617 
618   	v_closed_ind		VARCHAR2(1);
619   	CURSOR c_attend_type IS
620   		SELECT	closed_ind
621   		FROM	IGS_EN_ATD_TYPE
622   		WHERE	attendance_type = p_attend_type;
623   BEGIN
624   	-- Check if the IGS_EN_ATD_TYPE is closed
625   	p_message_name := null;
626   	OPEN c_attend_type;
627   	FETCH c_attend_type INTO v_closed_ind;
628   	IF (c_attend_type%NOTFOUND) THEN
629   		CLOSE c_attend_type;
630   		RETURN TRUE;
631   	END IF;
632   	IF (v_closed_ind = 'Y') THEN
633   		p_message_name := 'IGS_PS_ATTEND_TYPE_CLOSED';
634   		CLOSE c_attend_type;
635   		RETURN FALSE;
636   	END IF;
637   	-- record is not closed
638   	CLOSE c_attend_type;
639   	RETURN TRUE;
640   EXCEPTION
641   	WHEN OTHERS THEN
642 		FND_MESSAGE.SET_NAME('IGS', 'IGS_GE_UNHANDLED_EXP');
643 		FND_MESSAGE.SET_TOKEN('NAME', 'IGS_EN_VAL_PEE.enrp_val_att_closed');
644 		IGS_GE_MSG_STACK.ADD;
645 	       	        App_Exception.Raise_Exception;
646 
647 
648   END;
649   END enrp_val_att_closed;
650   --
651 END IGS_EN_VAL_PEE;