DBA Data[Home] [Help]
Skip to content

PACKAGE BODY: APPS.PAY_PAYWSLEE_PKG

Source


1 package body PAY_PAYWSLEE_PKG as
2 /* $Header: paywslee.pkb 120.1.12020000.3 2013/03/21 11:52:55 ranarra ship $ */
3 --
4 procedure get_input_value_names (
5 --
6 p_element_type_id	in	       number,
7 p_name1			in out	nocopy varchar2,
8 p_name2			in out	nocopy varchar2,
9 p_name3			in out	nocopy varchar2,
10 p_name4			in out	nocopy varchar2,
11 p_name5			in out	nocopy varchar2,
12 p_name6			in out	nocopy varchar2,
13 p_name7			in out	nocopy varchar2,
14 p_name8			in out	nocopy varchar2,
15 p_name9			in out	nocopy varchar2,
16 p_name10		in out	nocopy varchar2,
17 p_name11		in out	nocopy varchar2,
18 p_name12		in out	nocopy varchar2,
19 p_name13		in out	nocopy varchar2,
20 p_name14		in out	nocopy varchar2,
21 p_name15		in out	nocopy varchar2) is
22 --
23 cursor set_of_input_values is
24 	--
25 	select	input_value_tl.name
26 	--
27 	from	pay_input_values_f_tl INPUT_VALUE_TL,
28                 pay_input_values_f INPUT_VALUE
29 	--
30 	where	input_value.element_type_id	= p_element_type_id
31         and     input_value_tl.input_value_id  = input_value.input_value_id
32         and     userenv('LANG') = input_value_tl.language
33 	and	input_value.effective_start_date =
34 		(select min (element.effective_start_date)
35 		from	pay_element_types_f	ELEMENT
36 		where	element.element_type_id = p_element_type_id)
37 		--
38 	order by	input_value.display_sequence,
39 			input_value_tl.name;
40 			--
41 input_value_number	integer;
42 --
43 begin
44 --
45 -- Nullify the parameters before populating them (because we may not replace
46 -- all 15 names)
47 --
48 p_name1		:= null;
49 p_name2		:= null;
50 p_name3		:= null;
51 p_name4		:= null;
52 p_name5		:= null;
53 p_name6		:= null;
54 p_name7		:= null;
55 p_name8		:= null;
56 p_name9		:= null;
57 p_name10	:= null;
58 p_name11	:= null;
59 p_name12	:= null;
60 p_name13	:= null;
61 p_name14	:= null;
62 p_name15	:= null;
63 --
64 -- Fetch all the input values
65 --
66 for fetched_input_value in set_of_input_values LOOP
67   --
68   input_value_number := set_of_input_values%rowcount; -- loop index flag
69   --
70   -- Now we need to put the input value names into the right parameters
71   -- to pass back to the form
72   --
73   if input_value_number = 1 then
74     --
75     p_name1		:= fetched_input_value.name;
76     --
77   elsif input_value_number = 2 then
78     --
79     p_name2		:= fetched_input_value.name;
80     --
81   elsif input_value_number = 3 then
82     --
83     p_name3		:= fetched_input_value.name;
84     --
85   elsif input_value_number = 4 then
86     --
87     p_name4		:= fetched_input_value.name;
88     --
89   elsif input_value_number = 5 then
90     --
91     p_name5		:= fetched_input_value.name;
92     --
93   elsif input_value_number = 6 then
94     --
95     p_name6		:= fetched_input_value.name;
96     --
97   elsif input_value_number = 7 then
98     --
99     p_name7		:= fetched_input_value.name;
100     --
101   elsif input_value_number = 8 then
102     --
103     p_name8		:= fetched_input_value.name;
104     --
105   elsif input_value_number = 9 then
106     --
107     p_name9		:= fetched_input_value.name;
108     --
109   elsif input_value_number = 10 then
110     --
111     p_name10		:= fetched_input_value.name;
112     --
113   elsif input_value_number = 11 then
114     --
115     p_name11		:= fetched_input_value.name;
116     --
117   elsif input_value_number = 12 then
118     --
119     p_name12		:= fetched_input_value.name;
120     --
121   elsif input_value_number = 13 then
122     --
123     p_name13		:= fetched_input_value.name;
124     --
125   elsif input_value_number = 14 then
126     --
127     p_name14		:= fetched_input_value.name;
128     --
129   elsif input_value_number = 15 then
130     --
131     p_name15		:= fetched_input_value.name;
132     --
133   end if;
134   --
135 end loop;
136 --
137 end get_input_value_names;
138 --------------------------------------------------------------------------------
139 procedure get_input_value_names (
140 --
141 p_rows                  in out  nocopy number,
142 p_element_type_id       in             number,
143 p_ivn_tab               in out  nocopy IvnTabType) is
144 --
145 cursor set_of_input_values is
146         --
147         select  input_value_tl.name
148         --
149         from    pay_input_values_f_tl INPUT_VALUE_TL,
150                 pay_input_values_f INPUT_VALUE
151         --
152         where   input_value.element_type_id     = p_element_type_id
153         and     input_value_tl.input_value_id  = input_value.input_value_id
154         and     userenv('LANG') = input_value_tl.language
155         and     input_value.effective_start_date =
156                 (select min (element.effective_start_date)
157                 from    pay_element_types_f     ELEMENT
158                 where   element.element_type_id = p_element_type_id)
159         order by        input_value.display_sequence,
160                         input_value_tl.name;
161                         --
162 --
163 begin
164 --
165 p_rows := 0;
166 --
167 for fetched_input_value in set_of_input_values LOOP
168   --
169   p_rows  := p_rows  + 1;
170   p_ivn_tab(p_rows) := fetched_input_value.name;
171 --
172 end loop;
173 --
174 end get_input_value_names;
175 --------------------------------------------------------------------
176 procedure get_entry_details (
177 --
178 p_element_entry_id	in	       number,
179 p_element_link_id	in	       number,
180 p_assignment_id		in	       number,
181 p_effective_end_date	in	       date,
182 p_full_name		in out	nocopy varchar2,
183 p_assignment_number	in out	nocopy varchar2,
184 p_screen_entry_value1	in out	nocopy varchar2,
185 p_screen_entry_value2	in out	nocopy varchar2,
186 p_screen_entry_value3	in out	nocopy varchar2,
187 p_screen_entry_value4	in out	nocopy varchar2,
188 p_screen_entry_value5	in out	nocopy varchar2,
189 p_screen_entry_value6	in out	nocopy varchar2,
190 p_screen_entry_value7	in out	nocopy varchar2,
191 p_screen_entry_value8	in out	nocopy varchar2,
192 p_screen_entry_value9	in out	nocopy varchar2,
193 p_screen_entry_value10	in out	nocopy varchar2,
194 p_screen_entry_value11	in out	nocopy varchar2,
195 p_screen_entry_value12	in out	nocopy varchar2,
196 p_screen_entry_value13	in out	nocopy varchar2,
197 p_screen_entry_value14	in out	nocopy varchar2,
198 p_screen_entry_value15	in out	nocopy varchar2,
199 p_uom1			in out	nocopy varchar2,
200 p_uom2			in out	nocopy varchar2,
201 p_uom3			in out	nocopy varchar2,
202 p_uom4			in out	nocopy varchar2,
203 p_uom5			in out	nocopy varchar2,
204 p_uom6			in out	nocopy varchar2,
205 p_uom7			in out	nocopy varchar2,
206 p_uom8			in out	nocopy varchar2,
207 p_uom9			in out	nocopy varchar2,
208 p_uom10			in out	nocopy varchar2,
209 p_uom11			in out	nocopy varchar2,
210 p_uom12			in out	nocopy varchar2,
211 p_uom13			in out	nocopy varchar2,
212 p_uom14			in out	nocopy varchar2,
213 p_uom15			in out	nocopy varchar2) is
214 --
215 cursor asgt_details is
216 	--
217 	select	person.full_name,
218 		asgt.assignment_number
219 	from	per_people_f		PERSON,
220 		per_assignments_f2	ASGT
221 	where	person.person_id 	= asgt.person_id
222 	and	asgt.assignment_id	= p_assignment_id
223 	and	p_effective_end_date between asgt.effective_start_date
224 					and asgt.effective_end_date
225 	and	p_effective_end_date between person.effective_start_date
226 					and person.effective_end_date;
227 	--
228 cursor set_of_entry_values is
229 	--
230 	SELECT  b.screen_entry_value
231       , TYPE.uom
232       , TYPE.hot_default_flag
233       , TYPE.lookup_type
234       , TYPE.value_set_id
235       , nvl (b.default_value, TYPE.default_value) hot_default_value
236 FROM    (
237         SELECT  *
238         FROM    pay_input_values_f piv
239               , pay_element_links_f pil
240         WHERE   pil.element_type_id = piv.element_type_id
241         AND     pil.element_link_id = p_element_link_id
242         and     piv.effective_start_date =
243                 (select min (element.effective_start_date)
244                 from    pay_element_types_f     ELEMENT
245                 where   element.element_type_id = piv.element_type_id)
246         ) TYPE
247       ,
248         (
249         SELECT  entry.*
250               , link.default_value
251         FROM    pay_element_entry_values_f entry
252               , pay_link_input_values_f link
253         WHERE   element_entry_id = p_element_entry_id
254         AND     link.input_value_id = entry.input_value_id
255         AND     link.element_link_id = p_element_link_id
256         and     p_effective_end_date = entry.effective_end_date
257         and     p_effective_end_date between link.effective_start_date
258                                         and link.effective_end_date
259         ) b
260 WHERE   TYPE.input_value_id = b.input_value_id (+)
261 ORDER BY type.display_sequence
262        , type.name  ;
263 	--
264 entry_value_number	integer;
265 --
266 begin
267 --
268 -- Retrieve the person's full name
269 --
270 open asgt_details;
271 fetch asgt_details into p_full_name, p_assignment_number;
272 close asgt_details;
273 --
274 -- Retrieve all the existing element entry values for the element entry
275 --
276 for fetched_entry_value in set_of_entry_values LOOP
277   --
278   entry_value_number := set_of_entry_values%rowcount; -- loop index flag
279   --
280   if entry_value_number = 1 then
281     --
282     p_uom1			:= fetched_entry_value.uom;
283     --
284     if fetched_entry_value.hot_default_flag = 'Y'
285     and fetched_entry_value.screen_entry_value is null then
286       --
287       p_screen_entry_value1	:= fetched_entry_value.hot_default_value;
288     else
289       p_screen_entry_value1 	:= fetched_entry_value.screen_entry_value;
290       --
291     end if;
292     --
293     if fetched_entry_value.lookup_type is not null
294     and p_screen_entry_value1 is not null then
295       --
296       p_screen_entry_value1	:= hr_general.decode_lookup
297 					(fetched_entry_value.lookup_type,
298 					p_screen_entry_value1);
299       --
300     end if;
301     --
302     if fetched_entry_value.value_set_id is not null
303     and p_screen_entry_value1 is not null then
304     --
305 	p_screen_entry_value1 := pay_input_values_pkg.decode_vset_value(
306 				fetched_entry_value.value_set_id,
307 				p_screen_entry_value1);
308     --
309     end if;
310     --
311   elsif entry_value_number = 2 then
312     --
313     p_uom2			:= fetched_entry_value.uom;
314     --
315     if fetched_entry_value.hot_default_flag = 'Y'
316     and fetched_entry_value.screen_entry_value is null then
317       --
318       p_screen_entry_value2	:= fetched_entry_value.hot_default_value;
319     else
320       p_screen_entry_value2 	:= fetched_entry_value.screen_entry_value;
321       --
322     end if;
323     --
324     if fetched_entry_value.lookup_type is not null
325     and p_screen_entry_value2 is not null then
326       --
327       p_screen_entry_value2	:= hr_general.decode_lookup
328 					(fetched_entry_value.lookup_type,
329 					p_screen_entry_value2);
330       --
331     end if;
332     --
333     if fetched_entry_value.value_set_id is not null
334     and p_screen_entry_value2 is not null then
335     --
336 	p_screen_entry_value2 := pay_input_values_pkg.decode_vset_value(
337 				fetched_entry_value.value_set_id,
338 				p_screen_entry_value2);
339     --
340     end if;
341     --
342   elsif entry_value_number = 3 then
343     --
344     p_uom3			:= fetched_entry_value.uom;
345     --
346     if fetched_entry_value.hot_default_flag = 'Y'
347     and fetched_entry_value.screen_entry_value is null then
348       --
349       p_screen_entry_value3	:= fetched_entry_value.hot_default_value;
350     else
351       p_screen_entry_value3 	:= fetched_entry_value.screen_entry_value;
352       --
353     end if;
354     --
355     if fetched_entry_value.lookup_type is not null
356     and p_screen_entry_value3 is not null then
357       --
358       p_screen_entry_value3	:= hr_general.decode_lookup
359 					(fetched_entry_value.lookup_type,
360 					p_screen_entry_value3);
361       --
362     end if;
363     --
364     if fetched_entry_value.value_set_id is not null
365     and p_screen_entry_value3 is not null then
366     --
367 	p_screen_entry_value3 := pay_input_values_pkg.decode_vset_value(
368 				fetched_entry_value.value_set_id,
369 				p_screen_entry_value3);
370     --
371     end if;
372     --
373   elsif entry_value_number = 4 then
374     --
375     p_uom4			:= fetched_entry_value.uom;
376     --
377     if fetched_entry_value.hot_default_flag = 'Y'
378     and fetched_entry_value.screen_entry_value is null then
379       --
380       p_screen_entry_value4	:= fetched_entry_value.hot_default_value;
381     else
382       p_screen_entry_value4 	:= fetched_entry_value.screen_entry_value;
383       --
384     end if;
385     --
386     if fetched_entry_value.lookup_type is not null
387     and p_screen_entry_value4 is not null then
388       --
389       p_screen_entry_value4	:= hr_general.decode_lookup
390 					(fetched_entry_value.lookup_type,
391 					p_screen_entry_value4);
392       --
393     end if;
394     --
395     if fetched_entry_value.value_set_id is not null
396     and p_screen_entry_value4 is not null then
397     --
398 	p_screen_entry_value4 := pay_input_values_pkg.decode_vset_value(
399 				fetched_entry_value.value_set_id,
400 				p_screen_entry_value4);
401     --
402     end if;
403     --
404   elsif entry_value_number = 5 then
405     --
406     p_uom5			:= fetched_entry_value.uom;
407     --
408     if fetched_entry_value.hot_default_flag = 'Y'
409     and fetched_entry_value.screen_entry_value is null then
410       --
411       p_screen_entry_value5	:= fetched_entry_value.hot_default_value;
412     else
413       p_screen_entry_value5 	:= fetched_entry_value.screen_entry_value;
414       --
415     end if;
416     --
417     if fetched_entry_value.lookup_type is not null
418     and p_screen_entry_value5 is not null then
419       --
420       p_screen_entry_value5	:= hr_general.decode_lookup
421 					(fetched_entry_value.lookup_type,
422 					p_screen_entry_value5);
423       --
424     end if;
425     --
426     if fetched_entry_value.value_set_id is not null
427     and p_screen_entry_value5 is not null then
428     --
429 	p_screen_entry_value5 := pay_input_values_pkg.decode_vset_value(
430 				fetched_entry_value.value_set_id,
431 				p_screen_entry_value5);
432     --
433     end if;
434     --
435   elsif entry_value_number = 6 then
436     --
437     p_uom6			:= fetched_entry_value.uom;
438     --
439     if fetched_entry_value.hot_default_flag = 'Y'
440     and fetched_entry_value.screen_entry_value is null then
441       --
442       p_screen_entry_value6	:= fetched_entry_value.hot_default_value;
443     else
444       p_screen_entry_value6 	:= fetched_entry_value.screen_entry_value;
445       --
446     end if;
447     --
448     if fetched_entry_value.lookup_type is not null
449     and p_screen_entry_value6 is not null then
450       --
451       p_screen_entry_value6	:= hr_general.decode_lookup
452 					(fetched_entry_value.lookup_type,
453 					p_screen_entry_value6);
454       --
455     end if;
456     --
457     if fetched_entry_value.value_set_id is not null
458     and p_screen_entry_value6 is not null then
459     --
460 	p_screen_entry_value6 := pay_input_values_pkg.decode_vset_value(
461 				fetched_entry_value.value_set_id,
462 				p_screen_entry_value6);
463     --
464     end if;
465     --
466   elsif entry_value_number = 7 then
467     --
468     p_uom7			:= fetched_entry_value.uom;
469     --
470     if fetched_entry_value.hot_default_flag = 'Y'
471     and fetched_entry_value.screen_entry_value is null then
472       --
473       p_screen_entry_value7	:= fetched_entry_value.hot_default_value;
474     else
475       p_screen_entry_value7 	:= fetched_entry_value.screen_entry_value;
476       --
477     end if;
478     --
479     if fetched_entry_value.lookup_type is not null
480     and p_screen_entry_value7 is not null then
481       --
482       p_screen_entry_value7	:= hr_general.decode_lookup
483 					(fetched_entry_value.lookup_type,
484 					p_screen_entry_value7);
485       --
486     end if;
487     --
488     if fetched_entry_value.value_set_id is not null
489     and p_screen_entry_value7 is not null then
490     --
491 	p_screen_entry_value7 := pay_input_values_pkg.decode_vset_value(
492 				fetched_entry_value.value_set_id,
493 				p_screen_entry_value7);
494     --
495     end if;
496     --
497   elsif entry_value_number = 8 then
498     --
499     p_uom8			:= fetched_entry_value.uom;
500     --
501     if fetched_entry_value.hot_default_flag = 'Y'
502     and fetched_entry_value.screen_entry_value is null then
503       --
504       p_screen_entry_value8	:= fetched_entry_value.hot_default_value;
505     else
506       p_screen_entry_value8 	:= fetched_entry_value.screen_entry_value;
507       --
508     end if;
509     --
510     if fetched_entry_value.lookup_type is not null
511     and p_screen_entry_value8 is not null then
512       --
513       p_screen_entry_value8	:= hr_general.decode_lookup
514 					(fetched_entry_value.lookup_type,
515 					p_screen_entry_value8);
516       --
517     end if;
518     --
519     if fetched_entry_value.value_set_id is not null
520     and p_screen_entry_value8 is not null then
521     --
522 	p_screen_entry_value8 := pay_input_values_pkg.decode_vset_value(
523 				fetched_entry_value.value_set_id,
524 				p_screen_entry_value8);
525     --
526     end if;
527     --
528   elsif entry_value_number = 9 then
529     --
530     p_uom9			:= fetched_entry_value.uom;
531     --
532     if fetched_entry_value.hot_default_flag = 'Y'
533     and fetched_entry_value.screen_entry_value is null then
534       --
535       p_screen_entry_value9	:= fetched_entry_value.hot_default_value;
536     else
537       p_screen_entry_value9 	:= fetched_entry_value.screen_entry_value;
538       --
539     end if;
540     --
541     if fetched_entry_value.lookup_type is not null
542     and p_screen_entry_value9 is not null then
543       --
544       p_screen_entry_value9	:= hr_general.decode_lookup
545 					(fetched_entry_value.lookup_type,
546 					p_screen_entry_value9);
547       --
548     end if;
549     --
550     if fetched_entry_value.value_set_id is not null
551     and p_screen_entry_value9 is not null then
552     --
553 	p_screen_entry_value9 := pay_input_values_pkg.decode_vset_value(
554 				fetched_entry_value.value_set_id,
555 				p_screen_entry_value9);
556     --
557     end if;
558     --
559   elsif entry_value_number = 10 then
560     --
561     p_uom10			:= fetched_entry_value.uom;
562     --
563     if fetched_entry_value.hot_default_flag = 'Y'
564     and fetched_entry_value.screen_entry_value is null then
565       --
566       p_screen_entry_value10	:= fetched_entry_value.hot_default_value;
567     else
568       p_screen_entry_value10 	:= fetched_entry_value.screen_entry_value;
569       --
570     end if;
571     --
572     if fetched_entry_value.lookup_type is not null
573     and p_screen_entry_value10 is not null then
574       --
575       p_screen_entry_value10	:= hr_general.decode_lookup
576 					(fetched_entry_value.lookup_type,
577 					p_screen_entry_value10);
578       --
579     end if;
580     --
581     if fetched_entry_value.value_set_id is not null
582     and p_screen_entry_value10 is not null then
583     --
584 	p_screen_entry_value10 := pay_input_values_pkg.decode_vset_value(
585 				fetched_entry_value.value_set_id,
586 				p_screen_entry_value10);
587     --
588     end if;
589     --
590   elsif entry_value_number = 11 then
591     --
592     p_uom11			:= fetched_entry_value.uom;
593     --
594     if fetched_entry_value.hot_default_flag = 'Y'
595     and fetched_entry_value.screen_entry_value is null then
596       --
597       p_screen_entry_value11	:= fetched_entry_value.hot_default_value;
598     else
599       p_screen_entry_value11 	:= fetched_entry_value.screen_entry_value;
600       --
601     end if;
602     --
603     if fetched_entry_value.lookup_type is not null
604     and p_screen_entry_value11 is not null then
605       --
606       p_screen_entry_value11	:= hr_general.decode_lookup
607 					(fetched_entry_value.lookup_type,
608 					p_screen_entry_value11);
609       --
610     end if;
611     --
612     if fetched_entry_value.value_set_id is not null
613     and p_screen_entry_value11 is not null then
614     --
615 	p_screen_entry_value11 := pay_input_values_pkg.decode_vset_value(
616 				fetched_entry_value.value_set_id,
617 				p_screen_entry_value11);
618     --
619     end if;
620     --
621   elsif entry_value_number = 12 then
622     --
623     p_uom12			:= fetched_entry_value.uom;
624     --
625     if fetched_entry_value.hot_default_flag = 'Y'
626     and fetched_entry_value.screen_entry_value is null then
627       --
628       p_screen_entry_value12	:= fetched_entry_value.hot_default_value;
629     else
630       p_screen_entry_value12 	:= fetched_entry_value.screen_entry_value;
631       --
632     end if;
633     --
634     if fetched_entry_value.lookup_type is not null
635     and p_screen_entry_value12 is not null then
636       --
637       p_screen_entry_value12	:= hr_general.decode_lookup
638 					(fetched_entry_value.lookup_type,
639 					p_screen_entry_value12);
640       --
641     end if;
642     --
643     if fetched_entry_value.value_set_id is not null
644     and p_screen_entry_value12 is not null then
645     --
646 	p_screen_entry_value12 := pay_input_values_pkg.decode_vset_value(
647 				fetched_entry_value.value_set_id,
648 				p_screen_entry_value12);
649     --
650     end if;
651     --
652   elsif entry_value_number = 13 then
653     --
654     p_uom13			:= fetched_entry_value.uom;
655     --
656     if fetched_entry_value.hot_default_flag = 'Y'
657     and fetched_entry_value.screen_entry_value is null then
658       --
659       p_screen_entry_value13	:= fetched_entry_value.hot_default_value;
660     else
661       p_screen_entry_value13 	:= fetched_entry_value.screen_entry_value;
662       --
663     end if;
664     --
665     if fetched_entry_value.lookup_type is not null
666     and p_screen_entry_value13 is not null then
667       --
668       p_screen_entry_value13	:= hr_general.decode_lookup
669 					(fetched_entry_value.lookup_type,
670 					p_screen_entry_value13);
671       --
672     end if;
673     --
674     if fetched_entry_value.value_set_id is not null
675     and p_screen_entry_value13 is not null then
676     --
677 	p_screen_entry_value13 := pay_input_values_pkg.decode_vset_value(
678 				fetched_entry_value.value_set_id,
679 				p_screen_entry_value13);
680     --
681     end if;
682     --
683   elsif entry_value_number = 14 then
684     --
685     p_uom14			:= fetched_entry_value.uom;
686     --
687     if fetched_entry_value.hot_default_flag = 'Y'
688     and fetched_entry_value.screen_entry_value is null then
689       --
690       p_screen_entry_value14	:= fetched_entry_value.hot_default_value;
691     else
692       p_screen_entry_value14 	:= fetched_entry_value.screen_entry_value;
693       --
694     end if;
695     --
696     if fetched_entry_value.lookup_type is not null
697     and p_screen_entry_value14 is not null then
698       --
699       p_screen_entry_value14	:= hr_general.decode_lookup
700 					(fetched_entry_value.lookup_type,
701 					p_screen_entry_value14);
702       --
703     end if;
704     --
705     if fetched_entry_value.value_set_id is not null
706     and p_screen_entry_value14 is not null then
707     --
708 	p_screen_entry_value14 := pay_input_values_pkg.decode_vset_value(
709 				fetched_entry_value.value_set_id,
710 				p_screen_entry_value14);
711     --
712     end if;
713     --
714   elsif entry_value_number = 15 then
715     --
716     p_uom15			:= fetched_entry_value.uom;
717     --
718     if fetched_entry_value.hot_default_flag = 'Y'
719     and fetched_entry_value.screen_entry_value is null then
720       --
721       p_screen_entry_value15	:= fetched_entry_value.hot_default_value;
722     else
723       p_screen_entry_value15 	:= fetched_entry_value.screen_entry_value;
724       --
725     end if;
726     --
727     if fetched_entry_value.lookup_type is not null
728     and p_screen_entry_value15 is not null then
729       --
730       p_screen_entry_value15	:= hr_general.decode_lookup
731 					(fetched_entry_value.lookup_type,
732 					p_screen_entry_value15);
733       --
734     end if;
735     --
736     if fetched_entry_value.value_set_id is not null
737     and p_screen_entry_value15 is not null then
738     --
739 	p_screen_entry_value15 := pay_input_values_pkg.decode_vset_value(
740 				fetched_entry_value.value_set_id,
741 				p_screen_entry_value15);
742     --
743     end if;
744     --
745   end if;
746   --
747 end loop;
748 --
749 end get_entry_details;
750 --------------------------------------------------------------------------------
751 procedure get_entry_details (
752 --
753 p_rows                  in out  nocopy number,
754 p_element_entry_id      in             number,
755 p_element_link_id       in             number,
756 p_assignment_id         in             number,
757 p_effective_end_date    in             date,
758 p_full_name             in out  nocopy varchar2,
759 p_assignment_number     in out  nocopy varchar2,
760 p_entry_value_tab       in out  nocopy SevTabType,
761 p_uom_tab               in out  nocopy UomTabType
762 ) is
763 --
764 cursor asgt_details is
765         --
766         select  person.full_name,
767                 asgt.assignment_number
768         from    per_people_f            PERSON,
769                 per_assignments_f2      ASGT
770         where   person.person_id        = asgt.person_id
771         and     asgt.assignment_id      = p_assignment_id
772         and     p_effective_end_date between asgt.effective_start_date
773                                         and asgt.effective_end_date
774         and     p_effective_end_date between person.effective_start_date
775                                         and person.effective_end_date;
776         --
777 cursor set_of_entry_values is
778         --
779         SELECT  b.screen_entry_value
780       , TYPE.uom
781       , TYPE.hot_default_flag
782       , TYPE.lookup_type
783       , TYPE.value_set_id
784       , nvl (b.default_value, TYPE.default_value) hot_default_value
785 FROM    (
786         SELECT  *
787         FROM    pay_input_values_f piv
788               , pay_element_links_f pil
789         WHERE   pil.element_type_id = piv.element_type_id
790         AND     pil.element_link_id = p_element_link_id
791         and     piv.effective_start_date =
792                 (select min (element.effective_start_date)
793                 from    pay_element_types_f     ELEMENT
794                 where   element.element_type_id = piv.element_type_id)
795         ) TYPE
796       ,
797         (
798         SELECT  entry.*
799               , link.default_value
800         FROM    pay_element_entry_values_f entry
801               , pay_link_input_values_f link
802         WHERE   element_entry_id = p_element_entry_id
803         AND     link.input_value_id = entry.input_value_id
804         AND     link.element_link_id = p_element_link_id
805         and     p_effective_end_date = entry.effective_end_date
806         and     p_effective_end_date between link.effective_start_date
807                                         and link.effective_end_date
808         ) b
809 WHERE   TYPE.input_value_id = b.input_value_id (+)
810 ORDER BY type.display_sequence
811        , type.name  ;
812         --
813 entry_value_number      integer;
814 --
815 begin
816 --
817 -- Retrieve the person's full name
818 --
819 open asgt_details;
820 fetch asgt_details into p_full_name, p_assignment_number;
821 close asgt_details;
822 --
823 -- Retrieve all the existing element entry values for the element entry
824 --
825 p_rows := 0;
826 for fetched_entry_value in set_of_entry_values LOOP
827   --
828   p_rows := p_rows + 1;
829   p_uom_tab(p_rows)         := fetched_entry_value.uom;
830   --
831   if fetched_entry_value.hot_default_flag = 'Y'
832   and fetched_entry_value.screen_entry_value is null then
833     --
834     p_entry_value_tab(p_rows) := fetched_entry_value.hot_default_value;
835   else
836     --
837     p_entry_value_tab(p_rows) := fetched_entry_value.screen_entry_value;
838   end if;
839   --
840   if fetched_entry_value.lookup_type is not null
841   and p_entry_value_tab(p_rows) is not null then
842     --
843     p_entry_value_tab(p_rows) := hr_general.decode_lookup
844                                         (fetched_entry_value.lookup_type,
845                                          p_entry_value_tab(p_rows));
846     --
847   end if;
848   --
849   -- Bug # 5199669. Added to support the value sets.
850   if fetched_entry_value.value_set_id is not null
851   and p_entry_value_tab(p_rows) is not null then
852   --
853     p_entry_value_tab(p_rows) := pay_input_values_pkg.decode_vset_value(
854 				fetched_entry_value.value_set_id,
855 				p_entry_value_tab(p_rows));
856   --
857   end if;
858   --
859 end loop;
860 --
861 end get_entry_details;
862 
863 --
864 end PAY_PAYWSLEE_PKG;