DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGS_EN_GEN_007

Source


1 PACKAGE BODY IGS_EN_GEN_007 AS
2 /* $Header: IGSEN07B.pls 120.1 2005/09/29 22:11:19 appldev ship $ */
3 /*    Who            When                               What
4       pkpatel        26-MAR-2003                        Bug 2261717
5                                                             Tuned the Function Enrp_Get_Student_Ind
6       jbegum         21 Mar 02                          As part of big fix of bug #2192616
7                                                         Removed the exception handling part of the
8                                                         function enrp_get_sua_incur.This was done in order
9                                                         to allow the user defined exception NO_AUSL_RECORD_FOUND
10                                                         coming from IGS_EN_PRC_LOAD.ENRP_GET_LOAD_INCUR
11                                                         to propagate to the form IGSPS047 and be handled accordingly
12                                                         instead of coming as an unhandled exception.
13 
14       nalkumar       06 May 2002                        Added p_waitlisted_dt parameter (and code logic related to it) in the Enrp_Get_Sua_Status procedure.
15                                                         This is as per the Bug# 2335455.
16 */
17 
18 Function Enrp_Get_Student_Ind(
19   p_person_id IN NUMBER )
20 RETURN VARCHAR2 AS
21 /* change history
22    WHO       WHEN         WHAT
23    pkpatel   26-MAR-2003  Bug 2261717
24                           Filter the query for efficiency. Removed the COUNT(*) and
25                                                   replaced igs_pe_typ_instances with igs_pe_typ_instances_all.
26    stutta    31-MAR-2004  Bug 3518606, Changed cursor c_aa by not truncating the sysdate
27                           for checking if the person is valid on the current day.
28 
29  */
30         cst_yes         CONSTANT VARCHAR2(1) := 'Y';
31         cst_no          CONSTANT VARCHAR2(1) := 'N';
32         --v_other_detail        VARCHAR2(255);
33         v_count         NUMBER;
34         v_output        VARCHAR2(1);
35 
36         -- (pathipat) Cursor c_aa modified for performance issues, Bug No: 2432563
37 
38         CURSOR  c_aa (cp_person_id   IGS_PE_PERSON.person_id%TYPE) IS
39                 SELECT  1
40                 FROM    igs_pe_typ_instances_all pti, igs_pe_person_types pty
41                 WHERE   pti.person_type_code = pty.person_type_code AND
42                         pty.system_type = 'STUDENT' AND
43                         pti.person_id = cp_person_id AND
44                         sysdate BETWEEN start_date AND NVL(end_date,sysdate);
45 BEGIN
46         -- This module determines whether or not a Person is a student
47         -- and returns the appropriate indicator.
48 
49         OPEN  c_aa (p_person_id);
50         FETCH c_aa INTO v_count;
51         IF c_aa%FOUND THEN
52 
53                 CLOSE c_aa;
54                 v_output := cst_yes;
55                 RETURN v_output;
56 
57         END IF;
58         CLOSE c_aa;
59 
60         v_output := cst_no;
61         RETURN v_output;
62 
63 END enrp_get_student_ind;
64 
65 FUNCTION Enrp_Get_Suah_Col(
66   p_column_name         IN user_tab_columns.column_name%TYPE ,
67   p_person_id           IN IGS_EN_SU_ATTEMPT_H_ALL.person_id%TYPE ,
68   p_course_cd           IN IGS_EN_SU_ATTEMPT_H_ALL.course_cd%TYPE ,
69   p_unit_cd             IN IGS_EN_SU_ATTEMPT_H_ALL.unit_cd%TYPE ,
70   p_cal_type            IN IGS_EN_SU_ATTEMPT_H_ALL.cal_type%TYPE ,
71   p_ci_sequence_number  IN IGS_EN_SU_ATTEMPT_H_ALL.ci_sequence_number%TYPE ,
72   p_hist_end_dt         IN IGS_EN_SU_ATTEMPT_H_ALL.hist_end_dt%TYPE,
73   p_uoo_id              IN IGS_EN_SU_ATTEMPT_H_ALL.UOO_ID%TYPE)
74   -------------------------------------------------------------------------------------------
75   --Change History:
76   --Who         When            What
77   --kkillams    25-04-2003      New paramater p_uoo_id is added to the function and c_suah cursor modified.
78   --                            w.r.t. bug number 2829262
79   -------------------------------------------------------------------------------------------
80 RETURN VARCHAR2 AS
81         gv_other_detail         Varchar2(255);
82 BEGIN
83 DECLARE
84         CURSOR c_suah(
85                         cp_column_name          user_tab_columns.column_name%TYPE,
86                         cp_person_id            IGS_EN_SU_ATTEMPT_H.person_id%TYPE,
87                         cp_course_cd            IGS_EN_SU_ATTEMPT_H.course_cd%TYPE,
88                         cp_uoo_id               IGS_EN_SU_ATTEMPT_H.uoo_id%TYPE,
89                         cp_hist_end_dt          IGS_EN_SU_ATTEMPT_H.hist_end_dt%TYPE) IS
90                 SELECT  DECODE ( cp_column_name,
91                                 'VERSION_NUMBER',               TO_CHAR(suah.version_number),
92                                 'LOCATION_CD',                  suah.location_cd,
93                                 'UNIT_CLASS',                   suah.unit_class,
94                                 'ENROLLED_DT',                  igs_ge_date.igscharDT(suah.enrolled_dt),
95                                 'UNIT_ATTEMPT_STATUS',          suah.unit_attempt_status,
96                                 'ADMINISTRATIVE_UNIT_STATUS',   suah.ADMINISTRATIVE_UNIT_STATUS,
97                                 'DISCONTINUED_DT',              igs_ge_date.igscharDT(suah.discontinued_dt),
98                                 'RULE_WAIVED_DT',               igs_ge_date.igscharDT(suah.rule_waived_dt),
99                                 'RULE_WAIVED_PERSON_ID',        TO_CHAR(suah.rule_waived_person_id),
100                                 'NO_ASSESSMENT_IND',            suah.no_assessment_ind,
101                                 'EXAM_LOCATION_CD',             suah.exam_location_cd,
102                                 'SUP_VERSION_NUMBER',           TO_CHAR(suah.sup_version_number),
103                                 'ALTERNATIVE_TITLE',            suah.alternative_title,
104                                 'OVERRIDE_ENROLLED_CP',         TO_CHAR(suah.override_enrolled_cp),
105                                 'OVERRIDE_EFTSU',               TO_CHAR(suah.override_eftsu),
106                                 'OVERRIDE_ACHIEVABLE_CP',       TO_CHAR(suah.override_achievable_cp),
107                                 'OVERRIDE_OUTCOME_DUE_DT',      igs_ge_date.igscharDT(suah.override_outcome_due_dt),
108                                 'OVERRIDE_CREDIT_REASON',       suah.override_credit_reason)
109                 FROM    IGS_EN_SU_ATTEMPT_H suah
110                 WHERE   suah.person_id          =       cp_person_id AND
111                         suah.course_cd          =       cp_course_cd AND
112                         suah.uoo_id             =       cp_uoo_id AND
113                         suah.hist_start_dt      >=      cp_hist_end_dt
114                 ORDER BY
115                         suah.hist_start_dt ASC;
116         v_column_value                  VARCHAR2(2000);
117 BEGIN
118         OPEN c_suah (p_column_name,
119                      p_person_id,
120                      p_course_cd,
121                      p_uoo_id,
122                      p_hist_end_dt);
123         LOOP
124                 FETCH c_suah INTO v_column_value;
125                 IF c_suah%NOTFOUND THEN
126                         CLOSE c_suah;
127                         RETURN NULL;
128                 END IF;
129                 IF NVL(v_column_value,'NULL') <> 'NULL' THEN
130                         CLOSE c_suah;
131                         RETURN v_column_value;
132                 END IF;
133         END LOOP;
134         CLOSE c_suah;
135         RETURN NULL;
136 END;
137 EXCEPTION
138         WHEN OTHERS THEN
139                 gv_other_detail := 'Parm: p_column_name - ' || p_column_name
140                         || ', p_person_id - ' || TO_CHAR(p_person_id)
141                         || ', p_course_cd - ' || p_course_cd
142                         || ', p_unit_cd - ' || p_unit_cd
143                         || ', p_cal_type - ' || p_cal_type
144                         || ', p_ci_sequence_number - ' || TO_CHAR(p_ci_sequence_number)
145                         || ', p_hist_end_dt - ' || igs_ge_date.igscharDT(p_hist_end_dt)
146                         || ', p_uoo_id - ' || TO_CHAR(p_uoo_id);
147 
148                 RAISE;
149 END enrp_get_suah_col;
150 
151 FUNCTION Enrp_Get_Sua_Incur(
152   p_person_id                   IN NUMBER ,
153   p_course_cd                   IN VARCHAR2 ,
154   p_unit_cd                     IN VARCHAR2 ,
155   p_unit_version_number         IN NUMBER ,
156   p_cal_type                    IN VARCHAR2 ,
157   p_ci_sequence_number          IN NUMBER ,
158   p_unit_attempt_status         IN VARCHAR2 ,
159   p_discontinued_dt             IN DATE ,
160   p_administrative_unit_status  IN VARCHAR2,
161   p_uoo_id                      IN NUMBER)
162   -------------------------------------------------------------------------------------------
163   -- enrp_get_sua_incur
164   -- Returbs whether a IGS_PS_UNIT attempt has incurred load.  This routine
165   -- is not specidic to a load calendar, but rather only looks to see
166   -- if the attempt has incurred load in its first load period.
167   --Change History:
168   --Who         When            What
169   --jbegum      21 Mar 02       As part of big fix of bug #2192616
170   --                            Removed the exception handling part of the
171   --                            function enrp_get_sua_incur.This was done in order
172   --                            to allow the user defined exception NO_AUSL_RECORD_FOUND
173   --                            coming from IGS_EN_PRC_LOAD.ENRP_GET_LOAD_INCUR
174   --                            to propagate to the form IGSPS047 and be handled accordingly
175   --                            instead of coming as an unhandled exception.
176   --kkillams    25-04-2003      New paramater p_uoo_id is added to the function and cur_sua cursor modified.
177   --                            w.r.t. bug number 2829262
178   -------------------------------------------------------------------------------------------
179 RETURN VARCHAR2 AS
180 BEGIN
181 DECLARE
182         v_acad_cal_type                 IGS_CA_INST.cal_type%TYPE;
183         v_acad_ci_sequence_number       IGS_CA_INST.sequence_number%TYPE;
184         v_acad_start_dt                 IGS_CA_INST.start_dt%TYPE;
185         v_acad_end_dt                   IGS_CA_INST.end_dt%TYPE;
186         v_message_name                  Varchar2(30);
187         v_alternate_code                IGS_CA_INST.alternate_code%TYPE;
188         v_return_type                   VARCHAR2(1);
189         cst_load                        CONSTANT        VARCHAR2(10) := 'LOAD';
190         cst_active                      CONSTANT        VARCHAR2(10) := 'ACTIVE';
191         cst_yes                         CONSTANT        VARCHAR2(1) := 'Y';
192         cst_no                          CONSTANT        VARCHAR2(1) := 'N';
193         CURSOR  c_ci_cat_cs (cp_acad_cal_type   IGS_CA_INST.cal_type%TYPE,
194                              cp_acad_ci_sequence_number
195                              IGS_CA_INST.sequence_number%TYPE) IS
196                 SELECT  ci.cal_type,
197                         ci.sequence_number
198                 FROM    IGS_CA_INST     ci,
199                         IGS_CA_TYPE     cat,
200                         IGS_CA_STAT     cs
201                 WHERE   cat.cal_type    = ci.cal_type AND
202                         cat.s_cal_cat   = cst_load AND
203                         cs.cal_status   = ci.cal_status AND
204                         cs.s_cal_status = cst_active AND
205                         IGS_EN_GEN_014.enrs_get_within_ci (
206                                                 cp_acad_cal_type,
207                                                 cp_acad_ci_sequence_number,
208                                                 ci.cal_type,
209                                                 ci.sequence_number,
210                                                 cst_yes) = cst_yes
211                 ORDER BY ci.start_dt;
212 
213         -- cursor added as a part of impact objects of Enrollment Process DLD (BUG No:1832130)
214         -- analysis to get uoo_id for the parameters
215         -- passed into the function, parameter uoo_id is added to the function
216         -- igs_en_prc_load.enrp_get_load_incur, inturn will use it in calling
217         -- igs_en_gen_008.enrp_get_uddc_aus function
218         CURSOR cur_sua
219         IS
220         SELECT no_assessment_ind
221         FROM  igs_en_su_attempt
222         WHERE person_id          = p_person_id
223         AND   course_cd          = p_course_cd
224         AND   uoo_id             = p_uoo_id;
225 
226         l_cur_sua  cur_sua%ROWTYPE;  -- cursor rowtype variable
227 
228 BEGIN
229         -- Get the academic period in which the teaching calendar commences
230         v_alternate_code := IGS_EN_GEN_002.enrp_get_acad_alt_cd (
231                                                 p_cal_type,
232                                                 p_ci_sequence_number,
233                                                 v_acad_cal_type,
234                                                 v_acad_ci_sequence_number,
235                                                 v_acad_start_dt,
236                                                 v_acad_end_dt,
237                                                 v_message_name);
238         IF v_acad_cal_type IS NULL THEN
239                 RETURN cst_no;
240         END IF;
241 
242         -- cursor is opened to get a uoo_id for the parameters passed
243         OPEN  cur_sua;
244         FETCH cur_sua INTO l_cur_sua;
245         CLOSE cur_sua;
246 
247         -- Loop through all load calendars in the academic year.  If the
248         -- student incurs load within any of them return Y.
249         FOR v_ci_cat_cs_rec IN c_ci_cat_cs (v_acad_cal_type,
250                                             v_acad_ci_sequence_number) LOOP
251 
252                 -- As part of the bug# 1956374 changed to the below call from  IGS_EN_GEN_005.ENRP_GET_LOAD_INCUR
253                 IF IGS_EN_PRC_LOAD.ENRP_GET_LOAD_INCUR (p_cal_type,
254                                                         p_ci_sequence_number,
255                                                         p_discontinued_dt,
256                                                         p_administrative_unit_status,
257                                                         p_unit_attempt_status,
258                                                         l_cur_sua.no_assessment_ind,
259                                                         v_ci_cat_cs_rec.cal_type,
260                                                         v_ci_cat_cs_rec.sequence_number,
261                                                         p_uoo_id,
262 							-- anilk, Audit special fee build
263 							'N'
264                                                       ) = cst_yes THEN
265                         v_return_type := cst_yes;
266                         EXIT;
267                 END IF;
268         END LOOP;
269         IF v_return_type = cst_yes THEN
270                 RETURN cst_yes;
271         END IF;
272         RETURN cst_no;
273 END;
274 END enrp_get_sua_incur;
275 
276 FUNCTION Enrp_Get_Sua_Status(
277   p_person_id           IN NUMBER ,
278   p_course_cd           IN VARCHAR2 ,
279   p_unit_cd             IN VARCHAR2 ,
280   p_version_number      IN NUMBER ,
281   p_cal_type            IN VARCHAR2 ,
282   p_ci_sequence_number  IN NUMBER ,
283   p_unit_attempt_status IN VARCHAR2 ,
284   p_enrolled_dt         IN DATE ,
285   p_rule_waived_dt      IN DATE ,
286   p_discontinued_dt     IN DATE ,
287   p_waitlisted_dt       IN DATE DEFAULT NULL, -- Added p_waitlist_dt parameter as per the Bug# 2335455.
288   p_uoo_id              IN NUMBER)
289  -------------------------------------------------------------------------------------------
290  -- Added for Enhancement, Enrollments: Registration Enhancements and Class Lists
291  -- Modified the c_chk_suao_exists cursor, If the grading_period is FINAL then only returning the unit_attempt_status COMPLETED. pmarada,bug 2395762
292  --Who         When            What
293  --kkillams    25-04-2003      New paramater p_uoo_id is added to the function.c_get_db_param_values,
294  --                            c_chk_suao_exists and c_sut cursors modified. w.r.t. bug number 2829262
295  -- ctyagi     29-Sept-2005    Modified cursor c_sut for bug number 4488779
296  -------------------------------------------------------------------------------------------
297 RETURN VARCHAR2 AS
298 
299 BEGIN
300 DECLARE
301 
302         cst_dropped             CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'DROPPED';
306         cst_enrolled            CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'ENROLLED';
303         cst_unconfirm           CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'UNCONFIRM';
304         cst_waitlisted          CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'WAITLISTED';
305         cst_discontin           CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'DISCONTIN';
307         cst_completed           CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'COMPLETED';
308         cst_invalid             CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'INVALID';
309         cst_duplicate           CONSTANT IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE := 'DUPLICATE';
310         cst_no                  CONSTANT IGS_AS_SU_STMPTOUT.finalised_outcome_ind%TYPE := 'N';
311         cst_yes                 CONSTANT IGS_AS_SU_STMPTOUT.finalised_outcome_ind%TYPE := 'Y';
312         cst_grading_period_cd   igs_as_su_stmptout.grading_period_cd%TYPE := 'FINAL';
313         v_exists_flag           VARCHAR2(1);
314         v_unit_attempt_status   IGS_EN_SU_ATTEMPT.unit_attempt_status%TYPE;
315         v_enrolled_dt           IGS_EN_SU_ATTEMPT.enrolled_dt%TYPE;
316         v_rule_waived_dt        IGS_EN_SU_ATTEMPT.rule_waived_dt%TYPE;
317         v_discontinued_dt       IGS_EN_SU_ATTEMPT.discontinued_dt%TYPE;
318 
319         CURSOR c_get_db_param_values IS
320                 SELECT  unit_attempt_status,
321                         enrolled_dt,
322                         rule_waived_dt,
323                         discontinued_dt
324                 FROM    IGS_EN_SU_ATTEMPT
325                 WHERE   person_id = p_person_id                 AND
326                         course_cd = p_course_cd                 AND
327                         uoo_id    = p_uoo_id;
328         CURSOR c_chk_suao_exists IS
329                 SELECT  'x'
330                 FROM    sys.dual
331                 WHERE   EXISTS (
332                         SELECT  'x'
333                         FROM    IGS_AS_SU_STMPTOUT
334                         WHERE   person_id = p_person_id                         AND
335                                 course_cd = p_course_cd                         AND
336                                 uoo_id    = p_uoo_id                            AND
337                                 finalised_outcome_ind = cst_yes                 AND
338                                 s_grade_creation_method_type <> cst_discontin   AND
339                                 grading_period_cd = cst_grading_period_cd
340                         );
341         CURSOR c_sut IS
342                 SELECT  sua.unit_attempt_status
343                 FROM    IGS_PS_STDNT_UNT_TRN sut1, IGS_EN_SU_ATTEMPT sua
344                 WHERE   sut1.person_id = p_person_id AND
345                         sut1.course_cd = p_course_cd AND
346                         sua.person_id = sut1.person_id AND
347                         sua.course_cd = sut1.transfer_course_cd AND
348                         sua.uoo_id = sut1.uoo_id AND
349                         sut1.uoo_id = p_uoo_id AND
350                         sut1.transfer_dt = ( SELECT max(sut2.transfer_dt)
351                                       FROM IGS_PS_STDNT_UNT_TRN sut2
352                                       where sut2.person_id = sut1.person_id
353                                       and sut2.course_cd = sut1.course_cd
354                                       and sut2.uoo_id = sut1.uoo_id)
355                         AND sut1.transfer_dt > (SELECT NVL(max(sut3.transfer_dt),(sut1.transfer_dt-1))
356                                       FROM IGS_PS_STDNT_UNT_TRN sut3
357                                       where sut3.person_id = sut1.person_id
358                                       and sut3.transfer_course_cd = sut1.course_cd
359                                       and sut3.uoo_id = sut1.uoo_id);
360        v_sut_rec c_sut%ROWTYPE;
361 BEGIN
362         IF p_unit_attempt_status IS NULL THEN
363                 OPEN c_get_db_param_values;
364                 FETCH c_get_db_param_values INTO v_unit_attempt_status,
365                         v_enrolled_dt,
366                         v_rule_waived_dt,
367                         v_discontinued_dt;
368                 IF c_get_db_param_values%NOTFOUND THEN
369                         CLOSE c_get_db_param_values;
370                         RETURN NULL;
371                 END IF;
372                 CLOSE c_get_db_param_values;
373         ELSE
374                 -- Use parameters instead of selected student IGS_PS_UNIT attempt
375                 -- information to set v_ values.
376                 v_unit_attempt_status := p_unit_attempt_status;
377                 v_enrolled_dt := p_enrolled_dt;
378                 v_rule_waived_dt := p_rule_waived_dt;
379                 v_discontinued_dt := p_discontinued_dt;
380         END IF;
381 -- Added for Enhancement, Enrollments: Registration Enhancements and Class Lists
382 -- Unit is Discontinued prior to the date specified in Unit Discontinuation Criteria, So Dropping the Unit
383         IF v_unit_attempt_status  = cst_dropped THEN
384                 RETURN cst_dropped;
385         END IF;
386 
387         --
388         -- Added the next If condition to fix Bug# 2335455.
389         -- If the waitlisted date is not null then the Unit Attempt Status is 'WAITLISTED'.
390         IF p_waitlisted_dt IS NOT NULL THEN
391           RETURN cst_waitlisted;
392         END IF;
393 
394 
395         -- Status of invalid is not altered by this routine unless the
396         -- IGS_RU_RULE waived date has been set
397         IF v_unit_attempt_status  = cst_invalid AND
398                          v_rule_waived_dt IS NULL THEN
399                 RETURN cst_invalid;
400         END IF;
401         -- Status is unconfirmed if enrolled date is not set
402         IF v_enrolled_dt IS NULL THEN
403                 RETURN cst_unconfirm;
404         END IF;
405         -- Status is duplicate if IGS_PS_STDNT_UNT_TRN detail exists
406         IF v_unit_attempt_status IN (cst_completed,cst_discontin, cst_duplicate) THEN
407             OPEN c_sut;
408             FETCH c_sut INTO v_sut_rec;
409             IF c_sut%FOUND THEN
410                     CLOSE c_sut;
411                     IF v_sut_rec.unit_attempt_status = v_unit_attempt_status THEN
412                       RETURN v_unit_attempt_status;
413                     ELSIF v_unit_attempt_status = cst_duplicate THEN
414                       RETURN cst_duplicate;
415                     END IF;
416             END IF;
417             IF c_sut%ISOPEN THEN
418               CLOSE c_sut;
419             END IF;
420         END IF;
421         -- Status is discontinued if discontinued date is set
422         IF  v_discontinued_dt IS NOT NULL THEN
423                 RETURN cst_discontin;
424         END IF;
425         -- Status is completed when one student IGS_PS_UNIT attempt outcome exists
426         -- with finalised outcome indicator set and not created by discontinuation
427         OPEN c_chk_suao_exists;
428         FETCH c_chk_suao_exists INTO v_exists_flag;
429         IF c_chk_suao_exists%FOUND THEN
430                 CLOSE c_chk_suao_exists;
431                 RETURN cst_completed;
432         END IF;
433         CLOSE c_chk_suao_exists;
434         -- Status must be enrolled
435         RETURN cst_enrolled;
436 EXCEPTION
437         WHEN OTHERS THEN
438                 IF (c_get_db_param_values%ISOPEN) THEN
439                         CLOSE c_get_db_param_values;
440                 END IF;
441                 IF (c_chk_suao_exists%ISOPEN) THEN
442                         CLOSE c_chk_suao_exists;
443                 END IF;
444                 IF (c_sut%ISOPEN) THEN
445                         CLOSE c_sut;
446                 END IF;
447                 RAISE;
448 END;
449 EXCEPTION
450         WHEN OTHERS THEN
451         Fnd_Message.Set_name('IGS','IGS_GE_UNHANDLED_EXP');
452         FND_MESSAGE.SET_TOKEN('NAME','IGS_EN_GEN_007.enrp_get_sua_status');
453         IGS_GE_MSG_STACK.ADD;
454         App_Exception.Raise_Exception;
455 END enrp_get_sua_status;
456 
457 Function Enrp_Get_Susa_Status(
458   p_selection_dt IN DATE ,
459   p_student_confirmed_ind IN VARCHAR2 ,
460   p_end_dt IN DATE ,
461   p_rqrmnts_complete_ind IN VARCHAR2 )
462 RETURN VARCHAR2 AS
463 
464 BEGIN   -- enrp_get_susa_status
465         -- Get logical status of IGS_AS_SU_SETATMPT, being one of:
466         --      * UNCONFIRM, ACTIVE, COMPLETED OR ENDED.
467 DECLARE
468         cst_unconfirm   CONSTANT        VARCHAR2(10) := 'UNCONFIRM';
469         cst_active      CONSTANT        VARCHAR2(10) := 'ACTIVE';
470         cst_completed   CONSTANT        VARCHAR2(10) := 'COMPLETED';
471         cst_ended       CONSTANT        VARCHAR2(5) := 'ENDED';
472 BEGIN
473         IF p_student_confirmed_ind = 'N' OR
474                         p_selection_dt IS NULL THEN
475                 RETURN cst_unconfirm;
476         ELSE
477                 IF p_end_dt IS NULL AND
478                                 p_rqrmnts_complete_ind = 'N' THEN
479                         RETURN cst_active;
480                 ELSIF p_end_dt IS NOT NULL THEN
481                         RETURN cst_ended;
482                 ELSE
483                         RETURN cst_completed;
484                 END IF;
485         END IF;
486 END;
487 /*
488 EXCEPTION
489         WHEN OTHERS THEN
490         Fnd_Message.Set_name('IGS','IGS_GE_UNHANDLED_EXP');
491         App_Exception.Raise_Exception;
492 */
493 END enrp_get_susa_status;
494 
495 END IGS_EN_GEN_007;