DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_SF52_PRE_UPDATE

Source


1 PACKAGE BODY GHR_SF52_PRE_UPDATE AS
2 /* $Header: gh52prup.pkb 120.34.12010000.3 2008/09/24 06:22:06 vmididho ship $ */
3 g_effective_date      date;
4 --
5 
6 PROCEDURE get_auth_codes
7 (p_pa_req_rec		IN		ghr_pa_requests%rowtype,
8  p_pei_auth_code1	IN		per_people_extra_info.pei_information1%type DEFAULT hr_api.g_varchar2,
9  p_pei_auth_code2	IN		per_people_extra_info.pei_information1%type DEFAULT hr_api.g_varchar2,
10  p_auth_code1		IN OUT	nocopy per_people_extra_info.pei_information1%type,
11  p_auth_code2		IN OUT nocopy	per_people_extra_info.pei_information1%type)
12 IS
13 l_proc                  varchar2(70) := 'get_auth_codes';
14 l_pei_extra_info		per_people_extra_info%rowtype;
15 
16 BEGIN
17 
18 	hr_utility.set_location('Entering: ' || l_proc, 10);
19 	if (p_pa_req_rec.noa_family_code not in ('CONV_APP','APP','APPT_TRANS') ) then
20 		if (p_pei_auth_code1 = hr_api.g_varchar2) then
21     			ghr_history_fetch.fetch_peopleei(p_person_id      	=> p_pa_req_rec.person_id
22      		                                 	   ,p_information_type 	=> 'GHR_US_PER_GROUP1'
23      		                                 	   ,p_date_effective    => p_pa_req_rec.effective_date
24            		                           	   ,p_per_ei_data       => l_pei_extra_info);
25 			p_auth_code1	:= 	l_pei_extra_info.pei_information8;
26 			p_auth_code2	:= 	l_pei_extra_info.pei_information9;
27 		else
28 			p_auth_code1	:= 	p_pei_auth_code1;
29 			p_auth_code2	:= 	p_pei_auth_code2;
30 		end if;
31 	else
32 		p_auth_code1	:= 	p_pa_req_rec.first_action_la_code1;
33 		p_auth_code2	:= 	p_pa_req_rec.first_action_la_code2;
34 	end if;
35 	hr_utility.set_location('Leaving: ' || l_proc, 20);
36 END;
37 
38 
39 -- *************************
40 --
41 --	This procedure retrieve data from HR extra information tables and all other data required for CPDF Validations
42 --
43 Procedure populate_record_groups
44 (p_pa_request_rec             in out nocopy ghr_pa_requests%rowtype,
45  p_generic_ei_rec             in     ghr_pa_request_extra_info%rowtype,
46  p_imm_asg_sf52                  out nocopy ghr_api.asg_sf52_type,
47  p_imm_asg_non_sf52              out nocopy ghr_api.asg_non_sf52_type,
48  p_imm_asg_nte_dates             out nocopy ghr_api.asg_nte_dates_type,
49  p_imm_per_sf52                  out nocopy ghr_api.per_sf52_type,
50  p_imm_per_group1                out nocopy ghr_api.per_group1_type,
51  p_imm_per_group2                out nocopy ghr_api.per_group2_type,
52  p_imm_per_scd_info              out nocopy ghr_api.per_scd_info_type,
53  p_imm_per_retained_grade        out nocopy ghr_api.per_retained_grade_type,
54  p_imm_per_probations            out nocopy ghr_api.per_probations_type,
55  p_imm_per_sep_retire            out nocopy ghr_api.per_sep_retire_type,
56  p_imm_per_security		   		 out nocopy ghr_api.per_security_type,
57  -- Bug#4486823 RRR Changes Added p_imm_per_service_oblig
58  p_imm_per_service_oblig         out nocopy ghr_api.per_service_oblig_type,
59  p_imm_per_conversions		     out nocopy ghr_api.per_conversions_type,
60  -- 4352589 BEN_EIT Changes
61  p_imm_per_benefit_info	         out nocopy ghr_api.per_benefit_info_type,
62  p_imm_per_uniformed_services    out nocopy ghr_api.per_uniformed_services_type,
63  p_imm_pos_oblig                 out nocopy ghr_api.pos_oblig_type,
64  p_imm_pos_grp2                  out nocopy ghr_api.pos_grp2_type,
65  p_imm_pos_grp1                  out nocopy ghr_api.pos_grp1_type,
66  p_imm_pos_valid_grade           out nocopy ghr_api.pos_valid_grade_type,
67  p_imm_pos_car_prog              out nocopy ghr_api.pos_car_prog_type,
68  p_imm_loc_info                  out nocopy ghr_api.loc_info_type,
69  p_imm_wgi     	                 out nocopy ghr_api.within_grade_increase_type,
70  p_imm_gov_awards                out nocopy ghr_api.government_awards_type,
71  p_imm_recruitment_bonus         out nocopy ghr_api.recruitment_bonus_type,
72  p_imm_relocation_bonus		     out nocopy ghr_api.relocation_bonus_type,
73  p_imm_student_loan_repay        out nocopy ghr_api.student_loan_repay_type,
74  -- Bug 4724337 Race or National Origin changes
75  p_imm_per_race_ethnic_info      out nocopy ghr_api.per_race_ethnic_type,
76  -- End race and National Origin changes
77  --Pradeep
78  p_imm_mddds_special_pay         out nocopy ghr_api.mddds_special_pay_type,
79  p_imm_premium_pay_ind           out nocopy ghr_api.premium_pay_ind_type,
80 
81  p_imm_payroll_type              out nocopy ghr_api.government_payroll_type,
82  p_imm_perf_appraisal            out nocopy ghr_api.performance_appraisal_type,
83  p_imm_conduct_performance       out nocopy ghr_api.conduct_performance_type,
84  p_imm_extra_info_rec	 	   out nocopy ghr_api.extra_info_rec_type,
85  p_imm_sf52_from_data            out nocopy ghr_api.prior_sf52_data_type,
86  p_imm_personal_info		   out nocopy ghr_api.personal_info_type,
87  p_imm_generic_extra_info_rec    out nocopy ghr_api.generic_extra_info_rec_type,
88  p_imm_agency_sf52		   out nocopy ghr_api.agency_sf52_type,
89  p_imm_par_term_retained_grade   out nocopy ghr_api.par_term_retained_grade_type,
90  p_imm_entitlement               out nocopy ghr_api.entitlement_type,
91  -- Bug#2759379 Added Fegli record
92  p_imm_fegli                     out nocopy ghr_api.fegli_type,
93  p_imm_foreign_lang_prof_pay     out nocopy ghr_api.foreign_lang_prof_pay_type,
94   -- Bug#3385386 Added FTA record
95  p_imm_fta                        out nocopy ghr_api.fta_type,
96  p_imm_edp_pay                   out nocopy ghr_api.edp_pay_type,
97  p_imm_hazard_pay                out nocopy ghr_api.hazard_pay_type,
98  p_imm_health_benefits           out nocopy ghr_api.health_benefits_type,
99  p_imm_danger_pay                out nocopy ghr_api.danger_pay_type,
100  p_imm_imminent_danger_pay       out nocopy ghr_api.imminent_danger_pay_type,
101  p_imm_living_quarters_allow     out nocopy ghr_api.living_quarters_allow_type,
102  p_imm_post_diff_amt             out nocopy ghr_api.post_diff_amt_type,
103  p_imm_post_diff_percent         out nocopy ghr_api.post_diff_percent_type,
104  p_imm_sep_maintenance_allow     out nocopy ghr_api.sep_maintenance_allow_type,
105  p_imm_supplemental_post_allow   out nocopy ghr_api.supplemental_post_allow_type,
106  p_imm_temp_lodge_allow          out nocopy ghr_api.temp_lodge_allow_type,
107  p_imm_premium_pay               out nocopy ghr_api.premium_pay_type,
108  p_imm_retirement_annuity        out nocopy ghr_api.retirement_annuity_type,
109  p_imm_severance_pay             out nocopy ghr_api.severance_pay_type,
110  p_imm_thrift_saving_plan        out nocopy ghr_api.thrift_saving_plan,
111  p_imm_retention_allow_review    out nocopy ghr_api.retention_allow_review_type,
112  p_imm_health_ben_pre_tax           out nocopy ghr_api.health_ben_pre_tax_type,
113  p_agency_code			 out nocopy varchar2,
114  -- Bug#6312144 Added new RPA Benefit EIT
115  p_imm_ipa_benefits_cont         out nocopy ghr_api.per_ipa_ben_cont_info_type,
116  p_imm_retirement_info           out nocopy ghr_api.per_retirement_info_type
117  )
118 is
119 
120 -- Cursor to select the person's sex which is required for CPDF Edits
121 
122  cursor      c_person_sex is
123    select    per.sex
124    from      per_all_people_f per
125    where     per.person_id = P_pa_request_rec.person_id
126    and       g_effective_date
127    between   per.effective_start_date
128    and       per.effective_end_date;
129 
130 -- Cursor to select the Payrollname ,as entered by the user from the SF52 Extra Information.
131 
132  Cursor c_payroll_name is
133    select rei_information3 payroll_name
134    from   ghr_pa_request_extra_info
135    where  pa_request_id       =   p_pa_request_rec.pa_request_id
136    and    information_type    =   'GHR_US_PAR_PAYROLL_TYPE';
137 
138 -- Cursor to select the Rating Details of the person, required for CPDFs and for update to HR
139 
140  Cursor c_performance_appraisal is
141    select rei_information3 rat_rec,
142           rei_information4 rec_pattern,
143           rei_information5 rec_level,
144           rei_information6 app_ends,
145           rei_information7 app_type,
146           rei_information8 date_init_appr_due,
147           rei_information9  date_effective,
148           rei_information10 unit,
149           rei_information11 org_str_id,
150           rei_information12 off_symbol,
151           rei_information13 pay_plan,
152           rei_information14 grade,
153           rei_information15 date_due,
154           rei_information16 appr_sys_ident,
155           rei_information17 optional_info,
156 	  rei_information18 performance_rating_points,
157 	  rei_information19 app_starts
158    from   ghr_pa_request_extra_info
159    where  pa_request_id       =   p_pa_request_rec.pa_request_id
160    and    information_type    =   'GHR_US_PAR_PERF_APPRAISAL';
161 
162 -- cursor to select the Conduct Performace of the person. (is it required for CPDFs??, sureis required for the reqd_Check)
163 -- is not reqd. as it is not a generic extra info, rather the extra info associated with a
164 -- specific NOA and hence should be available already in the passed parameter.
165 
166  cursor   c_person_type is
167    select  ppt.system_person_type
168    from    per_person_types  ppt,
169            per_all_people_f      ppf
170    where   ppf.person_id       =  p_pa_request_rec.person_id
171    and     ppt.person_type_id  =  ppf.person_type_id
172    and     p_pa_request_rec.effective_date
173    between ppf.effective_start_date
174    and     ppf.effective_end_date;
175 
176  cursor cur_asg_prior_date is
177    Select asg.effective_start_date
178    from   per_all_assignments_f asg
179    Where  asg.assignment_id = p_pa_request_rec.employee_assignment_id
180    order by 1 desc;
181 
182  l_imm_asg_sf52                    		ghr_api.asg_sf52_type;
183  l_imm_asg_non_sf52                		ghr_api.asg_non_sf52_type;
184  l_imm_asg_nte_dates               		ghr_api.asg_nte_dates_type;
185  l_imm_per_sf52                   		ghr_api.per_sf52_type;
186  l_imm_per_group1                		ghr_api.per_group1_type;
187  l_imm_per_group2                		ghr_api.per_group2_type;
188  l_imm_per_scd_info                		ghr_api.per_scd_info_type;
189  l_imm_per_retained_grade               ghr_api.per_retained_grade_type;
190  l_imm_per_probations             		ghr_api.per_probations_type;
191  l_imm_per_sep_retire              		ghr_api.per_sep_retire_type;
192  l_imm_per_security		         	    ghr_api.per_security_type;
193  -- Bug#4486823 RRR changes
194  l_imm_per_service_oblig                ghr_api.per_service_oblig_type;
195  l_imm_per_conversions		 	        ghr_api.per_conversions_type;
196  -- 4352589 BEN_EIT Changes
197  l_imm_per_benefit_info	                ghr_api.per_benefit_info_type;
198  l_imm_per_uniformed_services   		ghr_api.per_uniformed_services_type;
199  l_imm_pos_oblig                   		ghr_api.pos_oblig_type;
200  l_imm_pos_grp2                   		ghr_api.pos_grp2_type;
201  l_imm_pos_grp1                    		ghr_api.pos_grp1_type;
202  l_imm_pos_valid_grade                  ghr_api.pos_valid_grade_type;
203  l_imm_pos_car_prog                     ghr_api.pos_car_prog_type;
204  l_imm_loc_info                         ghr_api.loc_info_type;
205  l_imm_wgi     	                        ghr_api.within_grade_increase_type ;
206  l_imm_gov_awards                       ghr_api.government_awards_type;
207  l_imm_recruitment_bonus		        ghr_api.recruitment_bonus_type ;
208  l_imm_relocation_bonus		            ghr_api.relocation_bonus_type;
209   l_imm_student_loan_repay              ghr_api.student_loan_repay_type;
210 
211  l_imm_extra_info_rec	 	            ghr_api.extra_info_rec_type;
212  l_asg_extra_info_rec                   per_assignment_extra_info%rowtype;
213  l_pos_extra_info_rec                   per_position_extra_info%rowtype;
214  l_imm_sf52_from_data                   ghr_api.prior_sf52_data_type;
215  l_imm_personal_info		            ghr_api.personal_info_type;
216  l_imm_generic_extra_info_rec	        ghr_api.generic_extra_info_rec_type;
217  l_imm_agency_sf52		                ghr_api.agency_sf52_type;
218  l_imm_payroll_type                     ghr_api.government_payroll_type;
219  l_imm_perf_appraisal                   ghr_api.performance_appraisal_type;
220  l_imm_conduct_performance              ghr_api.conduct_performance_type;
221  l_imm_entitlement                      ghr_api.entitlement_type;
222  --Bug#2759379 Added Fegli record
223  l_imm_fegli                            ghr_api.fegli_type;
224  l_imm_foreign_lang_prof_pay            ghr_api.foreign_lang_prof_pay_type;
225  -- Bug#3385386 declared FTA record type variable
226  l_imm_fta				                ghr_api.fta_type;
227  l_imm_edp_pay                          ghr_api.edp_pay_type;
228  l_imm_hazard_pay                       ghr_api.hazard_pay_type;
229  l_imm_health_benefits                  ghr_api.health_benefits_type;
230  l_imm_danger_pay                       ghr_api.danger_pay_type;
231  l_imm_imminent_danger_pay              ghr_api.imminent_danger_pay_type;
232  l_imm_living_quarters_allow            ghr_api.living_quarters_allow_type;
233  l_imm_post_diff_amt                    ghr_api.post_diff_amt_type;
234  l_imm_post_diff_percent                ghr_api.post_diff_percent_type;
235  l_imm_sep_maintenance_allow            ghr_api.sep_maintenance_allow_type;
236  l_imm_supplemental_post_allow          ghr_api.supplemental_post_allow_type;
237  l_imm_temp_lodge_allow                 ghr_api.temp_lodge_allow_type;
238  l_imm_premium_pay                      ghr_api.premium_pay_type;
239  l_imm_retirement_annuity               ghr_api.retirement_annuity_type;
240  l_imm_severance_pay                    ghr_api.severance_pay_type;
241  l_imm_thrift_saving_plan               ghr_api.thrift_saving_plan;
242  l_imm_retention_allow_review           ghr_api.retention_allow_review_type;
243  l_imm_health_ben_pre_tax               ghr_api.health_ben_pre_tax_type;
244  l_agency_code			                varchar2(50);
245  l_special_info_type                    ghr_api.special_information_type;
246  l_imm_par_term_retained_grade            ghr_api.par_term_retained_grade_type;
247  l_session                                ghr_history_api.g_session_var_type;
248  l_asg_ei_data                            per_assignment_extra_info%rowtype;
249  l_assignment_data                        per_all_assignments_f%rowtype;
250  l_result_code                            varchar2(50);
251  l_person_type                            per_person_types.system_person_type%type;
252  l_effective_date                         date;
253  -- Bug#4054110
254  l_temp_rec_level                        varchar2(30);
255  --Pradeep
256  l_imm_mddds_special_pay			  		ghr_api.mddds_special_pay_type;
257  l_imm_premium_pay_ind  			  		ghr_api.premium_pay_ind_type;
258  l_imm_per_race_ethnic_info 				ghr_api.per_race_ethnic_type; -- Bug 4724337 Race or National Origin changes
259  l_imm_ipa_benefits_cont                  ghr_api.per_ipa_ben_cont_info_type;
260  l_imm_retirement_info                    ghr_api.per_retirement_info_type;
261 
262 
263 
264 Begin
265 
266   hr_utility.set_location('PERSON ID  : ' ||to_char(p_pa_request_rec.person_id) ,1);
267   hr_utility.set_location('EMP    ID  : ' ||to_char(p_pa_request_rec.employee_assignment_id) ,2);
268   hr_utility.set_location('POS    ID  : ' ||to_char(p_pa_request_rec.to_position_id) ,3);
269 
270 
271   --  Retrieve all the extra information (required for CPDFs and for update to HR)
272   --  from the Core Tables and store them in the respective Record Groups
273 
274 
275   -- NOTE :
276   -- Should include the foll. 2 statements after changing these 2 parameters as in rather than out
277   -- l_imm_extra_info_rec                  :=  p_imm_extra_info_rec;
278   -- l_imm_generic_extra_info_rec          :=  p_imm_generic_extra_info_rec;
279 
280  Retrieve_all_extra_info
281  (
282   p_pa_request_rec                     => p_pa_request_rec,
283   p_asg_sf52                           => l_imm_asg_sf52,
284   p_per_sf52                           => l_imm_per_sf52,
285   p_per_group1                         => l_imm_per_group1,
286   p_per_scd_info                       => l_imm_per_scd_info,
287   p_pos_grp1                           => l_imm_pos_grp1,
288   p_pos_grp2                           => l_imm_pos_grp2,
289   p_loc_info                           => l_imm_loc_info,
290   p_per_uniformed_services             => l_imm_per_uniformed_services,
291   p_per_conversions                    => l_imm_per_conversions,
292   p_per_benefit_info                   => l_imm_per_benefit_info,
293   p_asg_non_sf52		       => l_imm_asg_non_sf52,
294   p_per_separate_Retire 	       => l_imm_per_sep_retire,
295   p_asg_nte_dates		       => l_imm_asg_nte_dates,
296   p_per_probations		       => l_imm_per_probations,
297   p_per_retained_grade		       => l_imm_per_retained_grade,
298   --Bug#4486823 RRR Changes
299   p_per_service_oblig                  => l_imm_per_service_oblig,
300   p_within_grade_increase	       => l_imm_wgi,
301   p_valid_grade                        => l_imm_pos_valid_grade,
302   p_pos_oblig                          => l_imm_pos_oblig,
303   p_race_ethnic_info		       => l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
304   p_ipa_benefits_cont                  => l_imm_ipa_benefits_cont,  -- Bug #6312144 retreiving benefits information
305   p_retirement_info                    => l_imm_retirement_info
306   );
307 
308  -- Over write the Record Groups populated by the Retrieve_all_extra_info,
309  -- with the non-null Data on the SF52 form
310 
311  process_sf52_extra_info
312  (
313  p_pa_request_rec                      => p_pa_request_rec,
314  p_asg_sf52                    	   => l_imm_asg_sf52,
315  p_per_sf52                            => l_imm_per_sf52,
316  p_per_group1                 	   => l_imm_per_group1,
317  p_per_scd_info                        => l_imm_per_scd_info,
318  p_pos_grp2                            => l_imm_pos_grp2,
319  p_pos_grp1                            => l_imm_pos_grp1,
320  p_loc_info                            => l_imm_loc_info,
321  p_recruitment_bonus	               => l_imm_recruitment_bonus,
322  p_relocation_bonus	               => l_imm_relocation_bonus ,
323   p_student_loan_repay                  => l_imm_student_loan_repay,
324  p_extra_info_rec		               => l_imm_extra_info_rec,
325  p_valid_grade                        => l_imm_pos_valid_grade
326  );
327 
328  -- Over write the Record Groups populated by the Retrieve_all_extra_info,
329  -- with the non-null Data on the SF52 Extra Information form
330  Process_Non_Sf52_Extra_Info
331 (
332  p_pa_request_rec	          => p_pa_request_rec,
333  p_generic_ei_rec             => p_generic_ei_rec,
334  p_per_group1	       		  => l_imm_per_group1,
335  p_per_scd_info               => l_imm_per_scd_info,
336  p_pos_grp2                   => l_imm_pos_grp2,
337  p_pos_grp1                   => l_imm_pos_grp1,
338  p_per_uniformed_services     => l_imm_per_uniformed_services,
339  p_per_conversions            => l_imm_per_conversions,
340  -- 4352589 BEN_EIT Changes
341  p_per_benefit_info           => l_imm_per_benefit_info,
342  p_asg_non_sf52		      	  => l_imm_asg_non_sf52,
343  p_per_separate_Retire 	      => l_imm_per_sep_retire,
344  p_asg_nte_dates	          => l_imm_asg_nte_dates,
345  p_per_probations      	      => l_imm_per_probations,
346  p_per_retained_grade 	      => l_imm_per_retained_grade,
347  --Bug#4486823 RRR Changes
348  p_per_service_oblig          => l_imm_per_service_oblig,
349  p_within_grade_increase      => l_imm_wgi,
350  p_gov_awards                 => l_imm_gov_awards,
351  p_conduct_performance        => l_imm_conduct_performance,
352  p_agency_sf52		      	  => l_imm_agency_sf52,
353  p_recruitment_bonus	      => l_imm_recruitment_bonus,
354  p_relocation_bonus	          => l_imm_relocation_bonus,
355  p_student_loan_repay         => l_imm_student_loan_repay,
356  --Pradeep
357  p_mddds_special_pay      => l_imm_mddds_special_pay,
358  p_premium_pay_ind        => l_imm_premium_pay_ind,
359 
360  p_par_term_retained_grade    => l_imm_par_term_retained_grade,
361  p_entitlement                => l_imm_entitlement,
362  -- Bug#2759379 Added Fegli record
363  p_fegli                      => l_imm_fegli,
364  p_foreign_lang_prof_pay      => l_imm_foreign_lang_prof_pay,
365   -- Bug#3385386 Added FTA parameter
366  p_imm_fta                    => l_imm_fta,
367  p_edp_pay                    => l_imm_edp_pay,
368  p_hazard_pay                 => l_imm_hazard_pay,
369  p_health_benefits            => l_imm_health_benefits,
370  p_danger_pay                 => l_imm_danger_pay,
371  p_imminent_danger_pay        => l_imm_imminent_danger_pay,
372  p_living_quarters_allow      => l_imm_living_quarters_allow,
373  p_post_diff_amt              => l_imm_post_diff_amt,
374  p_post_diff_percent          => l_imm_post_diff_percent,
375  p_sep_maintenance_allow      => l_imm_sep_maintenance_allow,
376  p_supplemental_post_allow    => l_imm_supplemental_post_allow,
377  p_temp_lodge_allow           => l_imm_temp_lodge_allow,
378  p_premium_pay                => l_imm_premium_pay,
379  p_retirement_annuity         => l_imm_retirement_annuity,
380  p_severance_pay              => l_imm_severance_pay,
381  p_thrift_saving_plan         => l_imm_thrift_saving_plan,
382  p_retention_allow_review     => l_imm_retention_allow_review,
383  p_health_ben_pre_tax         => l_imm_health_ben_pre_tax,
384  p_race_ethnic_info	      => l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
385  p_ipa_benefits_cont          => l_imm_ipa_benefits_cont,  -- Bug #6312144 retreiving benefits information
386  p_retirement_info            => l_imm_retirement_info
387  );
388 
389  hr_utility.set_location('Relocation Bonus ' || l_imm_relocation_bonus.p_relocation_bonus,1);
390  hr_utility.set_location('Relocation EXP ' || l_imm_relocation_bonus.p_date_reloc_exp,2);
391  hr_utility.set_location('Recruitment EXP ' || l_imm_recruitment_bonus.p_date_recruit_exp,3);
392 
393 
394  -- With the new ghr_pa_requests table, we just need to fetch the agency_code.
395  -- And this info. is required by CPDF edits and later by the SF50 Report
396 
397  SF52_br_extra_info
398  (P_PA_REQUEST_REC  		=> p_pa_request_rec,
399   p_agency_code			=> l_agency_code
400  );
401 
402   -- Get the from_pay_rate_determinant(aei for the given assignment_id and
403   -- information_type = 'GHR_US_ASG_SF52' and the work schedule (poei for
404   -- the given assignment_id and information_type = 'GHR_US_ASG_SF52'
405 
406  If p_pa_request_rec.from_position_id is not null then
407 
408    ghr_history_api.get_g_session_var(l_session);
409    Ghr_History_Fetch.Fetch_ASGEI_prior_root_sf50
410    (
411     p_assignment_id         => p_pa_request_rec.employee_assignment_id,
412     p_information_type      => 'GHR_US_ASG_SF52',
413     p_date_effective        => p_pa_request_rec.effective_date,
414     p_altered_pa_request_id => l_session.altered_pa_request_id,
415     p_noa_id_corrected      => l_session.noa_id_correct,
416     p_get_ovn_flag          => 'Y',
417     p_asgei_data            => l_asg_ei_data
418    );
419 
420     l_imm_sf52_from_data.work_schedule          :=   l_asg_ei_data.aei_information7;
421     l_imm_sf52_from_data.pay_rate_determinant   :=   l_asg_ei_data.aei_information6;
422 
423 
424    ghr_history_api.get_g_session_var(l_session);
425    for person_type_rec in c_person_type loop
426       l_person_type :=   person_type_rec.system_person_type;
427       exit;
428    end loop;
429 
430 -- Bug# 1223662 --
431    If p_pa_request_rec.noa_family_code = 'CONV_APP' and  l_person_type = 'EX_EMP'
432       then
433       for  asg_prior_date in cur_asg_prior_date loop
434          l_effective_date := asg_prior_date.effective_start_date;
435          exit;
436       end loop;
437    Else
438      l_effective_date := p_pa_request_rec.effective_date;
439    End if;
440    hr_utility.set_location('l_effective_date passed to fetch_assignment '||l_effective_date,3 );
441 
442    Ghr_History_Fetch.Fetch_assignment
443    (
444     p_assignment_id         => p_pa_request_rec.employee_assignment_id,
445     p_date_effective        => l_effective_date,
446     p_altered_pa_request_id => l_session.altered_pa_request_id,
447     p_noa_id_corrected      => l_session.noa_id_correct,
448     p_assignment_data       => l_assignment_data,
449     p_result_code           => l_result_code
450    );
451     l_imm_sf52_from_data.duty_station_location_id   :=   l_assignment_data.location_id;
452 
453  End if;
454 
455  hr_utility.set_location('from_duty_station '||l_imm_sf52_from_data.duty_station_location_id,4 );
456 
457 
458 -- Should retrieve Employee_sex(per_people_f for the person_id , for a specific date),
459 --  as it is not stored in the ghr_pa_requests table
460 
461  For per_sex in c_person_sex loop
462    l_imm_personal_info.p_sex  :=  per_sex.sex;
463  End loop;
464 
465 -- Other person details and from side data required for the CPDFs
466 
467 l_imm_personal_info.p_national_identifier    := p_pa_request_rec.employee_national_identifier ;
468 l_imm_personal_info.p_date_of_birth          := p_pa_request_rec.employee_date_of_birth;
469 --
470 l_imm_sf52_from_data.position_title          :=  p_pa_request_rec.from_position_title;
471 l_imm_sf52_from_data.position_number         :=  p_pa_request_rec.from_position_number;
472 l_imm_sf52_from_data.position_seq_no         :=  p_pa_request_rec.from_position_seq_no;
473 l_imm_sf52_from_data.pay_plan                :=  p_pa_request_rec.from_pay_plan;
474 l_imm_sf52_from_data.occ_code                :=  p_pa_request_rec.from_occ_code;
475 l_imm_sf52_from_data.grade_or_level          :=  p_pa_request_rec.from_grade_or_level;
476 l_imm_sf52_from_data.step_or_rate            :=  p_pa_request_rec.from_step_or_rate;
477 l_imm_sf52_from_data.total_salary            :=  p_pa_request_rec.from_total_salary;
478 l_imm_sf52_from_data.pay_basis               :=  p_pa_request_rec.from_pay_basis;
479 l_imm_sf52_from_data.basic_pay               :=  p_pa_request_rec.from_basic_pay;
480 l_imm_sf52_from_data.locality_adj            :=  p_pa_request_rec.from_locality_adj;
481 l_imm_sf52_from_data.adj_basic_pay           :=  p_pa_request_rec.from_adj_basic_pay;
482 l_imm_sf52_from_data.other_pay               :=  p_pa_request_rec.from_other_pay_amount;
483 l_imm_sf52_from_data.position_org_line1      :=  p_pa_request_rec.from_position_org_line1;
484 l_imm_sf52_from_data.position_org_line2      :=  p_pa_request_rec.from_position_org_line2;
485 l_imm_sf52_from_data.position_org_line3      :=  p_pa_request_rec.from_position_org_line3;
486 l_imm_sf52_from_data.position_org_line4      :=  p_pa_request_rec.from_position_org_line4;
487 l_imm_sf52_from_data.position_org_line5      :=  p_pa_request_rec.from_position_org_line5;
488 l_imm_sf52_from_data.position_org_line6      :=  p_pa_request_rec.from_position_org_line6;
489 l_imm_sf52_from_data.position_id             :=  p_pa_request_rec.from_position_id;
490 --
491 
492 --location_info
493 l_imm_loc_info.duty_station_id               :=  p_pa_request_rec.duty_station_id;
494 
495 -- Populate payroll_type
496 
497  for payroll_name in c_payroll_name loop
498    l_imm_payroll_type.payroll_type   :=   payroll_name.payroll_name;
499  End loop;
500 
501 
502  --
503  -- Take care of performance appraisal special info. (l_imm_perf_appraisal )
504  --
505  -- get the session variable
506  ghr_history_api.get_g_session_var(l_session);
507 
508  If l_session.noa_id_correct is null then
509     hr_utility.set_location('populate_record_groups ', 30);
510 
511     ghr_api.return_special_information
512     (p_person_id         =>  p_pa_request_rec.person_id,
513      p_structure_name    =>  'US Fed Perf Appraisal',
514      p_effective_date    =>  p_pa_request_rec.effective_date,
515      p_special_info      =>  l_special_info_type
516      );
517 
518  Else -- for update get from history
519     hr_utility.set_location('populate_record_groups ', 35);
520     ghr_history_fetch.return_special_information
521      (p_person_id         =>  p_pa_request_rec.person_id,
522       p_structure_name    =>  'US Fed Perf Appraisal',
523       p_effective_date    =>  p_pa_request_rec.effective_date,
524       p_special_info      =>  l_special_info_type
525       );
526 
527   --Added the below call for the Bug 3187894
528 
529     GHR_NON_SF52_EXTRA_INFO.fetch_generic_extra_info(
530      p_pa_request_id       =>  p_pa_request_rec.pa_request_id,
531      p_person_id           =>  p_pa_request_rec.person_id,
532      p_assignment_id       =>  p_pa_request_rec.employee_assignment_id,
533      p_effective_date      =>  p_pa_request_rec.effective_date
534      ) ;
535 
536  End if;
537 
538  l_imm_perf_appraisal.person_analysis_id             := l_special_info_type.person_analysis_id;
539  l_imm_perf_appraisal.object_version_number          := l_special_info_type.object_version_number;
540  l_imm_perf_appraisal.appraisal_type                 := l_special_info_type.segment1;
541  l_imm_perf_appraisal.rating_rec                     := l_special_info_type.segment2;
542  l_imm_perf_appraisal.date_effective                 := l_special_info_type.segment3;
543  l_imm_perf_appraisal.rating_rec_pattern             := l_special_info_type.segment4;
544  l_imm_perf_appraisal.rating_rec_level               := l_special_info_type.segment5;
545  l_imm_perf_appraisal.date_appr_ends                 := l_special_info_type.segment6;
546  l_imm_perf_appraisal.unit                           := l_special_info_type.segment7;
547  l_imm_perf_appraisal.org_structure_id               := l_special_info_type.segment8;
548  l_imm_perf_appraisal.office_symbol                  := l_special_info_type.segment9;
549  l_imm_perf_appraisal.pay_plan                       := l_special_info_type.segment10;
550  l_imm_perf_appraisal.grade                          := l_special_info_type.segment11;
551  l_imm_perf_appraisal.date_due                       := l_special_info_type.segment12;
552  l_imm_perf_appraisal.appraisal_system_identifier    := l_special_info_type.segment13;
553  l_imm_perf_appraisal.date_init_appr_due             := l_special_info_type.segment14;
554  l_imm_perf_appraisal.optional_information           := l_special_info_type.segment15;
555  l_imm_perf_appraisal.performance_rating_points      := l_special_info_type.segment16;
556  --Bug# 4753117 28-Feb-07	Veeramani  assigning appraisal start date
557  l_imm_perf_appraisal.date_appr_starts               := l_special_info_type.segment17;
558 
559  hr_utility.set_location('performance_rating_points'||l_special_info_type.segment16, 39);
560  -- Get user entered details
561  hr_utility.set_location('populate_record_groups ', 40);
562 
563  for perf_appraisal in c_performance_appraisal loop
564 
565   --No need for the IF condition since 'US Fed Perf Appraisal' is a mandatory SIT
566   --Bug 3187894 Commented by Ashley
567 
568     /* if perf_appraisal.rat_rec is not null            or
569         perf_appraisal.rec_pattern is not null        or
570         perf_appraisal.rec_level is not null          or
571         perf_appraisal.app_ends is not null           or
572         perf_appraisal.app_type is not null           or
573         perf_appraisal.date_init_appr_due is not null or
574         perf_appraisal.date_effective is not null or
575         perf_appraisal.unit is not null or
576         perf_appraisal.org_str_id is not null or
577         perf_appraisal.off_symbol is not null or
578         perf_appraisal.pay_plan is not null or
579         perf_appraisal.grade is not null or
580         perf_appraisal.date_due is not null or
581         perf_appraisal.appr_sys_ident is not null or
582         perf_appraisal.optional_info is not null  or
583 	perf_appraisal.performance_rating_points is not null then*/
584 
585 	  if nvl(perf_appraisal.rat_rec,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.rating_rec,hr_api.g_varchar2) then
586         l_imm_perf_appraisal.rating_rec         := perf_appraisal.rat_rec;
587         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
588      end if;
589      if nvl(perf_appraisal.rec_pattern,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.rating_rec_pattern,hr_api.g_varchar2) then
590         l_imm_perf_appraisal.rating_rec_pattern := perf_appraisal.rec_pattern;
591         l_imm_perf_appraisal.perf_appr_flag := 'Y';
592      end if;
593 
594      -- Reverted the changes done by Pradeep for bug#4054110.
595      if nvl(perf_appraisal.rec_level,hr_api.g_varchar2)       <> nvl(l_imm_perf_appraisal.rating_rec_level,hr_api.g_varchar2) then
596 	l_imm_perf_appraisal.rating_rec_level   := perf_appraisal.rec_level;
597         l_imm_perf_appraisal.perf_appr_flag := 'Y';
598      end if;
599 
600      if nvl(perf_appraisal.app_ends,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_appr_ends,hr_api.g_varchar2) then
601         l_imm_perf_appraisal.date_appr_ends     :=  perf_appraisal.app_ends;
602         l_imm_perf_appraisal.perf_appr_flag := 'Y';
603      end if;
604        --Bug# 4753117 28-Feb-07	Veeramani  assigning appraisal start date
605      if nvl(perf_appraisal.app_starts,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_appr_starts,hr_api.g_varchar2) then
606         l_imm_perf_appraisal.date_appr_starts   :=  perf_appraisal.app_starts;
607         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
608      end if;
609 
610    if nvl(perf_appraisal.app_type,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.appraisal_type,hr_api.g_varchar2) then
611         l_imm_perf_appraisal.appraisal_type     :=  perf_appraisal.app_type;
612         l_imm_perf_appraisal.perf_appr_flag := 'Y';
613      end if;
614    if nvl(perf_appraisal.date_init_appr_due,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.date_init_appr_due,hr_api.g_varchar2) then
615         l_imm_perf_appraisal.date_init_appr_due :=  perf_appraisal.date_init_appr_due;
616         l_imm_perf_appraisal.perf_appr_flag     := 'Y';
617      end if;
618     if nvl(perf_appraisal.date_effective,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.date_effective,hr_api.g_varchar2) then
619         l_imm_perf_appraisal.date_effective     :=  perf_appraisal.date_effective;
620         l_imm_perf_appraisal.perf_appr_flag := 'Y';
621      end if;
622      if nvl(perf_appraisal.unit,hr_api.g_varchar2)        <> nvl(l_imm_perf_appraisal.unit,hr_api.g_varchar2) then
623         l_imm_perf_appraisal.unit     :=  perf_appraisal.unit;
624         l_imm_perf_appraisal.perf_appr_flag := 'Y';
625      end if;
626      if nvl(perf_appraisal.org_str_id,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.org_structure_id,hr_api.g_varchar2) then
627         l_imm_perf_appraisal.org_structure_id :=  perf_appraisal.org_str_id;
628         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
629      end if;
630      if nvl(perf_appraisal.off_symbol,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.office_symbol,hr_api.g_varchar2) then
631         l_imm_perf_appraisal.office_symbol :=  perf_appraisal.off_symbol;
632         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
633      end if;
634      if nvl(perf_appraisal.pay_plan,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.pay_plan,hr_api.g_varchar2) then
635         l_imm_perf_appraisal.pay_plan :=  perf_appraisal.pay_plan;
636         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
637      end if;
638      if nvl(perf_appraisal.grade,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.grade,hr_api.g_varchar2) then
639         l_imm_perf_appraisal.grade :=  perf_appraisal.grade;
640         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
641      end if;
642      if nvl(perf_appraisal.date_due,hr_api.g_varchar2)  <>nvl(l_imm_perf_appraisal.date_due,hr_api.g_varchar2) then
643         l_imm_perf_appraisal.date_due :=  perf_appraisal.date_due;
644         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
645      end if;
646      if nvl(perf_appraisal.appr_sys_ident,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.appraisal_system_identifier,hr_api.g_varchar2) then
647         l_imm_perf_appraisal.appraisal_system_identifier :=  perf_appraisal.appr_sys_ident;
648         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
649      end if;
650      if nvl(perf_appraisal.optional_info,hr_api.g_varchar2)  <> nvl(l_imm_perf_appraisal.optional_information,hr_api.g_varchar2) then
651         l_imm_perf_appraisal.optional_information :=  perf_appraisal.optional_info;
652         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
653      end if;
654 
655      hr_utility.set_location('performance_rating_points'||perf_appraisal.performance_rating_points, 41);
656 
657      if nvl(perf_appraisal.performance_rating_points,hr_api.g_varchar2) <> nvl(l_imm_perf_appraisal.performance_rating_points,hr_api.g_varchar2) then
658         l_imm_perf_appraisal.performance_rating_points :=  perf_appraisal.performance_rating_points;
659         l_imm_perf_appraisal.perf_appr_flag   := 'Y';
660      end if;
661      l_temp_rec_level   := perf_appraisal.rec_level;
662 --   end if;
663  end loop;
664  If l_session.noa_id_correct is null and nvl(l_imm_perf_appraisal.perf_appr_flag ,hr_api.g_varchar2) = 'Y' then
665     l_imm_perf_appraisal.person_analysis_id :=  Null;
666  end if;
667     -- Bug#4054110,4069798
668     l_imm_perf_appraisal.rating_rec_level   := l_temp_rec_level;
669     l_imm_perf_appraisal.perf_appr_flag := 'Y';
670 
671 -- bug#2468297
672 if (p_pa_request_rec.work_schedule in ('B','F','G','I','J')) then
673 l_imm_asg_non_sf52.parttime_indicator:=NULL;
674 end if;
675 
676 --
677 -- Return values into all out variables
678 --
679  p_imm_asg_sf52                     :=	l_imm_asg_sf52;
680  p_imm_asg_non_sf52                 :=	l_imm_asg_non_sf52;
681  p_imm_asg_nte_dates                :=	l_imm_asg_nte_dates;
682  p_imm_per_sf52                     :=	l_imm_per_sf52;
683  p_imm_per_group1                   :=	l_imm_per_group1;
684  p_imm_per_group2                   :=	l_imm_per_group2;
685  p_imm_per_scd_info                 :=	l_imm_per_scd_info;
686  p_imm_per_retained_grade           := 	l_imm_per_retained_grade;
687  p_imm_per_probations               :=	l_imm_per_probations;
688  p_imm_per_sep_retire               :=	l_imm_per_sep_retire;
689  p_imm_per_security                 :=	l_imm_per_security;
690  -- Bug#4486823 RRR Changes
691  p_imm_per_service_oblig            :=  l_imm_per_service_oblig;
692  p_imm_per_conversions              :=    l_imm_per_conversions;
693  -- 4352589 BEN_EIT Changes
694  p_imm_per_benefit_info             :=  l_imm_per_benefit_info;
695  p_imm_per_uniformed_services       :=	l_imm_per_uniformed_services;
696  p_imm_pos_oblig                    :=	l_imm_pos_oblig;
697  p_imm_pos_grp2                     :=	l_imm_pos_grp2;
698  p_imm_pos_grp1                     :=	l_imm_pos_grp1;
699  p_imm_pos_valid_grade              :=	l_imm_pos_valid_grade;
700  p_imm_pos_car_prog                 :=    l_imm_pos_car_prog;
701  p_imm_loc_info                     :=    l_imm_loc_info;
702  p_imm_wgi     	                  :=    l_imm_wgi;
703  p_imm_gov_awards                   :=    l_imm_gov_awards;
704  p_imm_recruitment_bonus            :=    l_imm_recruitment_bonus ;
705  p_imm_relocation_bonus		      :=	l_imm_relocation_bonus;
706  p_imm_student_loan_repay             := l_imm_student_loan_repay;
707  --Pradeep
708  p_imm_mddds_special_pay	    :=  l_imm_mddds_special_pay;
709  p_imm_premium_pay_ind  	    :=  l_imm_premium_pay_ind;
710 
711  p_imm_extra_info_rec	 	      :=	l_imm_extra_info_rec ;
712  p_imm_sf52_from_data               :=    l_imm_sf52_from_data;
713  p_imm_personal_info		      :=    l_imm_personal_info;
714  p_imm_generic_extra_info_rec	      := 	l_imm_generic_extra_info_rec ;
715  p_imm_agency_sf52		      :=	l_imm_agency_sf52;
716  p_imm_payroll_type                 :=    l_imm_payroll_type;
717  p_imm_perf_appraisal               :=    l_imm_perf_appraisal;
718  p_imm_conduct_performance          :=    l_imm_conduct_performance;
719  p_agency_code			      :=    l_agency_code;
720  p_imm_par_term_retained_grade      :=    l_imm_par_term_retained_grade;
721  p_imm_entitlement                  :=    l_imm_entitlement;
722  -- Bug#2759379
723  p_imm_fegli                        :=    l_imm_fegli;
724  p_imm_foreign_lang_prof_pay        :=    l_imm_foreign_lang_prof_pay;
725   -- Bug#3385386 Added FTA record
726  p_imm_fta                          :=    l_imm_fta;
727  p_imm_edp_pay                      :=    l_imm_edp_pay;
728  p_imm_hazard_pay                   :=    l_imm_hazard_pay;
729  p_imm_health_benefits              :=    l_imm_health_benefits;
730  p_imm_danger_pay                   :=    l_imm_danger_pay;
731  p_imm_imminent_danger_pay          :=    l_imm_imminent_danger_pay;
732  p_imm_living_quarters_allow        :=    l_imm_living_quarters_allow;
733  p_imm_post_diff_amt                :=    l_imm_post_diff_amt;
734  p_imm_post_diff_percent            :=    l_imm_post_diff_percent;
735  p_imm_sep_maintenance_allow        :=    l_imm_sep_maintenance_allow;
736  p_imm_supplemental_post_allow      :=    l_imm_supplemental_post_allow;
737  p_imm_temp_lodge_allow             :=    l_imm_temp_lodge_allow;
738  p_imm_premium_pay                  :=    l_imm_premium_pay;
739  p_imm_retirement_annuity           :=    l_imm_retirement_annuity;
740  p_imm_severance_pay                :=    l_imm_severance_pay;
741  p_imm_thrift_saving_plan           :=    l_imm_thrift_saving_plan;
742  p_imm_retention_allow_review       :=    l_imm_retention_allow_review;
743  p_imm_health_ben_pre_tax           :=    l_imm_health_ben_pre_tax;
744  p_imm_per_race_ethnic_info			:= 	  l_imm_per_race_ethnic_info; -- Race or National Origin changes
745 
746  --start of bug 6312144
747  p_imm_ipa_benefits_cont   :=    l_imm_ipa_benefits_cont;
748  p_imm_retirement_info  	  := 	l_imm_retirement_info;
749  --end of bug 6312144
750 
751 End populate_record_groups;
752 
753 
754 -- *******************************
755 -- procedure Retrieve_all_extra_info
756 -- *******************************
757 --
758 
759 Procedure retrieve_all_extra_info
760  (p_pa_request_rec                  in      ghr_pa_requests%rowtype,
761   p_asg_sf52                        in out nocopy  ghr_api.asg_sf52_type,
762   p_per_sf52                        in out nocopy  ghr_api.per_sf52_type,
763   p_per_group1                      in out nocopy  ghr_api.per_group1_type,
764   p_per_scd_info                    in out nocopy  ghr_api.per_scd_info_type,
765   p_pos_grp1                        in out nocopy  ghr_api.pos_grp1_type,
766   p_pos_grp2                        in out nocopy  ghr_api.pos_grp2_type,
767   p_loc_info                        in out nocopy  ghr_api.loc_info_type,
768   p_per_uniformed_services          in out nocopy  ghr_api.per_uniformed_services_type,
769   p_per_conversions                 in out nocopy  ghr_api.per_conversions_type,
770   -- 4352589 BEN_EIT Changes
771   p_per_benefit_info                in out nocopy  ghr_api.per_benefit_info_type,
772   p_asg_non_sf52	            in out nocopy  ghr_api.asg_non_sf52_type,
773   p_per_separate_Retire             in out nocopy  ghr_api.per_sep_retire_type,
774   p_asg_nte_dates                   in out nocopy  ghr_api.asg_nte_dates_type,
775   p_per_probations	            	in out nocopy  ghr_api.per_probations_type,
776   p_per_retained_grade	            in out nocopy  ghr_api.per_retained_grade_type,
777   --Bug#4486823 RRR Changes
778   p_per_service_oblig               in out nocopy ghr_api.per_service_oblig_type,
779   p_within_grade_increase           in out nocopy  ghr_api.within_grade_increase_type,
780   p_valid_grade                     in out nocopy  ghr_api.pos_valid_grade_type ,
781   p_pos_oblig                       in out nocopy  ghr_api.pos_oblig_type,
782   p_race_ethnic_info		    in out nocopy  ghr_api.per_race_ethnic_type, -- Bug 4724337 Race or National Origin changes
783   --Bug #6312144 RPA EIT Benefits
784   p_ipa_benefits_cont               in out nocopy  ghr_api.per_ipa_ben_cont_info_type,
785   p_retirement_info                 in out nocopy  ghr_api.per_retirement_info_type
786   )
787   is
788   l_per_extra_info_rec              per_people_extra_info%rowtype;
789   l_asg_extra_info_rec              per_assignment_extra_info%rowtype;
790   l_pos_extra_info_rec              per_position_extra_info%rowtype;
791   l_proc                            varchar2(70) := 'Retrieve_all_extra_info';
792   l_person_type                     per_person_types.system_person_type%type := hr_api.g_varchar2;
793   l_position_id                     per_positions.position_id%type;
794   l_retained_grade_rec              ghr_pay_calc.retained_grade_rec_type;
795   l_session                         ghr_history_api.g_session_var_type;
796   l_person_status					per_assignment_status_types.user_status%type;
797 
798 	-- Bug 3021003
799 	l_ret_flag BOOLEAN := FALSE;
800  -- Cursor to retrieve the Person Type of the Person , as of the effective_date of the Request
801 
802   cursor   c_person_type is
803    select  ppt.system_person_type
804    from    per_person_types  ppt,
805            per_all_people_f      ppf
806    where   ppf.person_id       =  p_pa_request_rec.person_id
807    and     ppt.person_type_id  =  ppf.person_type_id
808    and     g_effective_date
809    between ppf.effective_start_date
810    and     ppf.effective_end_date;
811 
812 
813    cursor  c_per_ret_grade is
814      select pei_information1 date_from,
815             pei_information2 date_to,
816             pei_information3 grade_or_level,
817             pei_information4 step_or_rate,
818             pei_information5 pay_plan,
819             pei_information6 pay_table_id,
820             pei_information7 locality_percent,
821             pei_information8 pay_basis
822       from  per_people_Extra_info pei
823       where pei.person_Extra_info_id =  p_per_retained_grade.person_extra_info_id;
824 
825 	-- Bug 3390876 Get User Status
826    CURSOR c_user_status(c_assignment_id per_all_assignments_f.assignment_id%type,
827                         c_effective_date ghr_pa_requests.effective_date%type) IS
828     SELECT
829 	  ast.user_status,
830 	  ast.per_system_status,
831 	  asg.effective_start_date
832 	FROM
833 	  per_assignment_status_types ast,
834 	  per_all_assignments_f asg
835 	WHERE
836 	  asg.assignment_id = c_assignment_id AND
837 	  ast.assignment_status_type_id = asg.assignment_status_type_id  		and
838 	  c_effective_date between asg.effective_start_date and asg.effective_end_date;
839 	-- End Bug 3390876
840 
841    Procedure get_ret_grade
842    (p_pa_request_id in           number,
843     p_person_extra_info_id  out nocopy  number
844    )
845    is
846    l_proc           varchar2(72)  :=  'get_ret_grade';
847    l_extra_info_id  per_people_extra_info.person_extra_info_id%type;
848    l_request_id     ghr_pa_requests.pa_request_id%type;
849 
850      CURSOR c1(c_request_id in  number) is
851        SELECT  par.altered_pa_request_id
852        FROM    ghr_pa_requests  par
853        WHERE   par.pa_request_id = c_request_id;
854 
855      CURSOR c2 (c_request_id number) is
856             SELECT  par.pa_request_id, par.altered_pa_request_id, pei.rei_information3
857             FROM    ghr_pa_requests par, ghr_pa_request_extra_info pei
858             WHERE   par.pa_request_id     = pei.pa_request_id
859               AND   pei.pa_request_id     = c_request_id
860               AND   pei.information_type  = 'GHR_US_PAR_TERM_RET_GRADE';
861 
862   begin
863 
864      l_request_id := p_pa_request_id;
865      l_extra_info_id := null;
866      for c1_rec in c1(c_request_id => l_request_id) loop
867         --dbms_output.put_line('inside fetch extra info id loop1');
868         hr_utility.set_location(l_proc,1);
869         l_request_id := c1_rec.altered_pa_request_id;
870         If l_request_id is not null then
871          for c2_rec in c2(l_request_id) loop
872            hr_utility.set_location(l_proc,1);
873            l_extra_info_id := c2_rec.rei_information3;
874          end loop;
875            hr_utility.set_location(l_proc ||'Extra info id  is '|| to_char(l_extra_info_id),3);
876        End if;
877        If l_extra_info_id is not null then
878           exit;
879        End if;
880         hr_utility.set_location(l_proc,4);
881      end loop;
882      p_person_extra_info_id   := l_extra_info_id;
883   end  get_ret_grade;
884 
885 
886 --   begin
887 
888 
889 -- Probabally should not retrieve extra info for an  'APPOINTMENT' family, except in case of a 'CORRECTION'.
890 
891   Begin
892    g_effective_date                :=  nvl(p_pa_request_rec.effective_date,sysdate);
893    ghr_history_api.get_g_session_var(l_session); -- Bug 3021003
894 --  l_extra_info_rec.l_extra_info_id := null;
895 -- Bug # 1234846 --
896 	  If p_pa_request_rec.noa_family_code in ('APP','CONV_APP') then
897 		 hr_utility.set_location(l_proc,12);
898 		 l_person_type    := null;
899 		 for per_type in c_person_type loop
900 		   l_person_type :=  per_type.system_person_type;
901 		 end loop;
902 		 if l_person_type is null then
903 		   hr_utility.set_message(8301,'GHR_38133_INVALID_PERSON');
904 		   hr_utility.raise_error;
905 		 end if;
906 	  End if;
907 
908       hr_utility.set_location(' Noa Family Code is ' || p_pa_request_rec.noa_family_code ,13);
909       hr_utility.set_location(' Person Type is ' || l_person_type,14);
910   -- Bug 3390876 Need to populate record groups even for Conversion of Appointment NTE actions if Suspended
911 	 IF p_pa_request_rec.employee_assignment_id IS NOT NULL THEN
912 		FOR l_user_status IN c_user_status(p_pa_request_rec.employee_assignment_id,g_effective_date) LOOP
913 			l_person_status := l_user_status.per_system_status;
914 		END LOOP;
915 	 END IF;
916 
917   -- Adding OR condition in the code below.
918   -- Need to add all Conv. to app actions NTE. Bug 3390876
919   IF (p_pa_request_rec.noa_family_code not in ( 'APP','CONV_APP') and
920         l_person_type <> 'EX_EMP') OR
921 		(p_pa_request_rec.first_noa_code IN ('508','515','517','522','548','549','553','554','571','590')) THEN
922 --		AND l_person_status = 'SUSP_ASSIGN') THEN
923    IF p_pa_request_rec.employee_assignment_id is not null then
924       hr_utility.set_location(' asg id ' || to_char(p_pa_request_rec.employee_assignment_id) ,2);
925       hr_utility.set_location(' Date ' || to_Char(p_pa_request_rec.effective_date),2);
926 
927   -- Retrieve asg_sf52
928 
929      ghr_history_fetch.fetch_asgei
930     (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
931      p_information_type           => 'GHR_US_ASG_SF52',
932      p_date_effective             =>  p_pa_request_rec.effective_date,
933      p_asg_ei_data                =>  l_asg_extra_info_rec
934      );
935 
936     hr_utility.set_location('retrieved asg extra info 1 ',1);
937 
938     p_asg_sf52.assignment_extra_info_id :=  l_asg_extra_info_rec.assignment_extra_info_id;
939     p_asg_sf52.object_version_number    :=  l_asg_extra_info_rec.object_version_number;
940     p_asg_sf52.step_or_rate             :=  l_asg_extra_info_rec.aei_information3;
941     p_asg_sf52.tenure                   :=  l_asg_extra_info_rec.aei_information4;
942     p_asg_sf52.annuitant_indicator      :=  l_asg_extra_info_rec.aei_information5;
943     p_asg_sf52.pay_rate_determinant     :=  l_asg_extra_info_rec.aei_information6;
944     p_asg_sf52.work_schedule            :=  l_asg_extra_info_rec.aei_information7;
945     p_asg_sf52.part_time_hours          :=  l_asg_extra_info_rec.aei_information8;
946     p_asg_sf52.calc_pay_table           :=  l_asg_extra_info_rec.aei_information9;
947 
948     hr_utility.set_location('After Fetch from local var - tenure ' || l_asg_extra_info_rec.aei_information3,2);
949     hr_utility.set_location('After Fetch from local var - asextrinfoid ' || to_char(l_asg_extra_info_rec.assignment_extra_info_id) ,2);
950     l_asg_extra_info_rec   :=  null;
951     hr_utility.set_location('After Fetch - tenure ' || p_asg_sf52.tenure,2);
952     hr_utility.set_location('After Fetch - annu indic'  || p_asg_sf52.annuitant_indicator,2);
953     hr_utility.set_location('After Fetch- asextrinfoid ' || to_char(p_asg_sf52.assignment_extra_info_id) ,2);
954 
955 
956  -- Retrieve asg_non_sf52
957 
958   ghr_history_fetch.fetch_asgei
959   (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
960    p_information_type           => 'GHR_US_ASG_NON_SF52',
961    p_date_effective             =>  p_pa_request_rec.effective_date,
962    p_asg_ei_data                =>  l_asg_extra_info_rec
963   );
964 
965 
966   hr_utility.set_location('retrieved asg extra info 2 ',2);
967 
968   p_asg_non_sf52.assignment_extra_info_id       :=  l_asg_extra_info_rec.assignment_extra_info_id;
969   p_asg_non_sf52.object_version_number          :=  l_asg_extra_info_rec.object_version_number;
970   p_asg_non_sf52.date_arr_personnel_office      :=  l_asg_extra_info_rec.aei_information3;
971   p_asg_non_sf52.duty_status                    :=  l_asg_extra_info_rec.aei_information4;
972   p_asg_non_sf52.key_emer_essential_empl        :=  l_asg_extra_info_rec.aei_information5;
973   p_asg_non_sf52.non_disc_agmt_status           :=  l_asg_extra_info_rec.aei_information6;
974   p_asg_non_sf52.date_wtop_exemp_expires        :=  l_asg_extra_info_rec.aei_information7;
975   p_asg_non_sf52.parttime_indicator             :=  l_asg_extra_info_rec.aei_information8;
976   p_asg_non_sf52.qualification_standard_waiver  :=  l_asg_extra_info_rec.aei_information9;
977   p_asg_non_sf52.trainee_promotion_id           :=  l_asg_extra_info_rec.aei_information10;
978   p_asg_non_sf52.date_trainee_promotion_expt    :=  l_asg_extra_info_rec.aei_information11;
979   l_asg_extra_info_rec   :=  null;
980 
981  -- Retrieve asg_nte_dates
982 
983   ghr_history_fetch.fetch_asgei
984   (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
985    p_information_type           => 'GHR_US_ASG_NTE_DATES',
986    p_date_effective             =>  p_pa_request_rec.effective_date,
987    p_asg_ei_data                =>  l_asg_extra_info_rec
988   );
989 
990   hr_utility.set_location('retrieved asg extra info 3 ',3);
991 
992 
993   p_asg_nte_dates.assignment_extra_info_id       :=  l_asg_extra_info_rec.assignment_extra_info_id;
994   p_asg_nte_dates.object_version_number          :=  l_asg_extra_info_rec.object_version_number;
995   p_asg_nte_dates.asg_nte_start_date             :=  l_asg_extra_info_rec.aei_information3;
996   p_asg_nte_dates.assignment_nte                 :=  l_asg_extra_info_rec.aei_information4;
997   p_asg_nte_dates.lwop_nte_start_date            :=  l_asg_extra_info_rec.aei_information5;
998   p_asg_nte_dates.lwop_nte                       :=  l_asg_extra_info_rec.aei_information6;
999   p_asg_nte_dates.suspension_nte_start_date      :=  l_asg_extra_info_rec.aei_information7;
1000   p_asg_nte_dates.suspension_nte                 :=  l_asg_extra_info_rec.aei_information8;
1001   p_asg_nte_dates.furlough_nte_start_date        :=  l_asg_extra_info_rec.aei_information9;
1002   p_asg_nte_dates.furlough_nte                   :=  l_asg_extra_info_rec.aei_information10;
1003   p_asg_nte_dates.lwp_nte_start_date             :=  l_asg_extra_info_rec.aei_information11;
1004   p_asg_nte_dates.lwp_nte                        :=  l_asg_extra_info_rec.aei_information12;
1005   p_asg_nte_dates.sabatical_nte_start_date       :=  l_asg_extra_info_rec.aei_information13;
1006   p_asg_nte_dates.sabatical_nte                  :=  l_asg_extra_info_rec.aei_information14;
1007   p_asg_nte_dates.assignment_number              :=  l_asg_extra_info_rec.aei_information15;
1008 --  p_asg_nte_dates.position_change_nte            :=  l_asg_extra_info_rec.aei_information16;  -- ??
1009   l_asg_extra_info_rec   :=  null;
1010 
1011   END IF;
1012 END IF;
1013 
1014   -- Retrieve PER SF52
1015 
1016   ghr_history_fetch.fetch_peopleei
1017   (p_person_id                  =>  p_pa_request_rec.person_id,
1018    p_information_type           => 'GHR_US_PER_SF52',
1019    p_date_effective             =>  p_pa_request_rec.effective_date,
1020    p_per_ei_data                =>  l_per_extra_info_rec
1021   );
1022 
1023    hr_utility.set_location('retrieved per sf52 ',5);
1024 
1025    p_per_sf52.person_extra_info_id        :=  l_per_extra_info_rec.person_extra_info_id;
1026    p_per_sf52.object_version_number       :=  l_per_extra_info_rec.object_version_number;
1027    p_per_sf52.citizenship                 :=  l_per_extra_info_rec.pei_information3;
1028    p_per_sf52.veterans_preference         :=  l_per_extra_info_rec.pei_information4;
1029    p_per_sf52.veterans_preference_for_rif :=  l_per_extra_info_rec.pei_information5;
1030    p_per_sf52.veterans_status             :=  l_per_extra_info_rec.pei_information6;
1031 
1032   l_per_extra_info_rec   :=  null;
1033 
1034 -- Retrieve Per_Group1
1035 
1036    ghr_history_fetch.fetch_peopleei
1037   (p_person_id                  =>  p_pa_request_rec.person_id,
1038    p_information_type           => 'GHR_US_PER_GROUP1',
1039    p_date_effective             =>  p_pa_request_rec.effective_date,
1040    p_per_ei_data                =>  l_per_extra_info_rec
1041   );
1042 
1043   hr_utility.set_location('After fetch RINO     ' || l_per_extra_info_rec.pei_information5,1);
1044   hr_utility.set_location('After Fetch HANDICAP ' || l_per_extra_info_rec.pei_information11,2);
1045 
1046   hr_utility.set_location('retrieved per group1 ',6);
1047 
1048    p_per_group1.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1049    p_per_group1.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1050    p_per_group1.appointment_type             :=  l_per_extra_info_rec.pei_information3;
1051    p_per_group1.type_of_employment           :=  l_per_extra_info_rec.pei_information4;
1052    p_per_group1.race_national_origin         :=  l_per_extra_info_rec.pei_information5;
1053    p_per_group1.date_last_promotion          :=  l_per_extra_info_rec.pei_information6;
1054    p_per_group1.agency_code_transfer_from    :=  l_per_extra_info_rec.pei_information7;
1055    p_per_group1.org_appointment_auth_code1   :=  l_per_extra_info_rec.pei_information8;
1056    p_per_group1.org_appointment_desc1        :=  l_per_extra_info_rec.pei_information22;--Bug# 4941984(AFHR2)
1057    p_per_group1.org_appointment_auth_code2   :=  l_per_extra_info_rec.pei_information9;
1058    p_per_group1.org_appointment_desc2        :=  l_per_extra_info_rec.pei_information23;--Bug# 4941984(AFHR2)
1059    p_per_group1.country_world_citizenship    :=  l_per_extra_info_rec.pei_information10;
1060    p_per_group1.handicap_code                :=  l_per_extra_info_rec.pei_information11;
1061    p_per_group1.consent_id                   :=  l_per_extra_info_rec.pei_information12;
1062    p_per_group1.date_fehb_eligibility_expires :=  l_per_extra_info_rec.pei_information13;
1063    p_per_group1.date_temp_eligibility_fehb   :=  l_per_extra_info_rec.pei_information14;
1064    p_per_group1.date_febh_dependent_cert_exp :=  l_per_extra_info_rec.pei_information15;
1065    p_per_group1.family_member_emp_pref       :=  l_per_extra_info_rec.pei_information16;
1066    p_per_group1.family_member_status         :=  l_per_extra_info_rec.pei_information17;
1067    --Bug#4486823 RRR Changes
1068    p_per_group1.retention_inc_review_date    :=  l_per_extra_info_rec.pei_information21;
1069 
1070    l_per_extra_info_rec   :=  null;
1071 --
1072 
1073 -- Retrieve  Per_scd `
1074 
1075   ghr_history_fetch.fetch_peopleei
1076   (p_person_id              =>  p_pa_request_rec.person_id,
1077   p_information_type           => 'GHR_US_PER_SCD_INFORMATION',
1078   p_date_effective             =>  p_pa_request_rec.effective_date,
1079   p_per_ei_data                =>  l_per_extra_info_rec
1080   );
1081 
1082     hr_utility.set_location('After fetch SCD     ' || l_per_extra_info_rec.pei_information3,1);
1083 
1084    hr_utility.set_location('retrieved per scd ',8);
1085 
1086    p_per_scd_info.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1087    p_per_scd_info.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1088    p_per_scd_info.scd_leave                    :=  l_per_extra_info_rec.pei_information3;
1089    p_per_scd_info.scd_civilian                 :=  l_per_extra_info_rec.pei_information4;
1090    p_per_scd_info.scd_rif                      :=  l_per_extra_info_rec.pei_information5;
1091    p_per_scd_info.scd_tsp                      :=  l_per_extra_info_rec.pei_information6;
1092    -- Begin Bug# 4864508
1093    p_per_scd_info.scd_retirement			   :=  l_per_extra_info_rec.pei_information7;
1094    -- End Bug# 4864508
1095    --bug#4443968
1096    p_per_scd_info.scd_creditable_svc_annl_leave := l_per_extra_info_rec.pei_information12;
1097    l_per_extra_info_rec   :=  null;
1098 
1099 -- Retrieve per_probations
1100 
1101    ghr_history_fetch.fetch_peopleei
1102   (p_person_id                 =>  p_pa_request_rec.person_id,
1103   p_information_type           => 'GHR_US_PER_PROBATIONS',
1104    p_date_effective            =>  p_pa_request_rec.effective_date,
1105   p_per_ei_data                =>  l_per_extra_info_rec
1106   );
1107 
1108 
1109   hr_utility.set_location('retrieved per probations  ',9);
1110 
1111    p_per_probations.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1112    p_per_probations.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1113    p_per_probations.date_prob_trial_period_begin :=  l_per_extra_info_rec.pei_information3;
1114    p_per_probations.date_prob_trial_period_ends  :=  l_per_extra_info_rec.pei_information4;
1115   -- p_per_probations.date_spvr_mgr_prob_Begins    :=  l_per_extra_info_rec.pei_information8; --Bug# 4588575
1116    p_per_probations.date_spvr_mgr_prob_ends      :=  l_per_extra_info_rec.pei_information5;
1117    p_per_probations.spvr_mgr_prob_completion     :=  l_per_extra_info_rec.pei_information6;
1118    p_per_probations.date_ses_prob_expires        :=  l_per_extra_info_rec.pei_information7;
1119 
1120    l_per_extra_info_rec   :=  null;
1121 
1122 --  Retrieve per_retained_grade
1123 
1124 -- Retained Grade has to retrieved with a special logic, as it can have multiple occurences
1125 -- and on the same dates. The procedure below, returns the retained grade details that fetches the max. profit for
1126 -- the person for the specific date.
1127 
1128 -- Note : It is assumed that the retain_pay_table_id is not used by the CPDFs.
1129 --        Actually the user_table_id is stored into the retain_pay_table_id , which is just the primary key id and not
1130 --        the actual pay table name, like the quad 0s. Since the only pay table used by the CPDF is the Quad 0 and
1131 --        has been hard coded for validations, it is OK to pass the id against the actual name of the pay table.
1132 --
1133 
1134 
1135  begin
1136 
1137   If p_pa_request_rec.first_noa_code = '866' then
1138     l_retained_grade_rec :=  ghr_pc_basic_pay.get_retained_grade_details
1139                              (p_person_id       =>   p_pa_request_rec.person_id,
1140                               p_effective_date  =>   p_pa_request_rec.effective_date + 1,
1141                               p_pa_request_id   =>   p_pa_request_rec.pa_request_id
1142                              );
1143   Else
1144      l_retained_grade_rec :=  ghr_pc_basic_pay.get_retained_grade_details
1145                             (p_person_id       =>   p_pa_request_rec.person_id,
1146                              p_effective_date  =>   p_pa_request_rec.effective_date,
1147                              p_pa_request_id   =>   p_pa_request_rec.pa_request_id
1148                             );
1149    END IF;
1150 
1151      -- Bug#4423679 Added date_from, date_to
1152      p_per_retained_grade.date_from              :=  l_retained_grade_rec.date_from;
1153      p_per_retained_grade.date_to                :=  l_retained_grade_rec.date_to;
1154      -- Bug#4423679
1155      p_per_retained_grade.retain_grade            :=  l_retained_grade_rec.grade_or_level;
1156      p_per_retained_grade.retain_step_or_rate     :=  l_retained_grade_rec.step_or_rate;
1157      p_per_retained_grade.retain_pay_plan         :=  l_retained_grade_rec.pay_plan;
1158      p_per_retained_grade.retain_pay_table_id     :=  to_char(l_retained_grade_rec.user_table_id);
1159      p_per_retained_grade.retain_locality_percent :=  to_char(l_retained_grade_rec.locality_percent);
1160      p_per_retained_grade.retain_pay_basis        :=  l_retained_grade_rec.pay_basis;
1161      p_per_retained_grade.temp_step               :=  l_retained_grade_rec.temp_step;
1162    --End if;
1163     -- Bug 3021003 If Intervening actions are present in WGI, QSI corrections, get the corrected step.
1164 	-- Bug 4658890 Removed 894 from first_noa_code
1165    IF   p_pa_request_rec.first_noa_code IN ('867','892','893') AND  l_session.noa_id_correct IS NOT NULL THEN
1166      hr_utility.set_location('Inside PRUP Sun if condn',10);
1167 		ghr_pay_calc.is_retained_ia(p_pa_request_rec.person_id,
1168 									   p_pa_request_rec.effective_date,
1169 									   l_retained_grade_rec.pay_plan,
1170 									   l_retained_grade_rec.grade_or_level,
1171 									   l_retained_grade_rec.step_or_rate,
1172 									   l_retained_grade_rec.temp_step,
1173 									   l_ret_flag);
1174 		 IF l_ret_flag = TRUE THEN
1175 			IF l_retained_grade_rec.temp_step IS NOT NULL THEN
1176 				hr_utility.set_location('Inside PRUP Sun if temp_step condn' || l_retained_grade_rec.temp_step,10);
1177 				p_per_retained_grade.temp_step := ghr_pc_basic_pay.get_next_WGI_step (l_retained_grade_rec.pay_plan,l_retained_grade_rec.temp_step);
1178 			ELSE
1179 				hr_utility.set_location('Inside PRUP Sun ELSE temp_step condn' || l_retained_grade_rec.step_or_rate,10);
1180 				p_per_retained_grade.retain_step_or_rate := ghr_pc_basic_pay.get_next_WGI_step (l_retained_grade_rec.pay_plan,l_retained_grade_rec.step_or_rate);
1181 			END IF;
1182 			p_per_sf52.per_sf52_flag := 'Y';
1183 		 END IF;
1184    END IF;
1185 
1186   hr_utility.set_location('Retrieved Per_retained_grade',10);
1187 
1188 -- Need to handle this Exception here because it is just a warning to indicate that the pay cannot be calculated
1189 -- which is only apt for the Front End and does not matter in this context.
1190 
1191 exception
1192   when ghr_pay_calc.pay_calc_message then
1193      null;
1194  end;
1195 
1196 -- Retrieve per_separate_retire
1197 
1198    hr_utility.set_location('retrieved per unif ',13);
1199    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
1200                             p_per_separate_retire.agency_code_transfer_to ,13);
1201    hr_utility.set_location('l_per_extra_info_rec.pei_information8 = ' ||
1202                             l_per_extra_info_rec.pei_information8 ,13);
1203    ghr_history_fetch.fetch_peopleei
1204   (p_person_id                 =>  p_pa_request_rec.person_id,
1205    p_information_type          => 'GHR_US_PER_SEPARATE_RETIRE',
1206    p_date_effective            =>  p_pa_request_rec.effective_date,
1207    p_per_ei_data               =>  l_per_extra_info_rec
1208   );
1209   p_per_separate_retire.person_extra_info_id          := l_per_extra_info_rec.person_extra_info_id;
1210   p_per_separate_retire.object_version_number         := l_per_extra_info_rec.object_version_number;
1211   p_per_separate_retire.fers_coverage                 := l_per_extra_info_rec.pei_information3;
1212   p_per_separate_retire.prev_retirement_coverage      := l_per_extra_info_rec.pei_information4;
1213   p_per_separate_retire.frozen_service                := l_per_extra_info_rec.pei_information5;
1214   p_per_separate_retire.naf_retirement_indicator      := l_per_extra_info_rec.pei_information6;
1215   p_per_separate_retire.reason_for_separation         := l_per_extra_info_rec.pei_information7;
1216   p_per_separate_retire.agency_code_transfer_to       := l_per_extra_info_rec.pei_information8;
1217   p_per_separate_retire.date_projected_retirement     := l_per_extra_info_rec.pei_information9;
1218   p_per_separate_retire.mandatory_retirement_date     := l_per_extra_info_rec.pei_information10;
1219   --Start Bug 1359482
1220   If  nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) in ('300','301','302','303','304') then
1221     hr_utility.set_location('separate_pkg_status_indicator defaults to 1',14);
1222     p_per_separate_retire.separate_pkg_status_indicator := '1';
1223     p_per_separate_retire.per_sep_retire_flag := 'Y';
1224   else
1225     p_per_separate_retire.separate_pkg_status_indicator := l_per_extra_info_rec.pei_information11;
1226   end if;
1227   --End Bug 1359482
1228 
1229   p_per_separate_retire.separate_pkg_register_number  := l_per_extra_info_rec.pei_information12;
1230   p_per_separate_retire.separate_pkg_pay_office_id    := l_per_extra_info_rec.pei_information13;
1231   p_per_separate_retire.date_ret_appl_received        := l_per_extra_info_rec.pei_information14;
1232   p_per_separate_retire.date_ret_pkg_sent_to_payroll  := l_per_extra_info_rec.pei_information15;
1233   p_per_separate_retire.date_ret_pkg_recv_payroll     := l_per_extra_info_rec.pei_information16;
1234   p_per_separate_retire.date_ret_pkg_to_opm           := l_per_extra_info_rec.pei_information17;
1235 
1236   l_per_extra_info_rec   :=  null;
1237 
1238    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
1239                             p_per_separate_retire.agency_code_transfer_to ,14);
1240    hr_utility.set_location('l_per_extra_info_rec.pei_information8 = ' ||
1241                             l_per_extra_info_rec.pei_information8 ,14);
1242    hr_utility.set_location('retrieved per unif ',14);
1243 
1244 -- Bug#4486823 RRR Changes
1245 -- Retrieve per_service_obligation
1246 
1247   /*  ghr_history_fetch.fetch_peopleei
1248   (p_person_id                 =>  p_pa_request_rec.person_id,
1249    p_information_type          => 'GHR_US_PER_SERVICE_OBLIGATION',
1250    p_date_effective            =>  p_pa_request_rec.effective_date,
1251    p_per_ei_data               =>  l_per_extra_info_rec
1252   );
1253   p_per_service_oblig.person_extra_info_id          := l_per_extra_info_rec.person_extra_info_id;
1254   p_per_service_oblig.object_version_number         := l_per_extra_info_rec.object_version_number;
1255   p_per_service_oblig.service_oblig_type_code       := l_per_extra_info_rec.pei_information3;
1256   p_per_service_oblig.service_oblig_start_date      := l_per_extra_info_rec.pei_information4;
1257   p_per_service_oblig.service_oblig_end_date        := l_per_extra_info_rec.pei_information5;
1258   l_per_extra_info_rec   :=  null;
1259 
1260    hr_utility.set_location('p_per_service_oblig.service_oblig_type_code = ' ||
1261                             p_per_service_oblig.service_oblig_type_code ,15);
1262    hr_utility.set_location('p_per_service_oblig.service_oblig_start_date = ' ||
1263                             p_per_service_oblig.service_oblig_start_date ,15);
1264    hr_utility.set_location('retrieved per serv oblg ',15); */
1265 
1266  -- Retrieve per_uniformed_services
1267 
1268    ghr_history_fetch.fetch_peopleei
1269   (p_person_id                 =>  p_pa_request_rec.person_id,
1270    p_information_type          => 'GHR_US_PER_UNIFORMED_SERVICES',
1271    p_date_effective            =>  p_pa_request_rec.effective_date,
1272    p_per_ei_data               =>  l_per_extra_info_rec
1273   );
1274 
1275    p_per_uniformed_services.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1276    p_per_uniformed_services.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1277    p_per_uniformed_services.reserve_category             :=  l_per_extra_info_rec.pei_information3;
1278    p_per_uniformed_services.military_recall_status       :=  l_per_extra_info_rec.pei_information4;
1279    p_per_uniformed_services.creditable_military_service  :=  l_per_extra_info_rec.pei_information5;
1280    p_per_uniformed_services.date_retired_uniform_service :=  l_per_extra_info_rec.pei_information6;
1281    p_per_uniformed_services.uniform_service_component    :=  l_per_extra_info_rec.pei_information7;
1282    p_per_uniformed_services.uniform_service_designation  :=  l_per_extra_info_rec.pei_information8;
1283    p_per_uniformed_services.retirement_grade             :=  l_per_extra_info_rec.pei_information9;
1284    p_per_uniformed_services.military_retire_waiver_ind   :=  l_per_extra_info_rec.pei_information10;
1285    p_per_uniformed_services.exception_retire_pay_ind     :=  l_per_extra_info_rec.pei_information11;
1286 
1287    l_per_extra_info_rec   :=  null;
1288 
1289 
1290 -- Retrieve per_conversions
1291 
1292    ghr_history_fetch.fetch_peopleei
1293   (p_person_id                 =>  p_pa_request_rec.person_id,
1294    p_information_type          => 'GHR_US_PER_CONVERSIONS',
1295    p_date_effective            =>  p_pa_request_rec.effective_date,
1296    p_per_ei_data               =>  l_per_extra_info_rec
1297   );
1298 
1299    p_per_conversions.person_extra_info_id         :=  l_per_extra_info_rec.person_extra_info_id;
1300    p_per_conversions.object_version_number        :=  l_per_extra_info_rec.object_version_number;
1301    p_per_conversions.date_conv_career_begins      :=  l_per_extra_info_rec.pei_information3;
1302    p_per_conversions.date_conv_career_due         :=  l_per_extra_info_rec.pei_information4;
1303    p_per_conversions.date_recmd_conv_begins       :=  l_per_extra_info_rec.pei_information5;
1304    p_per_conversions.date_recmd_conv_due          :=  l_per_extra_info_rec.pei_information7;
1305    p_per_conversions.date_vra_conv_due            :=  l_per_extra_info_rec.pei_information6;
1306 
1307    l_per_extra_info_rec   :=  null;
1308 
1309    -- 4352589 BEN_EIT Changes
1310    -- Retrieve per_benefit_info
1311    ghr_history_fetch.fetch_peopleei
1312   (p_person_id                 =>  p_pa_request_rec.person_id,
1313    p_information_type          => 'GHR_US_PER_BENEFIT_INFO',
1314    p_date_effective            =>  p_pa_request_rec.effective_date,
1315    p_per_ei_data               =>  l_per_extra_info_rec
1316   );
1317 
1318    p_per_benefit_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1319    p_per_benefit_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1320    p_per_benefit_info.FEGLI_Date_Eligibility_Expires :=  l_per_extra_info_rec.pei_information3;
1321    p_per_benefit_info.FEHB_Date_Eligibility_expires  :=  l_per_extra_info_rec.pei_information4;
1322    p_per_benefit_info.FEHB_Date_temp_eligibility     :=  l_per_extra_info_rec.pei_information5;
1323    p_per_benefit_info.FEHB_Date_dependent_cert_expir :=  l_per_extra_info_rec.pei_information6;
1324    p_per_benefit_info.FEHB_LWOP_contingency_st_date  :=  l_per_extra_info_rec.pei_information7;
1325    p_per_benefit_info.FEHB_LWOP_contingency_end_date :=  l_per_extra_info_rec.pei_information8;
1326    p_per_benefit_info.FEHB_Child_equiry_court_date   :=  l_per_extra_info_rec.pei_information10;
1327    p_per_benefit_info.FERS_Date_eligibility_expires  :=  l_per_extra_info_rec.pei_information11;
1328    p_per_benefit_info.FERS_Election_Date             :=  l_per_extra_info_rec.pei_information12;
1329    p_per_benefit_info.FERS_Election_Indicator        :=  l_per_extra_info_rec.pei_information13;
1330    p_per_benefit_info.TSP_Agncy_Contrib_Elig_date    :=  l_per_extra_info_rec.pei_information14;
1331    p_per_benefit_info.TSP_Emp_Contrib_Elig_date      :=  l_per_extra_info_rec.pei_information15;
1332 
1333    -- Changes related to 6312144 -- Addition of new segments introduced in benefit info record type
1334    p_per_benefit_info.FEGLI_Assignment_Ind:=  l_per_extra_info_rec.pei_information16;
1335    p_per_benefit_info.FEGLI_Post_Elec_Basic_Ins_Amt:=  l_per_extra_info_rec.pei_information17;
1336    p_per_benefit_info.FEGLI_Court_Order_Ind:=  l_per_extra_info_rec.pei_information18;
1337    p_per_benefit_info.Desg_FEGLI_Benf_Ind:=  l_per_extra_info_rec.pei_information19;
1338    p_per_benefit_info.FEHB_Event_Code:=  l_per_extra_info_rec.pei_information20;
1339 
1340 
1341     -- Bug 4724337 Race or National Origin changes
1342    	l_per_extra_info_rec   :=  null;
1343      ghr_history_fetch.fetch_peopleei
1344 	  (p_person_id                 =>  p_pa_request_rec.person_id,
1345 	   p_information_type          => 'GHR_US_PER_ETHNICITY_RACE',
1346 	   p_date_effective            =>  p_pa_request_rec.effective_date,
1347 	   p_per_ei_data               =>  l_per_extra_info_rec
1348 	  );
1349    p_race_ethnic_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1350    p_race_ethnic_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1351    p_race_ethnic_info.p_hispanic 					 :=  l_per_extra_info_rec.pei_information3;
1352    p_race_ethnic_info.p_american_indian  			 :=  l_per_extra_info_rec.pei_information4;
1353    p_race_ethnic_info.p_asian     					 :=  l_per_extra_info_rec.pei_information5;
1354    p_race_ethnic_info.p_black_afr_american 			 :=  l_per_extra_info_rec.pei_information6;
1355    p_race_ethnic_info.p_hawaiian_pacific  			 :=  l_per_extra_info_rec.pei_information7;
1356    p_race_ethnic_info.p_white  						 :=  l_per_extra_info_rec.pei_information8;
1357 
1358 
1359 -- Retrieve pos_valid_grade
1360 
1361    If p_pa_request_rec.to_position_id is null then
1362      l_position_id := p_pa_request_rec.from_position_id;
1363    Else
1364      l_position_id := p_pa_request_rec.to_position_id;
1365    End if;
1366 
1367   ghr_history_fetch.fetch_positionei
1368   (p_position_id                =>  l_position_id,
1369    p_information_type           => 'GHR_US_POS_VALID_GRADE',
1370    p_date_effective             =>  p_pa_request_rec.effective_date,
1371    p_pos_ei_data                =>  l_pos_extra_info_rec
1372    );
1373 
1374    hr_utility.set_location('retrieved pos valid grade ',15);
1375 
1376    p_valid_grade.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1377    p_valid_grade.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1378    p_valid_grade.valid_grade                       :=  l_pos_extra_info_rec.poei_information3;
1379    p_valid_grade.target_grade                      :=  l_pos_extra_info_rec.poei_information4;
1380    p_valid_grade.pay_table_id                      :=  l_pos_extra_info_rec.poei_information5;
1381    p_valid_grade.pay_basis                         :=  l_pos_extra_info_rec.poei_information6;
1382    p_valid_grade.employment_category_group         :=  l_pos_extra_info_rec.poei_information7;
1383    hr_utility.set_location('POS_VAL_GRADE - POS ID ' || to_char(l_position_id),1);
1384    hr_utility.set_location('POS_VAL_GRADE - OVN ' || to_char(l_pos_extra_info_rec.object_version_number),2);
1385    hr_utility.set_location('POS_VAL_GRADE - POEI ID' || to_char(l_pos_extra_info_rec.position_extra_info_id),3);
1386 
1387    l_pos_extra_info_rec   :=  null;
1388 
1389   -- Retrieve Position group1
1390 
1391 
1392   ghr_history_fetch.fetch_positionei
1393   (p_position_id                =>  l_position_id,
1394    p_information_type           => 'GHR_US_POS_GRP1',
1395    p_date_effective             =>  p_pa_request_rec.effective_date,
1396    p_pos_ei_data                =>  l_pos_extra_info_rec
1397   );
1398 
1399 
1400    hr_utility.set_location('retrieved pos grp 1 ',16);
1401 
1402    p_pos_grp1.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1403    p_pos_grp1.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1404    p_pos_grp1.personnel_office_id               :=  l_pos_extra_info_rec.poei_information3;
1405    p_pos_grp1.office_symbol                     :=  l_pos_extra_info_rec.poei_information4;
1406    p_pos_grp1.organization_structure_id         :=  l_pos_extra_info_rec.poei_information5;
1407    p_pos_grp1.occupation_category_code          :=  l_pos_extra_info_rec.poei_information6;
1408    p_pos_grp1.flsa_category                     :=  l_pos_extra_info_rec.poei_information7;
1409    p_pos_grp1.bargaining_unit_status            :=  l_pos_extra_info_rec.poei_information8;
1410    p_pos_grp1.competitive_level                 :=  l_pos_extra_info_rec.poei_information9;
1411    p_pos_grp1.work_schedule                     :=  l_pos_extra_info_rec.poei_information10;
1412    p_pos_grp1.functional_class                  :=  l_pos_extra_info_rec.poei_information11;
1413    p_pos_grp1.position_working_title            :=  l_pos_extra_info_rec.poei_information12;
1414    p_pos_grp1.position_sensitivity              :=  l_pos_extra_info_rec.poei_information13;
1415    p_pos_grp1.security_access                   :=  l_pos_extra_info_rec.poei_information14;
1416    p_pos_grp1.prp_sci                           :=  l_pos_extra_info_rec.poei_information15;
1417    p_pos_grp1.supervisory_status                :=  l_pos_extra_info_rec.poei_information16;
1418    p_pos_grp1.type_employee_supervised          :=  l_pos_extra_info_rec.poei_information17;
1419    p_pos_grp1.payroll_office_id                 :=  l_pos_extra_info_rec.poei_information18;
1420    p_pos_grp1.timekeeper                        :=  l_pos_extra_info_rec.poei_information19;
1421    p_pos_grp1.competitive_area                  :=  l_pos_extra_info_rec.poei_information20;
1422    p_pos_grp1.positions_organization            :=  l_pos_extra_info_rec.poei_information21;
1423    p_pos_grp1.oct_report_flag                   :=  l_pos_extra_info_rec.poei_information22;
1424    p_pos_grp1.part_time_hours                   :=  l_pos_extra_info_rec.poei_information23;
1425 
1426 
1427 
1428     hr_utility.set_location('POS_gRP1 - POS ID ' || to_char(l_position_id),1);
1429     hr_utility.set_location('POS_GRP1 - OVN ' || to_char(p_pos_grp1.object_version_number),2);
1430     hr_utility.set_location('POS_GRP1 - POEI ID' || to_char(p_pos_grp1.position_extra_info_id),3);
1431 
1432 l_pos_extra_info_rec   :=  null;
1433 
1434  -- Retrieve Position Group2
1435 
1436  ghr_history_fetch.fetch_positionei
1437   (p_position_id                =>  l_position_id,
1438    p_information_type           => 'GHR_US_POS_GRP2',
1439    p_date_effective             =>  p_pa_request_rec.effective_date,
1440    p_pos_ei_data                =>  l_pos_extra_info_rec
1441   );
1442 
1443 
1444   hr_utility.set_location('retrieved pos grp 2 ',17);
1445 
1446 
1447    p_pos_grp2.position_extra_info_id            :=  l_pos_extra_info_rec.position_extra_info_id;
1448    p_pos_grp2.object_version_number             :=  l_pos_extra_info_rec.object_version_number;
1449    p_pos_grp2.position_occupied                 :=  l_pos_extra_info_rec.poei_information3;
1450    p_pos_grp2.organization_function_code        :=  l_pos_extra_info_rec.poei_information4;
1451    p_pos_grp2.date_position_classified          :=  l_pos_extra_info_rec.poei_information5;
1452    p_pos_grp2.date_last_position_audit          :=  l_pos_extra_info_rec.poei_information6;
1453    p_pos_grp2.classification_official           :=  l_pos_extra_info_rec.poei_information7;
1454    p_pos_grp2.language_required                 :=  l_pos_extra_info_rec.poei_information8;
1455    p_pos_grp2.drug_test                         :=  l_pos_extra_info_rec.poei_information9;
1456    p_pos_grp2.financial_statement               :=  l_pos_extra_info_rec.poei_information10;
1457    p_pos_grp2.training_program_id               :=  l_pos_extra_info_rec.poei_information11;
1458    p_pos_grp2.key_emergency_essential           :=  l_pos_extra_info_rec.poei_information12;
1459    p_pos_grp2.appropriation_code1               :=  l_pos_extra_info_rec.poei_information13;
1460    p_pos_grp2.appropriation_code2               :=  l_pos_extra_info_rec.poei_information14;
1461    p_pos_grp2.intelligence_position_ind         :=  l_pos_extra_info_rec.poei_information15;
1462    p_pos_grp2.leo_position_indicator            :=  l_pos_extra_info_rec.poei_information16;
1463     hr_utility.set_location('POS_2 - POS ID ' || to_char(l_position_id),1);
1464     hr_utility.set_location('POS_2 - OVN ' || to_char(l_pos_extra_info_rec.object_version_number),2);
1465     hr_utility.set_location('POS_2 - POEI ID' || to_char(l_pos_extra_info_rec.position_extra_info_id),3);
1466 
1467    l_pos_extra_info_rec   :=  null;
1468 
1469  -- Retrieve  Position Obligation
1470 
1471   ghr_history_fetch.fetch_positionei
1472   (p_position_id                =>  l_position_id,
1473    p_information_type           => 'GHR_US_POS_OBLIG',
1474    p_date_effective             =>  p_pa_request_rec.effective_date,
1475    p_pos_ei_data                =>  l_pos_extra_info_rec
1476   );
1477   p_pos_oblig.position_extra_info_id            := l_pos_extra_info_rec.position_extra_info_id;
1478   p_pos_oblig.object_version_number             := l_pos_extra_info_rec.object_version_number;
1479   p_pos_oblig.expiration_date 			:= l_pos_extra_info_rec.poei_information3;
1480   p_pos_oblig.obligation_type 			:= l_pos_extra_info_rec.poei_information4;
1481   p_pos_oblig.employee_ssn    		      := l_pos_extra_info_rec.poei_information5;
1482   l_pos_extra_info_rec           			:= null;
1483 
1484   hr_utility.set_location('retrieved pos oblig ',18);
1485 
1486 /* Retrieve GHR_US_POS_CAR_PROG */
1487 
1488 /* Retrieve GHR_US_PER_BENEFITS_CONT */
1489   -- Bug 6312144 IPA Benefits Continuation EIT changes
1490 
1491   hr_utility.set_location('Before retrieving IPA Benefits Continuation',19);
1492   l_per_extra_info_rec   :=  null;
1493   ghr_history_fetch.fetch_peopleei
1494   	  (p_person_id                 =>  p_pa_request_rec.person_id,
1495 	   p_information_type          => 'GHR_US_PER_BENEFITS_CONT',
1496 	   p_date_effective            =>  p_pa_request_rec.effective_date,
1497 	   p_per_ei_data               =>  l_per_extra_info_rec
1498 	  );
1499    p_ipa_benefits_cont.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1500    p_ipa_benefits_cont.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1501    p_ipa_benefits_cont.FEGLI_Indicator 		      :=  l_per_extra_info_rec.pei_information1;
1502    p_ipa_benefits_cont.FEGLI_Election_Date            :=  l_per_extra_info_rec.pei_information2;
1503    p_ipa_benefits_cont.FEGLI_Elec_Not_Date    	      :=  l_per_extra_info_rec.pei_information3;
1504    p_ipa_benefits_cont.FEHB_Indicator 	              :=  l_per_extra_info_rec.pei_information4;
1505    p_ipa_benefits_cont.FEHB_Election_Date  	      :=  l_per_extra_info_rec.pei_information5;
1506    p_ipa_benefits_cont.FEHB_Elec_Notf_Date	      :=  l_per_extra_info_rec.pei_information6;
1507    p_ipa_benefits_cont.retirement_Indicator           :=  l_per_extra_info_rec.pei_information7;
1508    p_ipa_benefits_cont.retirement_Elec_Date           :=  l_per_extra_info_rec.pei_information12;
1509    p_ipa_benefits_cont.retirement_Elec_Notf_Date      :=  l_per_extra_info_rec.pei_information8;
1510    p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Elec_Date :=  l_per_extra_info_rec.pei_information9;
1511    p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Notf_Date :=  l_per_extra_info_rec.pei_information10;
1512    p_ipa_benefits_cont.Cont_Term_Insuff_Pmt_Type_Code :=  l_per_extra_info_rec.pei_information11;
1513 
1514 /* Retrieve GHR_US_PER_BENEFITS_CONT */
1515  hr_utility.set_location('Retrieving IPA Benefits Continuation',20);
1516 
1517 /* Retrieve GHR_US_PER_RETIRMENT_SYS_INFO*/
1518 
1519  hr_utility.set_location('Before retrieving Retirement System Information',21);
1520  -- Bug 6312144 Retirement System Information EIT changes
1521  l_per_extra_info_rec   :=  null;
1522  ghr_history_fetch.fetch_peopleei
1523 	   (p_person_id                 =>  p_pa_request_rec.person_id,
1524 	    p_information_type          => 'GHR_US_PER_RETIRMENT_SYS_INFO',
1525 	    p_date_effective            =>  p_pa_request_rec.effective_date,
1526 	    p_per_ei_data               =>  l_per_extra_info_rec
1527 	   );
1528    p_retirement_info.person_extra_info_id           :=  l_per_extra_info_rec.person_extra_info_id;
1529    p_retirement_info.object_version_number          :=  l_per_extra_info_rec.object_version_number;
1530    p_retirement_info.special_population_code        :=  l_per_extra_info_rec.pei_information1;
1531    p_retirement_info.App_Exc_CSRS_Ind               :=  l_per_extra_info_rec.pei_information2;
1532    p_retirement_info.App_Exc_FERS_Ind               :=  l_per_extra_info_rec.pei_information3;
1533    p_retirement_info.FICA_Coverage_Ind1             :=  l_per_extra_info_rec.pei_information4;
1534    p_retirement_info.FICA_Coverage_Ind2             :=  l_per_extra_info_rec.pei_information5;
1535 
1536    hr_utility.set_location('After Retirement System Information',22);
1537 /* Retrieve GHR_US_PER_RETIRMENT_SYS_INFO*/
1538 
1539 End retrieve_all_extra_info;
1540 
1541 
1542 
1543 -- **********************  *********
1544 -- procedure SF52_br_extra_info
1545 -- *******************************
1546 --
1547 --
1548 /*
1549 	This procedure gets other Sf52 data that has not been retrieved by
1550       the process_sf52_extra_info and process_non_sf52_extra_info procedure
1551 */
1552 --
1553 
1554 procedure SF52_br_extra_info
1555 (
1556   P_PA_REQUEST_REC  		IN       GHR_PA_REQUESTS%ROWTYPE
1557  ,p_agency_code			out nocopy      varchar2
1558  ) is
1559 --
1560 l_bus_gp 	            number;
1561 l_agency_code 	      varchar2(50);
1562 l_proc                  varchar2(70) := 'SF52_br_extra_info';
1563 l_position_id           per_positions.position_id%type;
1564 
1565 --
1566 --Bug# 957677  -- Parameter Name Change
1567 cursor   c_bus_gp(p_position_id number) is
1568   select pos.business_group_id
1569   from   hr_all_positions_f pos  -- Venkat - Position DT
1570   where  pos.position_id = p_position_id
1571      and p_pa_request_rec.effective_date between
1572          pos.effective_start_date and pos.effective_end_date;
1573 
1574 Cursor c_pa_request_extra_info (l_information_type varchar2) is
1575   Select *
1576   from   ghr_pa_request_extra_info
1577   where  pa_request_id    =  p_pa_request_rec.pa_request_id
1578   and    information_type =  l_information_type;
1579 
1580 --
1581 Begin
1582   --
1583   g_effective_date              :=  nvl(p_pa_request_rec.effective_date,sysdate);
1584   hr_utility.set_location('Entering  ' || l_proc,10);
1585   --
1586   If p_pa_request_rec.to_position_id is null then
1587     l_position_id :=  p_pa_request_rec.from_position_id;
1588   Else
1589     l_position_id :=  p_pa_request_rec.to_position_id;
1590   End if;
1591   for bus_gp in c_bus_gp(l_position_id) loop
1592     l_bus_gp := bus_gp.business_group_id;
1593   End loop;
1594   --
1595   -- Agency Code
1596   -- if this is a change in data element and the pa_req ei agency code is not null,
1597   -- then take the agency code from the extra info for the action. If this is a realignment,
1598   -- and the pa_req_ei agency code is not null, then take the agency code from the extra info for the action.
1599   -- Otherwise, use the agency code associated with l_position_id.
1600   --
1601   if  p_pa_request_rec.noa_family_code = 'CHG_DATA_ELEMENT'  then
1602       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_CHG_DATA_ELEMENT') loop
1603          l_agency_code   :=  c_ei_rec.rei_information4;
1604       end loop;
1605   elsif p_pa_request_rec.noa_family_code = 'REALIGNMENT' then
1606       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_REALIGNMENT') loop
1607          l_agency_code   :=  c_ei_rec.rei_information10;
1608       end loop;
1609   end if;
1610   if  p_pa_request_rec.noa_family_code = 'CHG_DATA_ELEMENT'  and
1611 	l_agency_code is not null  then
1612       p_agency_code := l_agency_code;
1613   elsif
1614 	p_pa_request_rec.noa_family_code = 'REALIGNMENT' and
1615 	l_agency_code is not null then
1616 	p_agency_code := l_agency_code;
1617   else
1618   	p_agency_code  :=  ghr_api.get_position_agency_code_pos
1619                            (p_position_id       =>   l_position_id
1620                            ,p_business_group_id =>   l_bus_gp
1621                            ,p_effective_date    => p_pa_request_rec.effective_date
1622                            );
1623   end if;
1624   hr_utility.set_location('Leaving ' ||l_proc,40);
1625 end SF52_br_extra_info;
1626 
1627 --
1628 -- *****************************
1629 -- procedure Process_Sf52_Extra_Info
1630 -- *****************************
1631 --
1632 
1633 -- This procedure Updates the various Record Groups with Data from the SF52 Form.
1634 
1635 procedure Process_Sf52_Extra_Info
1636 (p_pa_request_rec             in     ghr_pa_requests%rowtype,
1637  p_asg_sf52                   in out nocopy ghr_api.asg_sf52_type,
1638  p_per_sf52                   in out nocopy ghr_api.per_sf52_type,
1639  p_per_group1                 in out nocopy ghr_api.per_group1_type,
1640  p_per_scd_info               in out nocopy ghr_api.per_scd_info_type,
1641  p_pos_grp2                   in out nocopy ghr_api.pos_grp2_type,
1642  p_pos_grp1                   in out nocopy ghr_api.pos_grp1_type,
1643  p_loc_info                   in out nocopy ghr_api.loc_info_type,
1644  p_recruitment_bonus	      in out nocopy ghr_api.recruitment_bonus_type ,
1645  p_relocation_bonus           in out nocopy ghr_api.relocation_bonus_type,
1646  p_student_loan_repay         in out nocopy ghr_api.student_loan_repay_type,
1647  p_extra_info_rec	            in out nocopy ghr_api.extra_info_rec_type,
1648  p_valid_grade  in out  nocopy ghr_api.pos_valid_grade_type)
1649  is
1650 --
1651 l_noa_code		      ghr_nature_of_actions.code%type;
1652 l_proc                  varchar2(70) := 'Process_Sf52_Extra_Info';
1653 l_person_type           per_person_types.system_person_type%type;
1654 
1655 --
1656 
1657 
1658  cursor    c_person_type is
1659    select  ppt.system_person_type
1660    from    per_person_types  ppt,
1661            per_all_people_f      ppf
1662    where   ppf.person_id       =  p_pa_request_rec.person_id
1663    and     ppt.person_type_id  =  ppf.person_type_id
1664    and     g_effective_date
1665    between ppf.effective_start_date
1666    and     ppf.effective_end_date;
1667 
1668 /*Cursor c_pa_request_extra_info (l_information_type varchar2) is
1669   Select rei_information4,rei_information8
1670   from   ghr_pa_request_extra_info
1671   where  pa_request_id    =  p_pa_request_rec.pa_request_id
1672   and    information_type =  l_information_type; */
1673 --
1674 /*l_payroll_office_id       ghr_pa_request_extra_info.rei_information4%type;
1675 l_pos_org                 ghr_pa_request_extra_info.rei_information8%type;*/
1676 l_student_loan_repay       ghr_api.student_loan_repay_type;
1677 
1678 --Bug  6881863
1679 l_calc_table_id        pay_user_tables.user_table_id%type;
1680 --
1681 
1682 Begin
1683 
1684   g_effective_date           :=  nvl(p_pa_request_rec.effective_date,sysdate);
1685 
1686 /*l_payroll_office_id          := p_pos_grp1.payroll_office_id;
1687 l_pos_org                    := p_pos_grp1.positions_organization;*/
1688 l_student_loan_repay := p_student_loan_repay;
1689 
1690   hr_utility.set_location('Entering ' ||l_proc,5);
1691 
1692 --    **********************
1693 --    Assignment SF52  Extra Info
1694 --     **********************
1695 --
1696   -- FWFA Changes.
1697   If P_pa_request_rec.To_Step_Or_Rate      is not null  or
1698      P_pa_request_rec.Tenure                is not null or
1699      P_pa_request_rec.Annuitant_Indicator   is not null or
1700      P_pa_request_rec.Pay_Rate_Determinant  is not null or
1701      p_pa_request_rec.to_pay_table_identifier is not null
1702    then
1703 --
1704 --
1705     hr_utility.set_location(l_proc,10);
1706 
1707 --
1708     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,1);
1709     If p_pa_request_rec.to_step_or_rate is not null then
1710       If P_pa_request_rec.to_step_or_rate <>
1711         nvl(p_asg_sf52.step_or_rate,hr_api.g_varchar2) then
1712         hr_utility.set_location(l_proc,20);
1713         p_Asg_sf52.Asg_sf52_flag       := 'Y';
1714         p_Asg_Sf52.Step_Or_Rate        :=  P_pa_request_rec.to_Step_Or_Rate;
1715       End if;
1716     End if;
1717 --
1718     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,2);
1719     hr_utility.set_location('old tenure  ' || p_asg_sf52.tenure,2);
1720     hr_utility.set_location('new tenure  ' || p_pa_request_rec.tenure,2);
1721     hr_utility.set_location('old ann ind  ' || p_asg_sf52.annuitant_indicator,2);
1722 
1723 
1724     If p_pa_request_rec.tenure is not null then
1725        If P_pa_request_rec.Tenure        <>
1726          nvl(p_asg_sf52.tenure,hr_api.g_varchar2) then
1727          hr_utility.set_location(l_proc,25);
1728          p_asg_sf52.asg_sf52_flag        := 'Y';
1729          P_Asg_Sf52.Tenure               :=  P_pa_request_rec.Tenure ;
1730        End if;
1731     End if;
1732 --
1733     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,3);
1734 
1735     If p_pa_request_rec.annuitant_indicator is not null then
1736       If P_pa_request_rec.Annuitant_Indicator <>
1737         nvl(p_asg_sf52.annuitant_indicator,hr_api.g_varchar2)then
1738         hr_utility.set_location(l_proc,30);
1739         p_asg_sf52.asg_sf52_flag        := 'Y';
1740         P_Asg_Sf52.Annuitant_Indicator  := P_pa_request_rec.Annuitant_Indicator;
1741       End if;
1742     End if;
1743 --
1744     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,4);
1745 
1746     If p_pa_request_rec.pay_rate_determinant is not null then
1747       If P_pa_request_rec.Pay_Rate_Determinant<>
1748         nvl(p_asg_sf52.pay_rate_determinant,hr_api.g_varchar2) then
1749         hr_utility.set_location(l_proc,35);
1750         p_asg_sf52.asg_sf52_flag         := 'Y';
1751         p_Asg_Sf52.Pay_Rate_Determinant  := P_pa_request_rec.Pay_Rate_Determinant;
1752       End if;
1753     End if;
1754    hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,5);
1755   End if;
1756 
1757   If nvl(P_pa_request_rec.work_schedule,hr_api.g_varchar2) <>
1758         nvl(p_asg_sf52.work_schedule,hr_api.g_varchar2) then
1759         hr_utility.set_location(l_proc,35);
1760         p_asg_sf52.asg_sf52_flag         := 'Y';
1761         p_Asg_Sf52.work_schedule  := P_pa_request_rec.work_schedule;
1762   End if;
1763 
1764     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,6);
1765 
1766   If nvl(P_pa_request_rec.part_time_hours,hr_api.g_number) <>
1767         nvl(p_asg_sf52.part_time_hours,hr_api.g_number) then
1768         hr_utility.set_location(l_proc,35);
1769         p_asg_sf52.asg_sf52_flag         := 'Y';
1770         p_Asg_Sf52.part_time_hours   := P_pa_request_rec.part_time_hours;
1771   End if;
1772  -- 809503
1773   for person_type_rec in c_person_type loop
1774      IF person_type_rec.system_person_type  = 'EX_EMP' and
1775        p_pa_request_rec.noa_family_code in ('CONV_APP','APP','APPT_TRANS') THEN
1776        p_asg_sf52.asg_sf52_flag := 'Y';
1777      END IF;
1778   end loop;
1779 
1780    hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,6);
1781     If p_pa_request_rec.to_pay_table_identifier is not null then
1782       If P_pa_request_rec.to_pay_table_identifier <>
1783         nvl(p_asg_sf52.calc_pay_table,hr_api.g_number)then
1784         hr_utility.set_location(l_proc,30);
1785         p_asg_sf52.asg_sf52_flag        := 'Y';
1786         P_Asg_Sf52.calc_pay_table  := P_pa_request_rec.to_pay_table_identifier;
1787       End if;
1788     End if;
1789 
1790     -- Added for the bug # 6881863
1791     -- to fetch the pay table identifier from position if it getting as NULL if PRD is K or J
1792     IF p_pa_request_rec.to_pay_table_identifier is null and NVL(p_pa_request_rec.pay_rate_determinant,'X') in ('K','J') then
1793        l_calc_table_id := ghr_pay_calc.get_user_table_id(p_position_id => p_pa_request_rec.to_position_id,
1794 	                                                p_effective_date => p_pa_request_rec.effective_date);
1795        p_asg_sf52.asg_sf52_flag        := 'Y';
1796        P_Asg_Sf52.calc_pay_table  := l_calc_table_id;
1797     END IF;
1798     -- 6881863
1799     hr_utility.set_location('ASG FLAG ' || p_asg_sf52.asg_sf52_flag,7);
1800 
1801 
1802 
1803 --
1804 --  ********************
1805 -- Additional Location DDF
1806 --  ********************
1807   p_Loc_Info.duty_station_id             := to_char(p_pa_request_rec.duty_station_id);
1808 
1809 
1810 --
1811 --    **********************
1812 --    Person  SF52  Extra Info
1813 --     **********************
1814 --
1815   If P_pa_request_rec.Citizenship           is not null or
1816      P_pa_request_rec.Veterans_Preference   is not null or
1817      P_pa_request_rec.Veterans_Pref_for_rif is not null or
1818      P_pa_request_rec.Veterans_Status       is not null then
1819     hr_utility.set_location(l_proc,55);
1820 --
1821 --
1822     If p_pa_request_rec.citizenship is not null then
1823       If p_pa_request_rec.Citizenship  <> nvl(p_per_sf52.citizenship,hr_api.g_varchar2) then
1824         hr_utility.set_location(l_proc,65);
1825         P_Per_sf52.Per_Sf52_Flag      := 'Y';
1826         P_Per_sf52.Citizenship        := P_pa_request_rec.Citizenship;
1827       End if;
1828     End if;
1829 --
1830   If p_pa_request_rec.veterans_preference is not null then
1831     If P_pa_request_rec.Veterans_Preference <>
1832       nvl(p_per_sf52.veterans_preference,hr_api.g_varchar2) then
1833       hr_utility.set_location(l_proc,70);
1834       P_Per_sf52.Per_Sf52_Flag       := 'Y';
1835       P_Per_sf52.Veterans_Preference := P_pa_request_rec.Veterans_Preference;
1836     End if;
1837   End if;
1838 
1839   If p_pa_request_rec.veterans_pref_for_rif is not null then
1840     If P_pa_request_rec.Veterans_Pref_for_rif <>
1841       nvl(p_per_sf52.veterans_preference_for_rif,hr_api.g_varchar2) then
1842       hr_utility.set_location(l_proc,75);
1843       P_Per_sf52.Per_Sf52_Flag               := 'Y';
1844       P_Per_sf52.Veterans_Preference_For_Rif := P_pa_request_rec.Veterans_Pref_for_rif;
1845     End if;
1846   End if;
1847 
1848   If p_pa_request_rec.veterans_status is not null then
1849     If P_pa_request_rec.Veterans_Status <>
1850       nvl(p_per_sf52.veterans_status,hr_api.g_varchar2)then
1851       hr_utility.set_location(l_proc,80);
1852       P_Per_sf52.Per_Sf52_Flag      := 'Y';
1853       P_Per_sf52.Veterans_Status    := P_pa_request_rec.Veterans_Status;
1854     End if;
1855   End if;
1856 --
1857 End if;
1858 
1859 --
1860 --    **********************
1861 --    per_scd extra info
1862 --     **********************
1863 
1864 If p_pa_request_rec.service_comp_date is not null then
1865   hr_utility.set_location(l_proc,85);
1866 
1867   hr_utility.set_location(l_proc,90);
1868   If fnd_date.date_to_canonical(p_pa_request_rec.service_comp_date)
1869      <> nvl(p_per_scd_info.scd_leave,fnd_date.date_to_canonical(hr_api.g_date)) then
1870     hr_utility.set_location(l_proc,95);
1871     p_per_scd_info.scd_leave          := fnd_date.date_to_canonical(p_pa_request_rec.service_comp_date);
1872     p_per_scd_info.per_scd_info_flag  := 'Y';
1873   End if;
1874  End if;
1875 
1876 --
1877 --
1878 --    **********************
1879 --    Position Group1 Extra Info
1880 --     **********************
1881 --
1882 -- JH Add part time Hours
1883   /*if p_pa_request_rec.noa_family_code = 'REALIGNMENT' then
1884   hr_utility.set_location('Inside PRUP realign check'||p_pa_request_rec.noa_family_code,12345);
1885       for c_ei_rec in c_pa_request_extra_info('GHR_US_PAR_REALIGNMENT') loop
1886          If c_ei_rec.rei_information4 is not null then
1887 	 l_payroll_office_id   :=  c_ei_rec.rei_information4;
1888 	 end if;
1889 	 If c_ei_rec.rei_information8 is not null then
1890 	 l_pos_org             :=  c_ei_rec.rei_information8;
1891 	 end if;
1892       end loop;
1893     hr_utility.set_location('Inside PRUP payroll check'||l_payroll_office_id,12345);
1894     p_pos_grp1.payroll_office_id := l_payroll_office_id;
1895 
1896     hr_utility.set_location('Inside PRUP pos org check'||l_pos_org,12345);
1897     p_pos_grp1.positions_organization := l_pos_org;
1898   end if;*/
1899 
1900   If 	P_pa_request_rec.to_Occ_Code		      	is not null or
1901 	P_pa_request_rec.Bargaining_Unit_Status	 	is not null or
1902 	P_pa_request_rec.Work_Schedule		 	is not null or
1903 	P_pa_request_rec.Functional_Class	 	      is not null or
1904 	P_pa_request_rec.FLSA_Category		 	is not null or
1905 	P_pa_request_rec.Supervisory_Status		      is not null or
1906       P_pa_request_rec.part_time_hours			is not null  then
1907     hr_utility.set_location(l_proc,95);
1908 --
1909 --
1910 	-- Bug 3226555 Commented below code as they can never be equal. It was unnecessarily inserting a
1911 	-- row into the history for the table PER_POSITIONS_EXTRA_INFO and thereby making the Position
1912 	-- status as invalid when cancellation to any action was done.
1913  /*   If p_pa_request_rec.to_occ_code is not null then
1914       If P_pa_request_rec.to_Occ_Code <>
1915         nvl(p_pos_grp1.occupation_category_code,hr_api.g_varchar2) then
1916         hr_utility.set_location(l_proc,105);
1917         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1918         P_Pos_grp1.Occupation_Category_Code := P_pa_request_rec.to_Occ_Code;
1919       End if;
1920     End if; */
1921 
1922     If p_pa_request_rec.bargaining_unit_status is not null then
1923       If P_pa_request_rec.Bargaining_Unit_Status <>
1924         nvl(p_pos_grp1.bargaining_unit_status,hr_api.g_varchar2) then
1925         hr_utility.set_location(l_proc,110);
1926         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1927         P_Pos_grp1.Bargaining_Unit_Status := P_pa_request_rec.Bargaining_Unit_Status;
1928       End if;
1929     End if;
1930 
1931 -- JH removing comments so position is updated for WS and adding PTH update
1932 -- Bugs 773851, 773795
1933       If p_pa_request_rec.work_schedule is not null then
1934       If P_pa_request_rec.Work_Schedule <>
1935         nvl(p_pos_grp1.work_schedule,hr_api.g_varchar2) then
1936         hr_utility.set_location(l_proc,115);
1937         hr_utility.set_location('JH Rec WS = ' || P_pa_request_rec.work_schedule,115);
1938         hr_utility.set_location('JH Posn Grp1 WS = ' || p_pos_grp1.work_schedule,115);
1939         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1940         P_Pos_grp1.Work_Schedule := P_pa_request_rec.Work_Schedule;
1941         hr_utility.set_location('JH Update WS = ' || p_pos_grp1.work_schedule,115);
1942       End if;
1943     End if;
1944 
1945 -- JH Hard coded to pass null if WS is F, G, B, I, J.
1946      If p_pa_request_rec.part_time_hours is not null then
1947       If P_pa_request_rec.part_time_hours <>
1948         nvl(p_pos_grp1.part_time_hours,hr_api.g_number) then
1949         hr_utility.set_location(l_proc,117);
1950         hr_utility.set_location('JH Rec PTH = ' || P_pa_request_rec.part_time_hours,117);
1951         hr_utility.set_location('JH Posn Grp1 PTH = ' || p_pos_grp1.part_time_hours,117);
1952         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1953         P_Pos_grp1.part_time_hours := P_pa_request_rec.part_time_hours;
1954         hr_utility.set_location('JH Update PTH = ' || p_pos_grp1.part_time_hours,117);
1955       End if;
1956     Elsif P_Pos_grp1.Work_Schedule in ('F', 'G', 'B', 'I', 'J') Then
1957         P_Pos_grp1.part_time_hours := null;
1958     End if;
1959 -- JH End changes
1960 
1961     If p_pa_request_rec.functional_class is not null then
1962       If P_pa_request_rec.Functional_Class  <>
1963         nvl(p_pos_grp1.functional_class,hr_api.g_varchar2) then
1964         hr_utility.set_location(l_proc,120);
1965         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1966         P_Pos_grp1.Functional_Class := P_pa_request_rec.Functional_Class;
1967       End if;
1968     End if;
1969 
1970     If p_pa_request_rec.flsa_category is not null then
1971       If P_pa_request_rec.FLSA_Category <>
1972         nvl(p_pos_grp1.flsa_category,hr_api.g_varchar2) then
1973         hr_utility.set_location(l_proc,125);
1974         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1975         P_Pos_grp1.FLSA_Category := P_pa_request_rec.FLSA_Category;
1976       End if;
1977     End if;
1978 
1979     If p_pa_request_rec.supervisory_status is not null then
1980       If P_pa_request_rec.Supervisory_Status <>
1981         nvl(p_pos_grp1.supervisory_status,hr_api.g_varchar2) then
1982         hr_utility.set_location(l_proc,130);
1983         P_Pos_grp1.Pos_Grp1_Flag     := 'Y';
1984         P_Pos_grp1.Supervisory_Status := P_pa_request_rec.Supervisory_Status;
1985       End if;
1986     End if;
1987 
1988   End If;
1989 
1990 --
1991 --    **********************
1992 --    Position Group2 Extra Info
1993 --     **********************
1994 --
1995   If  P_pa_request_rec.Appropriation_Code1	 	is not null or
1996 	P_pa_request_rec.Appropriation_Code2	 	is not null or
1997       p_pa_request_rec.position_occupied              is not null then  --*
1998 --
1999      hr_utility.set_location(l_proc,135);
2000 --
2001     If p_pa_request_rec.position_occupied is not null then
2002       If p_pa_request_rec.position_occupied <> nvl(p_pos_grp2.position_occupied,hr_api.g_varchar2) then
2003         hr_utility.set_location(l_proc,145);
2004         P_Pos_grp2.Pos_grp2_flag          :=  'Y';
2005         p_pos_grp2.position_occupied      :=  p_pa_request_rec.position_occupied;
2006       End if;
2007     End if;
2008 
2009     If p_pa_request_rec.appropriation_code1 is not null then
2010       If P_pa_request_rec.Appropriation_Code1 <>  nvl(p_pos_grp2.appropriation_code1,hr_api.g_varchar2) then
2011         hr_utility.set_location(l_proc,150);
2012         P_Pos_grp2.Pos_grp2_flag    :=  'Y';
2013         P_Pos_grp2.Appropriation_Code1 := P_pa_request_rec.Appropriation_Code1;
2014       End if;
2015     End if;
2016 
2017 --
2018     If p_pa_request_rec.appropriation_code2 is not null then
2019       If p_pa_request_rec.Appropriation_Code2 <> nvl(p_pos_grp2.appropriation_code2,hr_api.g_varchar2) then
2020         hr_utility.set_location(l_proc,155);
2021         P_Pos_grp2.Pos_grp2_flag    :=  'Y';
2022         P_Pos_grp2.Appropriation_Code2:= P_pa_request_rec.Appropriation_Code2;
2023       End if;
2024     End if;
2025 --
2026   End if;
2027 
2028 --    ************************
2029 --    Position Valid Grade EIT
2030 --    ************************
2031 -- If Grade is changed, then need to update it to Position Bug 2414903
2032 	IF p_pa_request_rec.to_grade_id IS NOT NULL THEN
2033 		IF p_pa_request_rec.to_grade_id <> NVL(to_number(p_valid_grade.valid_grade),hr_api.g_number) THEN
2034 			p_valid_grade.pos_valid_grade_flag := 'Y';
2035 			p_valid_grade.valid_grade := p_pa_request_rec.to_grade_id;
2036 		END IF;
2037 	END IF;
2038 
2039 
2040 --    *****************
2041 --    Recruitment Bonus
2042 --    *****************
2043 --
2044 	If  nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '815' then
2045          hr_utility.set_location(l_proc,165);
2046         p_recruitment_bonus.p_recruitment_bonus := p_pa_request_rec.award_amount;
2047 		  p_recruitment_bonus.p_percentage        := p_pa_request_rec.award_percentage;
2048 	END IF;
2049 --
2050 --
2051 --
2052 --    ***************
2053 --    Relocation Bonus
2054 --    ***************
2055 --
2056 	If nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '816' then
2057         hr_utility.set_location(l_proc,170);
2058         p_relocation_bonus.p_relocation_bonus := p_pa_request_rec.award_amount;
2059 		  p_relocation_bonus.p_percentage        := p_pa_request_rec.award_percentage;
2060 	End if;
2061 --
2062 --
2063 --    ***************
2064 --    Student Loan Repayment
2065 --    ***************
2066 --
2067 	If nvl(p_pa_request_rec.first_noa_code,hr_api.g_varchar2) = '817' then
2068         hr_utility.set_location(l_proc,170);
2069         l_student_loan_repay.p_amount := p_pa_request_rec.award_amount;
2070 	p_student_loan_repay          := l_student_loan_repay;
2071 	End if;
2072 --
2073 --
2074 --
2075 EXCEPTION
2076 WHEN OTHERS THEN
2077 p_student_loan_repay := l_student_loan_repay;
2078 raise;
2079 
2080 End Process_Sf52_Extra_Info;
2081 
2082 --
2083 --  **********************************************************
2084 --  Process_non_SF-52_Extra_Info
2085 --  **********************************************************
2086 --
2087 PROCEDURE  Process_Non_Sf52_Extra_Info
2088 --
2089 (p_pa_request_rec			in out nocopy ghr_pa_requests%rowtype,
2090  p_generic_ei_rec             in     ghr_pa_request_extra_info%rowtype,
2091  p_per_group1		     	in out nocopy ghr_api.per_group1_type,
2092  p_per_scd_info               in out nocopy  ghr_api.per_scd_info_type,
2093  p_pos_grp2                   in out nocopy ghr_api.pos_grp2_type,
2094  p_pos_grp1                   in out nocopy ghr_api.pos_grp1_type,
2095  p_per_uniformed_services	in out nocopy ghr_api.per_uniformed_services_type,
2096  p_per_conversions            in out nocopy ghr_api.per_conversions_type,
2097  -- 4352589 BEN_EIT Changes
2098  p_per_benefit_info	      in out nocopy ghr_api.per_benefit_info_type,
2099  p_asg_non_sf52			in out nocopy ghr_api.asg_non_sf52_type,
2100  p_per_separate_Retire 		in out nocopy ghr_api.per_sep_retire_type,
2101  p_asg_nte_dates			in out nocopy ghr_api.asg_nte_dates_type,
2102  p_per_probations		      in out nocopy ghr_api.per_probations_type,
2103  p_per_retained_grade		in out nocopy ghr_api.per_retained_grade_type,
2104  --Bug#4486823 RRR Changes
2105  p_per_service_oblig        in out nocopy ghr_api.per_service_oblig_type,
2106  p_within_grade_increase	in out nocopy ghr_api.within_grade_increase_type,
2107  p_gov_awards                 in out nocopy ghr_api.government_awards_type,
2108  p_conduct_performance        in out nocopy ghr_api.conduct_performance_type,
2109  p_agency_sf52			in out nocopy ghr_api.agency_sf52_type,
2110  p_recruitment_bonus          in out nocopy ghr_apI.recruitment_bonus_type,
2111  p_relocation_bonus           in out nocopy ghr_apI.relocation_bonus_type,
2112  p_student_loan_repay         in out nocopy ghr_api.student_loan_repay_type,
2113  --Pradeep
2114  p_mddds_special_pay      in out nocopy ghr_api.mddds_special_pay_type,
2115   p_premium_pay_ind      in out nocopy ghr_api.premium_pay_ind_type,
2116 
2117  p_par_term_retained_grade    in out nocopy ghr_api.par_term_retained_grade_type,
2118  p_entitlement                in out nocopy ghr_api.entitlement_type,
2119  -- Bug#2759379 Added Fegli record
2120  p_fegli                      in out nocopy ghr_api.fegli_type,
2121  p_foreign_lang_prof_pay      in out nocopy ghr_api.foreign_lang_prof_pay_type,
2122 -- Bug#3385386 Added FTA record
2123  p_imm_fta                    in out nocopy ghr_api.fta_type,
2124  p_edp_pay                    in out nocopy ghr_api.edp_pay_type,
2125  p_hazard_pay                 in out nocopy ghr_api.hazard_pay_type,
2126  p_health_benefits            in out nocopy ghr_api.health_benefits_type,
2127  p_danger_pay                 in out nocopy ghr_api.danger_pay_type,
2128  p_imminent_danger_pay        in out nocopy ghr_api.imminent_danger_pay_type,
2129  p_living_quarters_allow      in out nocopy ghr_api.living_quarters_allow_type,
2130  p_post_diff_amt              in out nocopy ghr_api.post_diff_amt_type,
2131  p_post_diff_percent          in out nocopy ghr_api.post_diff_percent_type,
2132  p_sep_maintenance_allow      in out nocopy ghr_api.sep_maintenance_allow_type,
2133  p_supplemental_post_allow    in out nocopy ghr_api.supplemental_post_allow_type,
2134  p_temp_lodge_allow           in out nocopy ghr_api.temp_lodge_allow_type,
2135  p_premium_pay                in out nocopy ghr_api.premium_pay_type,
2136  p_retirement_annuity         in out nocopy ghr_api.retirement_annuity_type,
2137  p_severance_pay              in out nocopy ghr_api.severance_pay_type,
2138  p_thrift_saving_plan         in out nocopy ghr_api.thrift_saving_plan,
2139  p_retention_allow_review     in out nocopy ghr_api.retention_allow_review_type,
2140  p_health_ben_pre_tax         in out nocopy ghr_api.health_ben_pre_tax_type,
2141  p_race_ethnic_info	      in out nocopy ghr_api.per_race_ethnic_type, -- Bug 4724337 Race or National Origin changes
2142  p_ipa_benefits_cont          in out nocopy ghr_api.per_ipa_ben_cont_info_type,
2143  p_retirement_info            in out nocopy ghr_api.per_retirement_info_type
2144 )
2145 --
2146 IS
2147   --
2148   -- Declare local variables
2149 
2150   l_proc                      varchar2(70) := 'Process_non_sf52_extra_info';
2151   l_noa_code                  ghr_nature_of_actions.code%type;
2152   l_noa_id                    ghr_nature_of_actions.nature_of_action_id%type;
2153   l_information_type          ghr_pa_request_info_types.information_type%type;
2154   l_pa_request_ei_rec         ghr_pa_request_extra_info%rowtype;
2155   p_extra_info_agency_rec     ghr_api.extra_info_rec_type;
2156   l_session                   ghr_history_api.g_session_var_type;
2157   l_multiple_error_flag       boolean;
2158   -- Bug#5668878
2159   l_psi                       VARCHAR2(10);
2160   --
2161   -- Declare cursors
2162   --
2163   -- Bug#3941541 Added the effective date condition.
2164    Cursor c_info_types is
2165      Select  pit.information_type
2166      from    ghr_pa_request_info_types  pit,
2167              ghr_noa_families           nfa,
2168              ghr_families               fam
2169      where   nfa.nature_of_action_id  = p_pa_request_rec.first_noa_id
2170      and     nfa.noa_family_code      = fam.noa_family_code
2171      and     fam.pa_info_type_flag    = 'Y'
2172      and     pit.noa_family_code      = fam.noa_family_code
2173      and     pit.information_type     like 'GHR_US%'
2174      and     p_pa_request_rec.effective_date BETWEEN NVL(nfa.start_date_active,p_pa_request_rec.effective_date)
2175 	                                             AND NVL(nfa.end_date_active,p_pa_request_rec.effective_date);
2176   --
2177     Cursor c_pa_request_extra_info is
2178        Select *
2179        from   ghr_pa_request_extra_info
2180        where  pa_request_id    =  p_pa_request_rec.pa_request_id
2181        and    information_type =  l_information_type;
2182 -- Bug 3260890
2183   l_office_symbol per_position_extra_info.poei_information4%type := p_pos_grp1.office_symbol;
2184   l_organization_structure_id per_position_extra_info.poei_information5%type := p_pos_grp1.organization_structure_id;
2185   l_positions_organization 	per_position_extra_info.poei_information21%type := p_pos_grp1.positions_organization;
2186   l_organization_function_code per_position_extra_info.poei_information4%type := p_pos_grp2.organization_function_code;
2187   l_personnel_office_id per_position_extra_info.poei_information3%type := p_pos_grp1.personnel_office_id;
2188   l_payroll_office_id ghr_pa_request_extra_info.rei_information4%type := p_pos_grp1.payroll_office_id;
2189   -- End Bug 3260890
2190 
2191 -- Bug# 4672772 Begin
2192 
2193 	l_old_user_status			per_assignment_status_types.user_status%type;
2194 	l_old_system_status			per_assignment_status_types.per_system_status%type;
2195 	l_old_effective_start_date  date;
2196 	l_asg_extra_info_rec		per_assignment_extra_info%rowtype;
2197 	l_user_apnt_status			per_assignment_status_types.user_status%type;
2198 	l_user_apnt_eff_date		date;
2199 
2200 	Cursor c_user_status is
2201 	select ast.user_status,
2202          ast.per_system_status,
2203          asg.effective_start_date
2204 	from
2205 		per_assignment_status_types ast,
2206 		per_all_assignments_f asg
2207     where	asg.assignment_id = p_pa_request_rec.employee_assignment_id
2208     and		ast.assignment_status_type_id = asg.assignment_status_type_id
2209     and     p_pa_request_rec.effective_date
2210     between asg.effective_start_date
2211     and     asg.effective_end_date;
2212 
2213 	CURSOR	c_user_apnt_status IS
2214 	select 	ast.user_status,asg.effective_start_date
2215 	from	per_assignment_status_types ast,
2216 			per_all_assignments_f asg
2217 	where	ast.assignment_status_type_id = asg.assignment_status_type_id
2218 	and		asg.assignment_id = p_pa_request_rec.employee_assignment_id
2219 	and 	asg.primary_flag = 'Y'
2220 	order by asg.effective_start_date;
2221 
2222 -- Bug# 4672772 End
2223 --Begin Bug# 6083404
2224     l_user_actv_apnt_status			per_assignment_status_types.user_status%type;
2225     CURSOR c_user_actv_appt IS
2226     select 	ast.user_status
2227     from	per_assignment_status_types ast,
2228             per_all_assignments_f asg
2229     where	ast.assignment_status_type_id = asg.assignment_status_type_id
2230     and		asg.assignment_id = p_pa_request_rec.employee_assignment_id
2231     and 	asg.primary_flag = 'Y'
2232     and user_status='Active Appointment';
2233 --end Bug# 6083404
2234 
2235 
2236 
2237 --
2238   --
2239   -- Declare local procedures and local functions
2240   --
2241   -- Procedure  Set_extra_info
2242   --
2243   -- This overwrites the value of the core extra information segment with
2244   -- the value from the SF52 Extra Information entered by the User, along with the Current Request
2245   --
2246   Procedure set_extra_info
2247   (p_hr_extra_info         in out nocopy   varchar2,
2248    p_ghr_extra_info        in       varchar2,
2249    p_update_flag           in out nocopy   varchar2,
2250    p_auto_populate_flag    in       varchar2 default 'N'
2251   ) is
2252   Begin
2253     If nvl(p_hr_extra_info,hr_api.g_varchar2)
2254        <>  nvl(p_ghr_extra_info,hr_api.g_varchar2) then
2255        If p_auto_populate_flag = 'Y' and
2256           l_session.noa_id_correct is null then
2257           -- since it is autopopulated the user might have made it null
2258           -- and is not a correction
2259           p_hr_extra_info   := p_ghr_extra_info;
2260        else
2261           If p_ghr_extra_info is not null then
2262              p_hr_extra_info   := p_ghr_extra_info;
2263           elsif l_session.noa_id_correct is not null then
2264             -- VR -- Bug 2356243
2265             -- In the correction action -- All the extra info considred as auto
2266             -- populated. Update core with rpa extra info even if rpa extra
2267             -- info is null
2268              p_hr_extra_info   := p_ghr_extra_info;
2269           End if;
2270        end if;
2271        p_update_flag      := 'Y';
2272     End if;
2273 
2274   End set_extra_info;
2275   --
2276   --
2277   Procedure appt_info is
2278     l_proc     varchar2(70) := 'Process_non_sf52 - App1';
2279   --
2280   Begin
2281     hr_utility.set_location('Entering ' ||l_proc,5);
2282     hr_utility.set_location('before retr info in appt-info',1);
2283 
2284   -- If a CORRECTION action is being performed, then, we cannot force the User to
2285   -- enter the Mandatory Items on the SF52, as it might already exist in the Core
2286   -- Extra Information. In such cases , fetch the value from the CORE Extra information,
2287   -- if it is null on the SF52 Extra Information.
2288 
2289   -- In case of a correction ,org_app_auth_code1 and 2 will still be read from the
2290   -- LA Codes 1 and 2 and they have the potential to change it during a CORRECTION.
2291 
2292     If l_session.noa_id_correct is not null then
2293        set_extra_info(p_per_group1.appointment_type ,
2294                       l_pa_request_ei_rec.rei_information3,
2295                       p_per_group1.per_group1_flag);
2296        set_extra_info(p_per_group1.org_appointment_auth_code1,
2297                       p_pa_request_rec.first_action_la_code1,
2298                       p_per_group1.per_group1_flag);
2299        set_extra_info(p_per_group1.org_appointment_auth_code2,
2300                       p_pa_request_rec.first_action_la_code2,
2301                       p_per_group1.per_group1_flag);
2302        --Bug# 4941984(AFHR2)
2303        set_extra_info(p_per_group1.org_appointment_desc1,
2304                       p_pa_request_rec.first_action_la_desc1,
2305                       p_per_group1.per_group1_flag);
2306        set_extra_info(p_per_group1.org_appointment_desc2,
2307                       p_pa_request_rec.first_action_la_desc2,
2308                       p_per_group1.per_group1_flag);
2309        --Bug# 4941984(AFHR2)
2310     Else
2311       p_per_group1.appointment_type            :=  l_pa_request_ei_rec.rei_information3;
2312       p_per_group1.Org_appointment_auth_code1  :=  p_pa_request_rec.first_action_la_code1;
2313       p_per_group1.org_appointment_auth_code2  :=  p_pa_request_rec.first_action_la_code2;
2314       p_per_group1.org_appointment_desc1       :=  p_pa_request_rec.first_action_la_desc1;
2315       p_per_group1.org_appointment_desc2       :=  p_pa_request_rec.first_action_la_desc2;
2316       p_per_group1.per_group1_flag             :=  'Y';
2317     End if;
2318 
2319     set_extra_info(p_per_uniformed_services.creditable_military_service ,
2320                    l_pa_request_ei_rec.rei_information4,
2321                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2322     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office,
2323                    l_pa_request_ei_rec.rei_information5,
2324                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2325     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2326                    l_pa_request_ei_rec.rei_information6,
2327                    p_within_grade_increase.p_wgi_flag, 'N');
2328     set_extra_info(p_within_grade_increase.p_last_equi_incr,
2329                    l_pa_request_ei_rec.rei_information18,
2330                    p_within_grade_increase.p_wgi_flag, 'N');
2331     set_extra_info(p_per_separate_retire.frozen_service,
2332                    l_pa_request_ei_rec.rei_information7,
2333                    p_per_separate_Retire.per_sep_Retire_flag, 'Y' );
2334     set_extra_info(p_per_group1.handicap_code,
2335                    l_pa_request_ei_rec.rei_information8,
2336                    p_per_group1.per_group1_flag, 'Y');
2337     set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
2338                    l_pa_request_ei_rec.rei_information9,
2339                    p_per_group1.per_group1_flag, 'Y');
2340     set_extra_info(p_asg_non_sf52.parttime_indicator,
2341                    l_pa_request_ei_rec.rei_information12,
2342                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2343     set_extra_info(p_pos_grp1.position_working_title,
2344                    l_pa_request_ei_rec.rei_information13,
2345                    p_pos_grp1.pos_grp1_flag, 'Y');
2346     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2347                    l_pa_request_ei_rec.rei_information14,
2348                    p_per_separate_Retire.per_sep_Retire_flag, 'Y' );
2349     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
2350                    l_pa_request_ei_rec.rei_information15,
2351                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2352     set_extra_info(p_per_group1.race_national_origin,
2353                    l_pa_request_ei_rec.rei_information16,
2354                    p_per_group1.per_group1_flag, 'Y');
2355     set_extra_info(p_per_group1.type_of_employment,
2356                    l_pa_request_ei_rec.rei_information17,
2357                    p_per_group1.per_group1_flag, 'Y');
2358     set_extra_info(p_per_separate_retire.fers_coverage,
2359                    l_pa_request_ei_rec.rei_information19,
2360                    p_per_separate_retire.per_sep_retire_flag, 'Y');
2361 
2362    --bug 4443968
2363     hr_utility.set_location('Creditable service' ||l_pa_request_ei_rec.rei_information23,0000);
2364     hr_utility.set_location('Populate flag' ||p_per_scd_info.per_scd_info_flag,3333);
2365 
2366   set_extra_info (p_per_scd_info.scd_creditable_svc_annl_leave,
2367                    l_pa_request_ei_rec.rei_information23,
2368                    p_per_scd_info.per_scd_info_flag, 'Y');
2369   hr_utility.set_location('Per Cred leave' ||p_per_scd_info.scd_creditable_svc_annl_leave,4444);
2370     --
2371     --
2372     hr_utility.set_location('Leaving  ' || l_proc,20);
2373 
2374   End appt_info;
2375   --
2376   --
2377   Procedure appt_transfer is
2378     l_proc  varchar2(70) := 'non_sf52_extra_info - app_3 ';
2379 
2380   Begin
2381     hr_utility.set_location('Entering  ' || l_proc,5);
2382     --
2383     --
2384     If l_session.noa_id_correct is not null then
2385        set_extra_info(p_per_group1.agency_code_transfer_from ,
2386                       l_pa_request_ei_rec.rei_information3, p_per_group1.per_group1_flag);
2387        set_extra_info(p_per_group1.appointment_type,
2388                       l_pa_request_ei_rec.rei_information4, p_per_group1.per_group1_flag);
2389        If p_pa_request_rec.first_noa_code <> '132' then
2390          set_extra_info(p_per_group1.org_appointment_auth_code1,
2391                       p_pa_request_rec.first_action_la_code1,p_per_group1.per_group1_flag);
2392          set_extra_info(p_per_group1.org_appointment_auth_code2,
2393                       p_pa_request_rec.first_action_la_code2,p_per_group1.per_group1_flag);
2394          --Bug# 4941984(AFHR2)
2395          set_extra_info(p_per_group1.org_appointment_desc1,
2396                       p_pa_request_rec.first_action_la_desc1,p_per_group1.per_group1_flag);
2397          set_extra_info(p_per_group1.org_appointment_desc2,
2398                       p_pa_request_rec.first_action_la_desc2,p_per_group1.per_group1_flag);
2399          --Bug# 4941984(AFHR2)
2400       End if;
2401     Else
2402        p_per_group1.agency_code_transfer_from     :=  l_pa_request_ei_rec.rei_information3;
2403        p_per_group1.appointment_type              :=  l_pa_request_ei_rec.rei_information4;
2404        If p_pa_request_rec.first_noa_code <> '132' then
2405           p_per_group1.org_appointment_auth_code1    :=  p_pa_request_rec.first_action_la_code1;
2406           p_per_group1.org_appointment_auth_code2    :=  p_pa_request_rec.first_action_la_code2;
2407           --Bug# 4941984(AFHR2)
2408           p_per_group1.org_appointment_desc1         :=  p_pa_request_rec.first_action_la_desc1;
2409           p_per_group1.org_appointment_desc2         :=  p_pa_request_rec.first_action_la_desc2;
2410           --Bug# 4941984(AFHR2)
2411        End if;
2412        p_per_group1.per_group1_flag               :=  'Y';
2413     End if;
2414     hr_utility.set_location('cOre CMS ' || p_per_uniformed_services.creditable_military_service,1);
2415     hr_utility.set_location('REI 7 '  || l_pa_request_ei_rec.rei_information7,2);
2416     hr_utility.set_location('REI CMS '  || l_pa_request_ei_rec.rei_information6,2);
2417     set_extra_info(p_per_uniformed_services.creditable_military_service,
2418                    l_pa_request_ei_rec.rei_information6,
2419                    p_per_uniformed_services.per_uniformed_services_flag);
2420    hr_utility.set_location('agency code trans from ' || p_per_group1.agency_code_transfer_from,1);
2421    hr_utility.set_location('CMS '  || p_per_uniformed_services.creditable_military_service,2);
2422     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office,
2423                    l_pa_request_ei_rec.rei_information7, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2424     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2425                    l_pa_request_ei_rec.rei_information8, p_within_grade_increase.p_wgi_flag, 'N');
2426     set_extra_info(p_within_grade_increase.p_last_equi_incr,
2427                    l_pa_request_ei_rec.rei_information20, p_within_grade_increase.p_wgi_flag, 'N');
2428     set_extra_info(p_per_separate_retire.frozen_service,
2429                    l_pa_request_ei_rec.rei_information9, p_per_separate_retire.per_sep_retire_flag, 'Y');
2430     set_extra_info(p_per_group1.handicap_code,
2431                    l_pa_request_ei_rec.rei_information10, p_per_group1.per_group1_flag, 'Y');
2432     set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
2433                    l_pa_request_ei_rec.rei_information11,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2434     set_extra_info(p_asg_non_sf52.parttime_indicator,
2435                    l_pa_request_ei_rec.rei_information14,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2436     set_extra_info(p_pos_grp1.position_working_title,
2437                    l_pa_request_ei_rec.rei_information15,p_pos_grp1.pos_grp1_flag, 'Y');
2438     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2439                    l_pa_request_ei_rec.rei_information16,p_per_separate_retire.per_sep_retire_flag, 'Y');
2440     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
2441                    l_pa_request_ei_rec.rei_information17,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2442     set_extra_info(p_per_group1.race_national_origin,
2443                    l_pa_request_ei_rec.rei_information18,p_per_group1.per_group1_flag, 'Y');
2444     set_extra_info(p_per_group1.type_of_employment,
2445                    l_pa_request_ei_rec.rei_information19,p_per_group1.per_group1_flag, 'Y');
2446     set_extra_info(p_per_separate_retire.fers_coverage,
2447                    l_pa_request_ei_rec.rei_information21,
2448                    p_per_separate_retire.per_sep_retire_flag, 'Y');
2449     --bug 4443968
2450     set_extra_info(p_per_scd_info.scd_creditable_svc_annl_leave,
2451                    l_pa_request_ei_rec.rei_information25, p_per_scd_info.per_scd_info_flag, 'Y');
2452 
2453 
2454 
2455     hr_utility.set_location('Leaving  ' ||l_proc,20);
2456 
2457   End appt_transfer;
2458   --
2459 
2460   PROCEDURE appt_benefits IS
2461     l_proc  varchar2(70);
2462   BEGIN
2463     l_proc := 'non sf52 extra - appt_benefits';
2464 	set_extra_info(p_per_benefit_info.FEHB_Date_Eligibility_Expires,
2465                    l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag, 'Y');
2466 	set_extra_info(p_per_benefit_info.FEHB_Date_temp_eligibility,
2467                    l_pa_request_ei_rec.rei_information4,p_per_benefit_info.per_benefit_info_flag, 'Y');
2468 	set_extra_info(p_per_benefit_info.FEHB_Date_dependent_cert_expir,
2469                    l_pa_request_ei_rec.rei_information7,p_per_benefit_info.per_benefit_info_flag, 'Y');
2470 	set_extra_info(p_per_benefit_info.FEGLI_Date_Eligibility_Expires,
2471                   l_pa_request_ei_rec.rei_information10,p_per_benefit_info.per_benefit_info_flag, 'Y');
2472 	set_extra_info(p_per_scd_info.scd_tsp,
2473                    l_pa_request_ei_rec.rei_information12,p_per_scd_info.per_scd_info_flag, 'Y');
2474 	set_extra_info(p_per_benefit_info.TSP_Agncy_Contrib_Elig_date,
2475                    l_pa_request_ei_rec.rei_information17,p_per_benefit_info.per_benefit_info_flag, 'Y');
2476 	set_extra_info(p_per_benefit_info.TSP_Emp_Contrib_Elig_date,
2477                    l_pa_request_ei_rec.rei_information18,p_per_benefit_info.per_benefit_info_flag, 'Y');
2478 
2479 
2480 	-- Populating health benefits record group and flag
2481     p_health_benefits.enrollment       := l_pa_request_ei_rec.rei_information6;
2482     p_health_benefits.health_plan      := l_pa_request_ei_rec.rei_information5;
2483     p_health_benefits.temps_total_cost := l_pa_request_ei_rec.rei_information8;
2484     p_health_benefits.pre_tax_waiver   := l_pa_request_ei_rec.rei_information9;
2485 
2486     if p_health_benefits.enrollment       is not null or
2487        p_health_benefits.health_plan      is not null or
2488        p_health_benefits.temps_total_cost is not null or
2489        p_health_benefits.pre_tax_waiver is not null then
2490        p_health_benefits.health_benefits_flag := 'Y';
2491     end if;
2492 
2493 	-- Populating TSP record group
2494 	p_thrift_saving_plan.amount           := l_pa_request_ei_rec.rei_information13;
2495     p_thrift_saving_plan.rate             := l_pa_request_ei_rec.rei_information14;
2496     p_thrift_saving_plan.status           := l_pa_request_ei_rec.rei_information15;
2497     p_thrift_saving_plan.status_date      := l_pa_request_ei_rec.rei_information16;
2498     p_thrift_saving_plan.agncy_contrib_elig_date := l_pa_request_ei_rec.rei_information17;
2499     p_thrift_saving_plan.emp_contrib_elig_date := l_pa_request_ei_rec.rei_information18;
2500 
2501     if p_thrift_saving_plan.amount           is not null or
2502        p_thrift_saving_plan.rate             is not null or
2503        p_thrift_saving_plan.status           is not null or
2504        p_thrift_saving_plan.status_date      is not null then
2505        p_thrift_saving_plan.tsp_flag  := 'Y';
2506     end if;
2507 
2508   END appt_benefits;
2509   --
2510   PROCEDURE chg_data_elm is
2511     l_proc  varchar2(70) := 'non_sf52_extra - chg_data_elm';
2512   --
2513   Begin
2514     hr_utility.set_location('Entering  ' || l_proc,5);
2515 
2516 	-- Bug#4126188 begin
2517 	IF NVL(l_pa_request_ei_rec.rei_information3,hr_api.g_varchar2) <>
2518 		NVL(p_pos_grp1.personnel_office_id,hr_api.g_varchar2) THEN
2519 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2520                    l_pa_request_ei_rec.rei_information5, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2521 	END IF;
2522 	-- Bug#4126188 End
2523     set_extra_info(p_pos_grp1.personnel_office_id,
2524                    l_pa_request_ei_rec.rei_information3, p_pos_grp1.pos_grp1_flag, 'Y');
2525     hr_utility.set_location('Leaving '||l_proc,20);
2526 
2527   End chg_data_elm;
2528   --
2529   --
2530   Procedure chg_sched_hours is
2531     l_proc  varchar2(70) := 'non_sf52_extra - chg_hours';
2532 
2533   Begin
2534     hr_utility.set_location('Entering ' ||l_proc,5);
2535     set_extra_info(p_per_probations.date_prob_trial_period_begin ,
2536                    l_pa_request_ei_rec.rei_information3,p_per_probations.per_probation_flag);
2537     set_extra_info(p_per_probations.date_prob_trial_period_ends  ,
2538                    l_pa_request_ei_rec.rei_information4,p_per_probations.per_probation_flag);
2539     set_extra_info(p_within_grade_increase.p_date_wgi_due,
2540                    l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
2541     set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
2542                    l_pa_request_ei_rec.rei_information6,p_within_grade_increase.p_wgi_flag);
2543     set_extra_info(p_asg_non_sf52.parttime_indicator,l_pa_request_ei_rec.rei_information7,
2544                    p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2545   --Added by deenath to fix bug 4542401.
2546     IF (p_pa_request_rec.first_noa_code  IN ('781','782') OR
2547         p_pa_request_rec.second_noa_code IN ('781','782')) THEN
2548        ghr_history_fetch.fetch_element_entry_value
2549                         (p_element_name          =>  'Within Grade Increase',
2550                          p_input_value_name      =>  'Last Equivalent Increase',
2551                          p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
2552                          p_date_effective        =>  p_pa_request_rec.effective_date,
2553                          p_screen_entry_value    =>  p_within_grade_increase.p_last_equi_incr);
2554     END IF;
2555   --End added by deenath to fix bug 4542401
2556     hr_utility.set_location('Leaving ' || l_proc,20);
2557 
2558   End chg_sched_hours;
2559   --
2560   --
2561   Procedure chg_ret_plan is
2562    l_proc        varchar2(70) := 'non_sf52_extra_info - chg_ret_plan';
2563 
2564   Begin
2565     hr_utility.set_location('Entering ' ||l_proc,5);
2566     set_extra_info(p_per_uniformed_services.creditable_military_service,
2567                    l_pa_request_ei_rec.rei_information3,
2568                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2569     -- Start Bug # 1518650
2570        p_per_separate_retire.fers_coverage       := l_pa_request_ei_rec.rei_information4;
2571        p_per_separate_retire.per_sep_retire_flag := 'Y';
2572     -- End Bug # 1518650
2573     set_extra_info(p_per_separate_retire.frozen_service,
2574                    l_pa_request_ei_rec.rei_information5,
2575                    p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2576     set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2577                    l_pa_request_ei_rec.rei_information6,
2578                    p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2579     hr_utility.set_location('Leaving  ' || l_proc,20);
2580 
2581   END chg_ret_plan;
2582   --
2583   --
2584 
2585   PROCEDURE chg_scd is
2586      l_proc   varchar2(70)  := 'non_sf52_extra - chg_scd';
2587    Begin
2588      hr_utility.set_location('Entering ' ||l_proc,5);
2589      set_extra_info(p_per_scd_info.scd_rif,l_pa_request_ei_rec.rei_information3,
2590                     p_per_scd_info.per_scd_info_flag, 'Y');
2591      set_extra_info(p_per_scd_info.scd_civilian,l_pa_request_ei_rec.rei_information4,
2592                     p_per_scd_info.per_scd_info_flag, 'Y');
2593      -- Bug 3675673
2594      set_extra_info(p_per_scd_info.scd_retirement,l_pa_request_ei_rec.rei_information8,
2595                     p_per_scd_info.per_scd_info_flag, 'Y');
2596      -- Bug 3675673
2597      set_extra_info(p_per_uniformed_services.creditable_military_service ,
2598                     l_pa_request_ei_rec.rei_information5,
2599                     p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2600      set_extra_info(p_per_separate_retire.frozen_service, l_pa_request_ei_rec.rei_information6,
2601                     p_per_separate_retire.per_sep_retire_flag, 'Y');
2602      set_extra_info(p_per_separate_retire.prev_retirement_coverage,
2603                     l_pa_request_ei_rec.rei_information7,
2604                     p_per_separate_retire.per_sep_retire_flag, 'Y');
2605      --Pradeep start of the Bug 2146899
2606 	  set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information9,
2607                     p_per_scd_info.per_scd_info_flag, 'Y');
2608      --End of Bug 2146899
2609 
2610 	  -- eHRI New Attribution Changes
2611  	  set_extra_info(p_per_scd_info.scd_ses,l_pa_request_ei_rec.rei_information10,
2612                     p_per_scd_info.per_scd_info_flag, 'Y');
2613  	  set_extra_info(p_per_scd_info.scd_spl_retirement,l_pa_request_ei_rec.rei_information11,
2614                     p_per_scd_info.per_scd_info_flag, 'Y');
2615 	-- End eHRI New Attribution Changes
2616   --bug 4443968
2617        set_extra_info (p_per_scd_info.scd_creditable_svc_annl_leave,l_pa_request_ei_rec.rei_information12,
2618                        p_per_scd_info.per_scd_info_flag, 'Y');
2619 
2620 
2621      hr_utility.set_location('Leaving  ' ||l_proc,10);
2622    End chg_scd;
2623   --
2624   --
2625   Procedure conv_appt is
2626     l_proc  varchar2(70) := 'non_sf52_extra - conv_1';
2627   Begin
2628     hr_utility.set_location('Entering ' ||l_proc,5);
2629     If l_session.noa_id_correct is not null then
2630       set_extra_info(p_per_group1.appointment_type,
2631                      l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag);
2632       set_extra_info(p_per_group1.org_appointment_auth_code1,
2633                    p_pa_request_rec.first_action_la_code1,p_per_group1.per_group1_flag);
2634       set_extra_info(p_per_group1.org_appointment_auth_code2,
2635                    p_pa_request_rec.first_action_la_code2,p_per_group1.per_group1_flag);
2636       --Bug# 4941984(AFHR2)
2637       set_extra_info(p_per_group1.org_appointment_desc1,
2638               p_pa_request_rec.first_action_la_desc1,p_per_group1.per_group1_flag);
2639       set_extra_info(p_per_group1.org_appointment_desc2,
2640               p_pa_request_rec.first_action_la_desc2,p_per_group1.per_group1_flag);
2641       --Bug# 4941984(AFHR2)
2642 
2643     Else
2644       p_per_group1.appointment_type           :=   l_pa_request_ei_rec.rei_information3;
2645       p_per_group1.org_appointment_auth_code1 := p_pa_request_rec.first_action_la_code1;
2646       p_per_group1.org_appointment_auth_code2 := p_pa_request_rec.first_action_la_code2;
2647       --Bug# 4941984(AFHR2)
2648       p_per_group1.org_appointment_desc1      := p_pa_request_rec.first_action_la_desc1;
2649       p_per_group1.org_appointment_desc2      := p_pa_request_rec.first_action_la_desc2;
2650       --Bug# 4941984(AFHR2)
2651       p_per_group1.per_group1_flag            :=  'Y';
2652 
2653     End if;
2654 
2655     set_extra_info(p_per_uniformed_services.creditable_military_service,
2656                    l_pa_request_ei_rec.rei_information4,
2657                    p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2658 
2659 	-- Begin Bug#4126188
2660 			set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2661 			l_pa_request_ei_rec.rei_information5,p_asg_non_sf52.asg_non_sf52_flag,'Y');
2662     -- Bug#4126188 End
2663    -- set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office  ,
2664      --              l_pa_request_ei_rec.rei_information5,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2665     set_extra_info(p_per_separate_retire.frozen_service      ,
2666                    l_pa_request_ei_rec.rei_information6,p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2667     set_extra_info(p_per_group1.handicap_code                ,
2668                    l_pa_request_ei_rec.rei_information7,p_per_group1.per_group1_flag, 'Y');
2669     set_extra_info(p_asg_non_sf52.parttime_indicator         ,
2670                    l_pa_request_ei_rec.rei_information8,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2671     set_extra_info(p_pos_grp1.position_working_title         ,
2672                    l_pa_request_ei_rec.rei_information9,p_pos_grp1.pos_grp1_flag, 'Y');
2673     set_extra_info(p_per_separate_retire.prev_retirement_coverage ,
2674                    l_pa_request_ei_rec.rei_information10,p_per_separate_Retire.per_sep_Retire_flag, 'Y');
2675     set_extra_info(p_asg_non_sf52.qualification_standard_waiver,
2676                    l_pa_request_ei_rec.rei_information11,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2677     set_extra_info(p_per_group1.race_national_origin,
2678                    l_pa_request_ei_rec.rei_information12,p_per_group1.per_group1_flag, 'Y');
2679     set_extra_info(p_per_group1.type_of_employment,
2680                    l_pa_request_ei_rec.rei_information13,p_per_group1.per_group1_flag, 'Y');
2681  -- Start Bug 1318341
2682     set_extra_info(p_within_grade_increase.p_date_wgi_due    ,
2683                    l_pa_request_ei_rec.rei_information19,p_within_grade_increase.p_wgi_flag);
2684  -- End Bug 1318341
2685     set_extra_info(p_within_grade_increase.p_last_equi_incr    ,
2686                    l_pa_request_ei_rec.rei_information20,p_within_grade_increase.p_wgi_flag);
2687  -- Start Bug 2165782
2688     set_extra_info(p_per_separate_retire.fers_coverage,
2689                    l_pa_request_ei_rec.rei_information21,
2690                    p_per_separate_retire.per_sep_retire_flag, 'Y');
2691  -- Start Bug 2165782
2692     --
2693     -- the following fields has to be set to the user entered values (null if not entered)
2694     -- except for corrections for the requirement 'conversion rpa ddf update' - 13-oct-98
2695     -- Also changed it to not autopopulate
2696     --
2697     If l_session.noa_id_correct is not null then
2698        set_extra_info(p_per_conversions.date_conv_career_begins ,
2699                       l_pa_request_ei_rec.rei_information14,p_per_conversions.per_conversions_flag,'N');
2700        set_extra_info(p_per_conversions.date_conv_career_due    ,
2701                       l_pa_request_ei_rec.rei_information15,p_per_conversions.per_conversions_flag,'N');
2702        set_extra_info(p_per_conversions.date_recmd_conv_begins  ,
2703                       l_pa_request_ei_rec.rei_information16,p_per_conversions.per_conversions_flag,'N');
2704        set_extra_info(p_per_conversions.date_recmd_conv_due     ,
2705                       l_pa_request_ei_rec.rei_information17,p_per_conversions.per_conversions_flag,'N');
2706        set_extra_info(p_per_conversions.date_vra_conv_due       ,
2707                       l_pa_request_ei_rec.rei_information18,p_per_conversions.per_conversions_flag,'N');
2708     else
2709        p_per_conversions.date_conv_career_begins := l_pa_request_ei_rec.rei_information14;
2710        p_per_conversions.date_conv_career_due    := l_pa_request_ei_rec.rei_information15;
2711        p_per_conversions.date_recmd_conv_begins  := l_pa_request_ei_rec.rei_information16;
2712        p_per_conversions.date_recmd_conv_due     := l_pa_request_ei_rec.rei_information17;
2713        p_per_conversions.date_vra_conv_due       := l_pa_request_ei_rec.rei_information18;
2714        p_per_conversions.per_conversions_flag := 'Y';
2715     end if;
2716 
2717   --
2718   /*
2719 
2720   -- The foll.  has been  removed as it is to be calculated in case of a CONV_APP
2721   --  set_extra_info(p_within_grade_increase.p_date_wgi_due    ,
2722   --                 l_pa_request_ei_rec.rei_information6,p_within_grade_increase.p_wgi_flag);
2723 
2724   */
2725     hr_utility.set_location('Leaving ' ||l_proc,10);
2726 
2727   END conv_appt;
2728   --
2729   --
2730   /* Denial WGI */
2731   --
2732   Procedure denial_wgi is
2733     l_proc  varchar2(70) := 'non_sf52_extra - denial_wgi';
2734   Begin
2735   --
2736   --
2737   -- Updating the record groups with NON SF52
2738   --
2739     hr_utility.set_location('Entering ' ||l_proc,5);
2740     If l_session.noa_id_correct is not null then
2741       set_extra_info(p_within_grade_increase.p_date_wgi_due,
2742                      l_pa_request_ei_rec.rei_information3,p_within_grade_increase.p_wgi_flag);
2743       set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
2744                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
2745     Else
2746       p_within_grade_increase.p_date_wgi_due                := l_pa_request_ei_rec.rei_information3;
2747       p_within_grade_increase.p_date_wgi_postpone_effective := l_pa_request_ei_rec.rei_information4;
2748       p_within_grade_increase.p_wgi_flag                    :=  'Y';
2749     End if;
2750 
2751     hr_utility.set_location('Leaving ' ||l_proc,10);
2752 
2753   End denial_wgi;
2754   --
2755   --
2756   Procedure ext_asgn_nte  is
2757     l_proc   varchar2(70) := 'ext_asgn_nte';
2758   --
2759   Begin
2760 
2761   --
2762   -- Updating the record groups with NON SF52
2763   --
2764      hr_utility.set_location('Entering ' ||l_proc,5);
2765      set_extra_info(p_asg_nte_dates.assignment_nte,
2766                     l_pa_request_ei_rec.rei_information3,p_asg_nte_dates.asg_nte_dates_flag);
2767      set_extra_info(p_within_grade_increase.p_date_wgi_due ,
2768                     l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
2769      set_extra_info(p_asg_nte_dates.lwp_nte,
2770                     l_pa_request_ei_rec.rei_information5,p_asg_nte_dates.asg_nte_dates_flag);
2771      set_extra_info(p_asg_nte_dates.sabatical_nte,
2772                     l_pa_request_ei_rec.rei_information6,p_asg_nte_dates.asg_nte_dates_flag);
2773      set_extra_info(p_asg_nte_dates.suspension_nte ,
2774                     l_pa_request_ei_rec.rei_information7,p_asg_nte_dates.asg_nte_dates_flag);
2775   --
2776      hr_utility.set_location('Leaving ' ||l_proc,10);
2777 
2778   End ext_asgn_nte  ;
2779   --
2780   --
2781   Procedure posn_chg is
2782     l_proc      varchar2(72)  :=  'non_sf52_extra - posn_chg';
2783 
2784   Begin
2785     hr_utility.set_location('Entering ' ||l_proc,5);
2786     set_extra_info(p_per_retained_grade.date_from ,
2787                    l_pa_request_ei_rec.rei_information1,p_per_retained_grade.per_retained_grade_flag);
2788     set_extra_info(p_per_retained_grade.date_to ,
2789                    l_pa_request_ei_rec.rei_information2,p_per_retained_grade.per_retained_grade_flag);
2790     set_extra_info(p_per_retained_grade.retain_grade,
2791                    l_pa_request_ei_rec.rei_information3,p_per_retained_grade.per_retained_grade_flag);
2792     set_extra_info(p_per_retained_grade.retain_step_or_rate	,
2793                    l_pa_request_ei_rec.rei_information4,p_per_retained_grade.per_retained_grade_flag);
2794     set_extra_info(p_per_retained_grade.retain_pay_plan,
2795                    l_pa_request_ei_rec.rei_information5,p_per_retained_grade.per_retained_grade_flag);
2796     set_extra_info(p_per_retained_grade.retain_pay_table_id	,
2797                    l_pa_request_ei_rec.rei_information6,p_per_retained_grade.per_retained_grade_flag);
2798     set_extra_info(p_per_retained_grade.retain_locality_percent,
2799                    l_pa_request_ei_rec.rei_information7,p_per_retained_grade.per_retained_grade_flag);
2800     set_extra_info(p_per_retained_grade.retain_pay_basis	,
2801                    l_pa_request_ei_rec.rei_information8,p_per_retained_grade.per_retained_grade_flag);
2802 	-- Begin bug# 4126188
2803 	set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2804                    l_pa_request_ei_rec.rei_information15, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2805     -- End bug# 4126188
2806     hr_utility.set_location('Leaving ' ||l_proc,10);
2807 
2808   End posn_chg;
2809   --
2810   -- Begin bug# 4126188
2811   Procedure rg_posn_chg is
2812     l_proc      varchar2(72)  :=  'non_sf52_extra - rg_posn_chg';
2813 	Begin
2814 		hr_utility.set_location('Entering ' ||l_proc,5);
2815 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2816 		l_pa_request_ei_rec.rei_information15, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2817 		hr_utility.set_location('Leaving ' ||l_proc,10);
2818 	End rg_posn_chg;
2819 	-- End bug# 4126188
2820 
2821   Procedure salary_change is
2822     l_proc      varchar2(72)  :=  'non_sf52_extra - salary change';
2823 
2824   Begin
2825     hr_utility.set_location('Entering ' ||l_proc,5);
2826     If l_session.noa_id_correct is not null then
2827       set_extra_info(p_within_grade_increase.p_date_wgi_postpone_effective,
2828                      l_pa_request_ei_rec.rei_information3,p_within_grade_increase.p_wgi_flag);
2829 
2830 --Added for bug 3263140
2831 
2832       set_extra_info(p_within_grade_increase.p_last_equi_incr,
2833                      l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
2834 -- Bug # 1165309
2835 -- Date Wgi Due should be calculated for GHR_US_PAR_SALARY_CHG
2836       set_extra_info(p_within_grade_increase.p_date_wgi_due,
2837                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
2838     Else
2839       p_within_grade_increase.p_date_wgi_postpone_effective   :=  l_pa_request_ei_rec.rei_information3;
2840       set_extra_info(p_within_grade_increase.p_date_wgi_due,
2841                      l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag);
2842       set_extra_info(p_within_grade_increase.p_last_equi_incr,
2843                      l_pa_request_ei_rec.rei_information5,p_within_grade_increase.p_wgi_flag);
2844       p_within_grade_increase.p_wgi_flag                      := 'Y';
2845     End if;
2846 	-- Begin Bug#4126188
2847 	IF p_pa_request_rec.first_noa_code in ('702','703','713') OR
2848 		(p_pa_request_rec.first_noa_code = '002' AND p_pa_request_rec.second_noa_code IN ('702','703','713'))THEN
2849 		set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2850 		l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag,'Y');
2851     END IF;
2852     -- Bug#4126188 End
2853 
2854   End salary_change;
2855   --
2856 
2857   PROCEDURE realign is
2858     l_proc  varchar2(70) := 'non_sf52_extra - realign';
2859 
2860   Begin
2861     hr_utility.set_location('Entering ' ||l_proc,5);
2862     set_extra_info(p_asg_non_sf52.Date_Arr_Personnel_office ,
2863                    l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag);
2864 
2865     set_extra_info(p_pos_grp1.payroll_office_id	 	   ,
2866                    l_pa_request_ei_rec.rei_information4,p_pos_grp1.pos_grp1_flag);
2867     set_extra_info(p_pos_grp1.personnel_office_id 	   ,
2868                    l_pa_request_ei_rec.rei_information5,p_pos_grp1.pos_grp1_flag);
2869     -- Bug#3593584 Added code for Organization_structure_id(This is also known as
2870     --                                                    OPM Organizational Component)
2871     set_extra_info(p_pos_grp1.organization_structure_id	   ,
2872                    l_pa_request_ei_rec.rei_information11,p_pos_grp1.pos_grp1_flag);
2873     set_extra_info(p_pos_grp1.office_symbol              ,
2874                    l_pa_request_ei_rec.rei_information6,p_pos_grp1.pos_grp1_flag);
2875     set_extra_info(p_pos_grp2.organization_function_code ,
2876                    l_pa_request_ei_rec.rei_information7,p_pos_grp2.pos_grp2_flag);
2877     set_extra_info(p_pos_grp1.positions_organization 	   ,
2878                    l_pa_request_ei_rec.rei_information8,p_pos_grp1.pos_grp1_flag);
2879  --- Bug#2406905
2880     set_extra_info(p_pos_grp1.organization_structure_id  ,
2881                    l_pa_request_ei_rec.rei_information11,p_pos_grp1.pos_grp1_flag);
2882 
2883     if l_pa_request_ei_rec.rei_information9 is not null then
2884        p_pa_request_rec.to_organization_id := l_pa_request_ei_rec.rei_information9;
2885   -- Rohini added the else part
2886     else
2887       p_pa_request_rec.to_organization_id := Null;
2888     end if;
2889     -- Bug#3593584 Added the following If condition.
2890       if l_pa_request_ei_rec.rei_information10 is not null then
2891          p_pa_request_rec.agency_code := l_pa_request_ei_rec.rei_information10;
2892       end If;
2893 
2894     hr_utility.set_location('Leaving ' ||l_proc,10);
2895 
2896   End   realign ;
2897   --
2898   --
2899   Procedure reassign is
2900     l_proc varchar2(70) := 'non_sf52_extra_info - reassign';
2901   Begin
2902     hr_utility.set_location('Entering ' ||l_proc,5);
2903 /* -- Commented - Venkat - Bug # 957209 -- 08/06/1999
2904     set_extra_info(p_asg_non_sf52.key_emer_essential_empl	,
2905                    l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag);
2906 */
2907     set_extra_info(p_asg_non_sf52.parttime_indicator		,
2908                    l_pa_request_ei_rec.rei_information4,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2909     set_extra_info(p_pos_grp1.position_working_title 		,
2910                    l_pa_request_ei_rec.rei_information5,p_pos_grp1.pos_grp1_flag, 'Y');
2911     set_extra_info(p_asg_non_sf52.qualification_standard_waiver	,
2912                    l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2913    -- Begin Bug#4126188
2914  	  set_extra_info(p_asg_non_sf52.date_arr_personnel_office,
2915 	   l_pa_request_ei_rec.rei_information7, p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2916      -- End Bug#4126188
2917     hr_utility.set_location('Leaving ' ||l_proc,10);
2918 
2919   End   reassign;
2920   --
2921 
2922   Procedure return_to_duty is
2923      l_proc      varchar2(70) := 'non_sf52_extra - return_to_duty';
2924 
2925   Begin
2926 
2927      hr_utility.set_location('Entering ' ||l_proc,5);
2928      set_extra_info(p_per_uniformed_services.creditable_military_service ,
2929                     l_pa_request_ei_rec.rei_information3,
2930                     p_per_uniformed_services.per_uniformed_services_flag, 'Y');
2931      set_extra_info(p_within_grade_increase.p_date_wgi_due ,
2932                     l_pa_request_ei_rec.rei_information4,p_within_grade_increase.p_wgi_flag, 'N');
2933      set_extra_info(p_per_separate_retire.frozen_service,
2934                     l_pa_request_ei_rec.rei_information5,p_per_separate_retire.per_sep_Retire_flag, 'Y');
2935      set_extra_info(p_asg_non_sf52.non_disc_agmt_status,
2936                     l_pa_request_ei_rec.rei_information6,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2937      set_extra_info(p_asg_non_sf52.parttime_indicator,
2938                     l_pa_request_ei_rec.rei_information7,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
2939      set_extra_info(p_per_group1.type_of_employment,
2940                     l_pa_request_ei_rec.rei_information8,p_per_group1.per_group1_flag, 'Y');	-- Bug 3966783
2941      hr_utility.set_location('Leaving ' ||l_proc,10);
2942 
2943   End return_to_duty;
2944   --
2945   --
2946   Procedure separate352 is
2947      l_proc varchar2(70) := 'non_sf52_extra - separate3';
2948 
2949   Begin
2950 
2951     hr_utility.set_location('Entering ' ||l_proc,5);
2952    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
2953                             p_per_separate_retire.agency_code_transfer_to ,10);
2954 	set_extra_info(p_per_separate_retire.agency_code_transfer_to,
2955                      l_pa_request_ei_rec.rei_information3,p_per_separate_Retire.per_sep_Retire_flag);
2956    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
2957                             p_per_separate_retire.agency_code_transfer_to ,10);
2958       hr_utility.set_location('Leaving ' ||l_proc,10);
2959 
2960   End separate352 ;
2961   --
2962   --
2963   Procedure recruitment_bonus is
2964      l_proc  varchar2(70) := 'non_sf52_extra - recruitment_bonus';
2965 
2966   Begin
2967      hr_utility.set_location('Entering ' ||l_proc,5);
2968      If l_session.noa_id_correct is not null then
2969        set_extra_info(p_recruitment_bonus.p_date_recruit_exp,
2970                       l_pa_request_ei_rec.rei_information3,p_recruitment_bonus.p_recruitment_bonus_flag);
2971      Else
2972        p_recruitment_bonus.p_date_recruit_exp        := l_pa_request_ei_rec.rei_information3 ;
2973        p_recruitment_bonus.p_recruitment_bonus_flag  := 'Y';
2974        hr_utility.set_location('Leaving ' ||l_proc,10);
2975      End if;
2976 
2977   End recruitment_bonus;
2978   --
2979   --
2980   Procedure relocation_bonus is
2981      l_proc  varchar2(70) := 'non_sf52_extra - relocation_bonus';
2982 
2983   Begin
2984      hr_utility.set_location('Entering ' ||l_proc,5);
2985      If l_session.noa_id_correct is not null then
2986        set_extra_info(p_relocation_bonus.p_date_reloc_exp,
2987                       l_pa_request_ei_rec.rei_information3,p_relocation_bonus.p_relocation_bonus_flag );
2988      Else
2989        p_relocation_bonus.p_date_reloc_exp         :=  l_pa_request_ei_rec.rei_information3;
2990        p_relocation_bonus.p_relocation_bonus_flag  :=  'Y';
2991      End if;
2992      hr_utility.set_location('Leaving ' ||l_proc,10);
2993 
2994   End  relocation_bonus;
2995   --
2996 
2997   Procedure government_awards is
2998      l_proc varchar2(72) := 'non_sf52_extra - awards_bonus';
2999 
3000   Begin
3001      --
3002      -- commented award percentage, as a new column has been added in the
3003      -- ghr_pa_requests table - 10/08/98
3004      --
3005      p_gov_awards.award_agency             :=  l_pa_request_ei_rec.rei_information3;
3006      p_gov_awards.award_type               :=  l_pa_request_ei_rec.rei_information4;
3007      p_gov_awards.group_award              :=  l_pa_request_ei_rec.rei_information6;
3008      p_gov_awards.tangible_benefit_dollars :=  l_pa_request_ei_rec.rei_information7;
3009      p_gov_awards.date_award_earned        :=  l_pa_request_ei_rec.rei_information9;
3010 -- Bug # 1060184 -- Venkat 03/01/00
3011      p_gov_awards.award_appropriation_code :=  l_pa_request_ei_rec.rei_information10;
3012      p_gov_awards.date_exemp_award         :=  l_pa_request_ei_rec.rei_information11;
3013 
3014      hr_utility.set_location('date award -pre ' || p_gov_awards.date_award_earned,2);
3015      If p_gov_awards.award_agency             is not null or
3016         p_gov_awards.award_type               is not null or
3017         p_gov_awards.group_award              is not null or
3018         p_gov_awards.tangible_benefit_dollars is not null or
3019         p_gov_awards.date_award_earned        is not null or
3020         p_pa_request_rec.award_amount         is not null or
3021         p_gov_awards.award_appropriation_code is not null or
3022         p_gov_awards.date_exemp_award         is not null then
3023         p_gov_awards.award_flag := 'Y';
3024 
3025         If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3026            if p_gov_awards.award_agency is null then
3027               ghr_history_fetch.fetch_element_entry_value
3028              (p_element_name          =>  'Federal Awards',
3029               p_input_value_name      =>  'Award Agency',
3030               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3031               p_date_effective        =>  p_pa_request_rec.effective_date,
3032               p_screen_entry_value    =>  p_gov_awards.award_agency
3033               );
3034            end if;
3035            if p_gov_awards.award_type is null then
3036               ghr_history_fetch.fetch_element_entry_value
3037              (p_element_name          =>  'Federal Awards',
3038               p_input_value_name      =>  'Award Type',
3039               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3040               p_date_effective        =>  p_pa_request_rec.effective_date,
3041               p_screen_entry_value    =>  p_gov_awards.award_type
3042               );
3043            end if;
3044            if p_gov_awards.group_award is null then
3045               ghr_history_fetch.fetch_element_entry_value
3046               (p_element_name          =>  'Federal Awards',
3047                p_input_value_name      =>  'Group Award',
3048                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3049                p_date_effective        =>  p_pa_request_rec.effective_date,
3050                p_screen_entry_value    =>  p_gov_awards.group_award
3051                );
3052            end if;
3053            if p_gov_awards.tangible_benefit_dollars is null then
3054               ghr_history_fetch.fetch_element_entry_value
3055               (p_element_name          =>  'Federal Awards',
3056                p_input_value_name      =>  'Tangible Benefit Dollars',
3057                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3058                p_date_effective        =>  p_pa_request_rec.effective_date,
3059                p_screen_entry_value    =>  p_gov_awards.tangible_benefit_dollars
3060                );
3061            end if;
3062            if p_gov_awards.date_award_earned is null then
3063               ghr_history_fetch.fetch_element_entry_value
3064              (p_element_name          =>  'Federal Awards',
3065               p_input_value_name      =>  'Date Award Earned',
3066               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3067               p_date_effective        =>  p_pa_request_rec.effective_date,
3068               p_screen_entry_value    =>  p_gov_awards.date_award_earned
3069               );
3070            end if;
3071            if p_gov_awards.award_appropriation_code is null then
3072               ghr_history_fetch.fetch_element_entry_value
3073              (p_element_name          =>  'Federal Awards',
3074               p_input_value_name      =>  'Appropriation Code',
3075               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3076               p_date_effective        =>  p_pa_request_rec.effective_date,
3077               p_screen_entry_value    =>  p_gov_awards.award_appropriation_code
3078               );
3079            end if;
3080 /*
3081            -- Bug 2835929 Allow date_exemp_award to be updated to null.
3082            if p_gov_awards.date_exemp_award is null then
3083               ghr_history_fetch.fetch_element_entry_value
3084              (p_element_name          =>  'Federal Awards',
3085               p_input_value_name      =>  'Date Ex Emp Award Paid',
3086               p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3087               p_date_effective        =>  p_pa_request_rec.effective_date,
3088               p_screen_entry_value    =>  p_gov_awards.date_exemp_award
3089               );
3090            end if;
3091 */
3092         end if;
3093      End if;
3094   End government_awards;
3095   --
3096   -- Bug#4486823 RRR Changes Added procedures service_obligation,incentive_retention.
3097   Procedure service_obligation is
3098      l_proc  varchar2(70) := 'non_sf52_extra - service_obligation';
3099 
3100   Begin
3101      hr_utility.set_location('Entering ' ||l_proc,5);
3102      If l_session.noa_id_correct is null then
3103        --6510320 Added the if condition of not creating the service obligation entry
3104        --in person EI if all the segments are null
3105        If  l_pa_request_ei_rec.rei_information3 is not null or
3106            l_pa_request_ei_rec.rei_information4 is not null or
3107 	   l_pa_request_ei_rec.rei_information5 is not null then
3108          p_per_service_oblig.service_oblig_type_code  := l_pa_request_ei_rec.rei_information3;
3109          p_per_service_oblig.service_oblig_start_date := l_pa_request_ei_rec.rei_information4;
3110          p_per_service_oblig.service_oblig_end_date   := l_pa_request_ei_rec.rei_information5;
3111          p_per_service_oblig.per_service_oblig_flag   := 'Y';
3112        End If;
3113        hr_utility.set_location('Leaving ' ||l_proc,10);
3114      End if;
3115 
3116   End service_obligation;
3117   --
3118   --
3119   Procedure incentive_retention is
3120      l_proc  varchar2(70) := 'non_sf52_extra - incentive_retention';
3121 
3122   Begin
3123      hr_utility.set_location('Entering ' ||l_proc,5);
3124       If l_session.noa_id_correct is not null then
3125        set_extra_info(p_per_group1.retention_inc_review_date ,
3126                       l_pa_request_ei_rec.rei_information3,
3127                       p_per_group1.per_group1_flag);
3128     Else
3129       p_per_group1.retention_inc_review_date   :=  l_pa_request_ei_rec.rei_information3;
3130     End if;
3131     p_per_group1.per_group1_flag             :=  'Y';
3132   End incentive_retention;
3133   --  -- Bug#4486823 RRR Changes
3134   --
3135   Procedure non_pay_duty_status is
3136     l_proc                varchar2(72) := 'non_pay_duty_status';
3137     l_special_info_type   ghr_api.special_information_type;
3138 
3139   Begin
3140     set_extra_info(p_per_group1.type_of_employment,
3141                    l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag, 'Y');
3142     p_conduct_performance.adverse_action_noac        :=   l_pa_request_ei_rec.rei_information4;
3143     p_conduct_performance.cause_of_disc_action       :=   l_pa_request_ei_rec.rei_information5;
3144     p_conduct_performance.date_of_adverse_action     :=   l_pa_request_ei_rec.rei_information6;
3145     p_conduct_performance.days_suspended             :=   l_pa_request_ei_rec.rei_information7;
3146     p_conduct_performance.date_suspension_over_30    :=   l_pa_request_ei_rec.rei_information8;
3147     p_conduct_performance.date_suspension_under_30   :=   l_pa_request_ei_rec.rei_information9;
3148     p_conduct_performance.pip_action_taken           :=   l_pa_request_ei_rec.rei_information10;
3149     p_conduct_performance.pip_begin_date             :=   l_pa_request_ei_rec.rei_information11;
3150     p_conduct_performance.pip_end_date               :=   l_pa_request_ei_rec.rei_information12;
3151     p_conduct_performance.pip_extensions             :=   l_pa_request_ei_rec.rei_information13;
3152     p_conduct_performance.pip_length                 :=   l_pa_request_ei_rec.rei_information14;
3153     p_conduct_performance.date_reprimand_expires     :=   l_pa_request_ei_rec.rei_information15;
3154 
3155     hr_utility.set_location('non_pay_duty_status ', 20);
3156     -- If atleast one of the  above is not null , then set the flag to 'Y'
3157 
3158     If p_conduct_performance.adverse_action_noac      is not null or
3159        p_conduct_performance.cause_of_disc_action     is not null or
3160        p_conduct_performance.date_of_adverse_action   is not null or
3161        p_conduct_performance.days_suspended           is not null or
3162        p_conduct_performance.date_suspension_over_30  is not null or
3163        p_conduct_performance.date_suspension_under_30 is not null or
3164        p_conduct_performance.pip_action_taken         is not null or
3165        p_conduct_performance.pip_begin_date    		is not null or
3166        p_conduct_performance.pip_end_date       	is not null or
3167        p_conduct_performance.pip_extensions     	is not null or
3168        p_conduct_performance.pip_length        		is not null or
3169        p_conduct_performance.date_reprimand_expires	is not null then
3170        p_conduct_performance.cond_perf_flag         :=   'Y';
3171        hr_utility.set_location('non_pay_duty_status ', 25);
3172     End if;
3173 
3174     if l_session.noa_id_correct is not null then
3175        hr_utility.set_location('non_pay_duty_status ', 30);
3176 
3177        ghr_history_fetch.return_special_information
3178          (p_person_id         =>  p_pa_request_rec.person_id,
3179           p_structure_name    =>  'US Fed Conduct Perf',
3180           p_effective_date    =>  p_pa_request_rec.effective_date,
3181           p_special_info      =>  l_special_info_type
3182           );
3183 
3184        hr_utility.set_location('non_pay_duty_status :person analysis id '||l_special_info_type.person_analysis_id, 31);
3185        hr_utility.set_location('non_pay_duty_status :ovn '||l_special_info_type.object_version_number, 32);
3186        hr_utility.set_location('non_pay_duty_status :segment1 '||l_special_info_type.segment1, 33);
3187        hr_utility.set_location('non_pay_duty_status :segment2 '||l_special_info_type.segment2, 34);
3188        hr_utility.set_location('non_pay_duty_status :segment3 '||l_special_info_type.segment3, 35);
3189        hr_utility.set_location('non_pay_duty_status :segment4 '||l_special_info_type.segment4, 36);
3190        hr_utility.set_location('non_pay_duty_status :segment5 '||l_special_info_type.segment5, 37);
3191        hr_utility.set_location('non_pay_duty_status :segment6 '||l_special_info_type.segment6, 38);
3192        hr_utility.set_location('non_pay_duty_status :segment7 '||l_special_info_type.segment7, 39);
3193 
3194        p_conduct_performance.person_analysis_id         :=   l_special_info_type.person_analysis_id;
3195        p_conduct_performance.object_version_number      :=   l_special_info_type.object_version_number;
3196        if p_conduct_performance.cause_of_disc_action is null then
3197           p_conduct_performance.cause_of_disc_action    :=   l_special_info_type.segment1;
3198        end if;
3199        if p_conduct_performance.date_of_adverse_action is null then
3200           p_conduct_performance.date_of_adverse_action  :=   l_special_info_type.segment2;
3201        end if;
3202        if p_conduct_performance.days_suspended is null then
3203           p_conduct_performance.days_suspended          :=   l_special_info_type.segment3;
3204        end if;
3205        if p_conduct_performance.date_suspension_over_30 is null then
3206           p_conduct_performance.date_suspension_over_30 :=   l_special_info_type.segment4;
3207        end if;
3208        if p_conduct_performance.date_suspension_under_30 is null then
3209           p_conduct_performance.date_suspension_under_30 :=   l_special_info_type.segment5;
3210        end if;
3211        if p_conduct_performance.pip_action_taken is null then
3212           p_conduct_performance.pip_action_taken         :=   l_special_info_type.segment6;
3213        end if;
3214        if p_conduct_performance.pip_begin_date is null then
3215           p_conduct_performance.pip_begin_date          :=   l_special_info_type.segment7;
3216        end if;
3217        if p_conduct_performance.pip_end_date is null then
3218           p_conduct_performance.pip_end_date            :=   l_special_info_type.segment8;
3219        end if;
3220        if p_conduct_performance.pip_extensions is null then
3221           p_conduct_performance.pip_extensions          :=   l_special_info_type.segment9;
3222        end if;
3223        if p_conduct_performance.pip_length is null then
3224           p_conduct_performance.pip_length              :=   l_special_info_type.segment10;
3225        end if;
3226        if p_conduct_performance.date_reprimand_expires is null then
3227           p_conduct_performance.date_reprimand_expires  :=   l_special_info_type.segment11;
3228        end if;
3229        if p_conduct_performance.adverse_action_noac is null then
3230           p_conduct_performance.adverse_action_noac     :=   l_special_info_type.segment12;
3231        end if;
3232 
3233     end if;
3234     hr_utility.set_location('non_pay_duty_status ', 40);
3235 
3236   End non_pay_duty_status;
3237   --
3238   --
3239   Procedure lwop_info is
3240     l_proc                varchar2(72) := 'lwop_info';
3241 
3242   Begin
3243      --
3244      set_extra_info(p_per_group1.type_of_employment,
3245                     l_pa_request_ei_rec.rei_information3,
3246                     p_per_group1.per_group1_flag,
3247                     'Y'  );
3248      --
3249   End;
3250   --
3251   --
3252   Function fetch_extra_info_id (p_request_id number)
3253   return number is
3254      CURSOR c2 (c_request_id number) is
3255             SELECT  par.pa_request_id, par.altered_pa_request_id, pei.rei_information3
3256             FROM    ghr_pa_requests par, ghr_pa_request_extra_info pei
3257             WHERE   par.pa_request_id     = pei.pa_request_id(+)
3258               AND   pei.pa_request_id     = c_request_id
3259               AND   pei.information_type  = 'GHR_US_PAR_TERM_RET_GRADE';
3260 
3261      l_request_id         ghr_pa_requests.pa_request_id%type;
3262      l_extra_info_id      per_people_extra_info.person_extra_info_id%type;
3263 
3264   begin
3265      l_request_id := p_request_id;
3266      loop
3267         for c2_rec in c2(l_request_id) loop
3268             hr_utility.set_location('inside fetch extra info id loop',1);
3269             if c2_rec.rei_information3 is not null then
3270                l_extra_info_id := c2_rec.rei_information3;
3271             else
3272                l_request_id := c2_rec.pa_request_id;
3273             end if;
3274          end loop;
3275          if l_extra_info_id is not null then
3276             exit;
3277          end if;
3278       end loop;
3279       hr_utility.set_location('Leaving fetch extra_info_id',1);
3280       return(l_extra_info_id);
3281   end fetch_extra_info_id;
3282   --
3283   --
3284   Procedure term_retained_grade is
3285      CURSOR c1 (p_pei_id number) is
3286             SELECT  person_extra_info_id, object_version_number
3287             FROM    per_people_extra_info
3288             WHERE   person_extra_info_id = p_pei_id;
3289 
3290      l_proc                      varchar2(72)  :=  'non_sf52_extra - sss';
3291      l_per_extra_info_rec        per_people_extra_info%rowtype;
3292      l_person_extra_info_id      per_people_extra_info.person_extra_info_id%type;
3293      l_result_code               varchar2(100);
3294 
3295   Begin
3296      -- If it is a termination of retention grade , let us nullify all the entries in the per_retained_grade
3297 
3298         if l_pa_request_ei_rec.rei_information3 is null then
3299            -- errors out during the required check
3300            null;
3301         elsif l_pa_request_ei_rec.rei_information3 is not null  then
3302             -- fetch the ovn, set flag to Y
3303            for c1_rec in c1(l_pa_request_ei_rec.rei_information3) loop
3304                p_per_retained_grade.person_extra_info_id    :=  c1_rec.person_extra_info_id;
3305                hr_utility.set_location('RG 866 - set pei id',1);
3306              If l_session.noa_id_correct is null then
3307                p_per_retained_grade.object_version_number   :=  c1_rec.object_version_number;
3308                hr_utility.set_location('non correction -- RG 866',1);
3309                p_per_retained_grade.per_retained_grade_flag :=  'Y';
3310              end if;
3311            end loop;
3312         end if;
3313 
3314 
3315      hr_utility.set_location('leaving par term ret gr',1);
3316 
3317   End term_retained_grade;
3318   --
3319   --
3320   Procedure quality_step_increase is
3321      l_proc varchar2(72) := 'non_sf52_extra - quality_step_increase';
3322 
3323   Begin
3324 
3325      p_gov_awards.award_agency             :=  l_pa_request_ei_rec.rei_information3;
3326      p_gov_awards.award_type               :=  '07';
3327 -- Venkat -- Bug #982677 -- Previously referring trunc
3328      p_gov_awards.date_award_earned        :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
3329 
3330      If l_session.noa_id_correct is null then
3331         p_gov_awards.award_flag := 'Y';
3332      elsIf l_session.noa_id_correct is not null and  -- for correction fetch the existing values
3333         p_gov_awards.award_agency is not null then
3334         p_gov_awards.award_flag := 'Y';
3335      end if;
3336   end quality_step_increase;
3337   --
3338   --
3339   --
3340   Procedure  entitlement is
3341     l_proc        varchar2(70) := 'non_sf52_extra_info - entitlement';
3342 
3343   Begin
3344     --
3345     hr_utility.set_location('Entering ' ||l_proc,5);
3346     --
3347     p_entitlement.entitlement_code        := l_pa_request_ei_rec.rei_information3;
3348     p_entitlement.entitlement_amt_percent := l_pa_request_ei_rec.rei_information4;
3349     --Venkat 05/00 -- Bug# 1140536
3350     hr_utility.set_location('entitlement code is '||p_entitlement.entitlement_code ||l_proc,6);
3351     if nvl(p_entitlement.entitlement_code,hr_api.g_varchar2) = '9'
3352       and substr(nvl(p_pa_request_rec.duty_station_code,hr_api.g_varchar2),1,2)
3353       not in ('02','15','AQ','CQ','DQ',
3354               'FQ','GQ','HQ','JQ','KQ',
3355               'LQ','MQ','RQ','VQ','WQ') then
3356        hr_utility.set_message(8301,'GHR_38030_INV_DS_4_NON_F_COLA');
3357        hr_utility.raise_error;
3358     end if;
3359     if nvl(p_entitlement.entitlement_code,hr_api.g_varchar2) = 'C'
3360       and substr(nvl(p_pa_request_rec.duty_station_code,hr_api.g_varchar2),1,2)
3361        in ('02','15','AQ','CQ','DQ',
3362               'FQ','GQ','HQ','JQ','KQ',
3363               'LQ','MQ','RQ','VQ','WQ') then
3364        hr_utility.set_message(8301,'GHR_38032_INV_DS_4_COLA');
3365        hr_utility.raise_error;
3366     end if;
3367     if p_entitlement.entitlement_code        is not null or
3368        p_entitlement.entitlement_amt_percent is not null then
3369        p_entitlement.entitlement_flag := 'Y';
3370     end if;
3371     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3372        if p_entitlement.entitlement_code is null then
3373           ghr_history_fetch.fetch_element_entry_value
3374           (p_element_name          =>  'Entitlement',
3375            p_input_value_name      =>  'Code',
3376            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3377            p_date_effective        =>  p_pa_request_rec.effective_date,
3378            p_screen_entry_value    =>  p_entitlement.entitlement_code
3379           );
3380        end if;
3381        if p_entitlement.entitlement_amt_percent is null then
3382           ghr_history_fetch.fetch_element_entry_value
3383           (p_element_name          =>  'Entitlement',
3384            p_input_value_name      =>  'Amount or Percent',
3385            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3386            p_date_effective        =>  p_pa_request_rec.effective_date,
3387            p_screen_entry_value    =>  p_entitlement.entitlement_amt_percent
3388           );
3389        end if;
3390     end if;
3391     --
3392     hr_utility.set_location('Leaving ' ||l_proc,5);
3393     --
3394   END entitlement;
3395   --
3396   --
3397   Procedure for_lang_pay is
3398     l_proc        varchar2(70) := 'non_sf52_extra_info - for_lang_pay';
3399   Begin
3400     --
3401     hr_utility.set_location('Entering ' ||l_proc,5);
3402     --
3403     p_foreign_lang_prof_pay.certification_date := l_pa_request_ei_rec.rei_information3;
3404     p_foreign_lang_prof_pay.pay_level_or_rate  := l_pa_request_ei_rec.rei_information4;
3405     if p_foreign_lang_prof_pay.certification_date is not null or
3406        p_foreign_lang_prof_pay.pay_level_or_rate  is not null then
3407        p_foreign_lang_prof_pay.for_lang_flag := 'Y';
3408     end if;
3409     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3410        if p_foreign_lang_prof_pay.certification_date is null then
3411           ghr_history_fetch.fetch_element_entry_value
3412           (p_element_name          =>  'Foreign Lang Proficiency Pay',
3413            p_input_value_name      =>  'Certification Date',
3414            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3415            p_date_effective        =>  p_pa_request_rec.effective_date,
3416            p_screen_entry_value    =>  p_foreign_lang_prof_pay.certification_date
3417           );
3418        end if;
3419        if p_foreign_lang_prof_pay.pay_level_or_rate is null then
3420           ghr_history_fetch.fetch_element_entry_value
3421           (p_element_name          =>  'Foreign Lang Proficiency Pay',
3422            p_input_value_name      =>  'Pay Level or Rate',
3423            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3424            p_date_effective        =>  p_pa_request_rec.effective_date,
3425            p_screen_entry_value    =>  p_foreign_lang_prof_pay.pay_level_or_rate
3426           );
3427        end if;
3428     end if;
3429     --
3430     hr_utility.set_location('Leaving ' ||l_proc,5);
3431     --
3432   END for_lang_pay;
3433   --
3434   Procedure fta is
3435     l_proc        varchar2(70) := 'non_sf52_extra_info - fta';
3436   Begin
3437     --
3438     hr_utility.set_location('Entering ' ||l_proc,5);
3439     --
3440     p_imm_fta.last_action_code := l_pa_request_ei_rec.rei_information3;
3441     p_imm_fta.number_family_members := l_pa_request_ei_rec.rei_information4;
3442     p_imm_fta.Miscellaneous_Expense:= l_pa_request_ei_rec.rei_information5;
3443     p_imm_fta.Wardrobe_Expense := l_pa_request_ei_rec.rei_information6;
3444     p_imm_fta.Pre_Departure_Subs_Expense := l_pa_request_ei_rec.rei_information7;
3445     p_imm_fta.Lease_Penalty_Expense := l_pa_request_ei_rec.rei_information8;
3446     p_imm_fta.amount := l_pa_request_ei_rec.rei_information9;
3447     if p_imm_fta.last_action_code is not null or
3448        p_imm_fta.number_family_members  is not null or
3449        p_imm_fta.Miscellaneous_Expense is not null or
3450        p_imm_fta.Wardrobe_Expense is not null or
3451        p_imm_fta.Pre_Departure_Subs_Expense is not null or
3452        p_imm_fta.Lease_Penalty_Expense is not null or
3453        p_imm_fta.amount is not null then
3454        p_imm_fta.fta_flag := 'Y';
3455     end if;
3456 
3457   End fta;
3458   --
3459   --
3460   Procedure edp_pay is
3461     l_proc        varchar2(70) := 'non_sf52_extra_info - edp_pay';
3462   Begin
3463     --
3464     hr_utility.set_location('Entering ' ||l_proc,5);
3465     --
3466     p_edp_pay.premium_pay_indicator := l_pa_request_ei_rec.rei_information3;
3467     p_edp_pay.edp_type              := l_pa_request_ei_rec.rei_information4;
3468     if p_edp_pay.premium_pay_indicator is not null or
3469        p_edp_pay.edp_type              is not null then
3470        p_edp_pay.edp_flag := 'Y';
3471     end if;
3472     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3473        if p_edp_pay.premium_pay_indicator is null then
3474           ghr_history_fetch.fetch_element_entry_value
3475           (p_element_name          =>  'EDP Pay',
3476            p_input_value_name      =>  'Premium Pay Ind',
3477            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3478            p_date_effective        =>  p_pa_request_rec.effective_date,
3479            p_screen_entry_value    =>  p_edp_pay.premium_pay_indicator
3480           );
3481        end if;
3482        if p_edp_pay.edp_type is null then
3483           ghr_history_fetch.fetch_element_entry_value
3484           (p_element_name          =>  'EDP Pay',
3485            p_input_value_name      =>  'EDP Type',
3486            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3487            p_date_effective        =>  p_pa_request_rec.effective_date,
3488            p_screen_entry_value    =>  p_edp_pay.edp_type
3489           );
3490        end if;
3491     end if;
3492     --
3493     hr_utility.set_location('Leaving ' ||l_proc,5);
3494     --
3495   END edp_pay;
3496   --
3497   --
3498   Procedure hazard_pay is
3499     l_proc        varchar2(70) := 'non_sf52_extra_info - hazard_pay';
3500   Begin
3501     --
3502     hr_utility.set_location('Entering ' ||l_proc,5);
3503     --
3504     p_hazard_pay.premium_pay_indicator := l_pa_request_ei_rec.rei_information3;
3505     p_hazard_pay.hazard_type           := l_pa_request_ei_rec.rei_information4;
3506     if p_hazard_pay.premium_pay_indicator is not null or
3507        p_hazard_pay.hazard_type           is not null then
3508        p_hazard_pay.hazard_flag := 'Y';
3509     end if;
3510     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3511        if p_hazard_pay.premium_pay_indicator is null then
3512           ghr_history_fetch.fetch_element_entry_value
3513           (p_element_name          =>  'Hazard Pay',
3514            p_input_value_name      =>  'Premium Pay Ind',
3515            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3516            p_date_effective        =>  p_pa_request_rec.effective_date,
3517            p_screen_entry_value    =>  p_hazard_pay.premium_pay_indicator
3518           );
3519        end if;
3520        if p_hazard_pay.hazard_type is null then
3521           ghr_history_fetch.fetch_element_entry_value
3522           (p_element_name          =>  'Hazard Pay',
3523            p_input_value_name      =>  'Hazard Type',
3524            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3525            p_date_effective        =>  p_pa_request_rec.effective_date,
3526            p_screen_entry_value    =>  p_hazard_pay.hazard_type
3527           );
3528        end if;
3529     end if;
3530     --
3531     hr_utility.set_location('Leaving ' ||l_proc,10);
3532     --
3533   END hazard_pay;
3534   --
3535   --
3536   Procedure health_benefits is
3537     l_proc        varchar2(70) := 'non_sf52_extra_info - health_benefits';
3538   Begin
3539     --
3540     hr_utility.set_location('Entering ' ||l_proc,5);
3541     --
3542     p_health_benefits.enrollment       := l_pa_request_ei_rec.rei_information3;
3543     p_health_benefits.health_plan      := l_pa_request_ei_rec.rei_information4;
3544     p_health_benefits.temps_total_cost := l_pa_request_ei_rec.rei_information5;
3545     p_health_benefits.pre_tax_waiver := l_pa_request_ei_rec.rei_information6;
3546     if p_health_benefits.enrollment       is not null or
3547        p_health_benefits.health_plan      is not null or
3548        p_health_benefits.temps_total_cost is not null or
3549        p_health_benefits.pre_tax_waiver is not null then
3550        p_health_benefits.health_benefits_flag := 'Y';
3551     end if;
3552     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3553        if p_health_benefits.enrollment is null then
3554           ghr_history_fetch.fetch_element_entry_value
3555           (p_element_name          =>  'Health Benefits',
3556            p_input_value_name      =>  'Enrollment',
3557            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3558            p_date_effective        =>  p_pa_request_rec.effective_date,
3559            p_screen_entry_value    =>  p_health_benefits.enrollment
3560           );
3561        end if;
3562        if p_health_benefits.health_plan is null then
3563           ghr_history_fetch.fetch_element_entry_value
3564           (p_element_name          =>  'Health Benefits',
3565            p_input_value_name      =>  'Health Plan',
3566            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3567            p_date_effective        =>  p_pa_request_rec.effective_date,
3568            p_screen_entry_value    =>  p_health_benefits.health_plan
3569           );
3570        end if;
3571        if p_health_benefits.temps_total_cost is null then
3572           ghr_history_fetch.fetch_element_entry_value
3573           (p_element_name          =>  'Health Benefits',
3574            p_input_value_name      =>  'Temps Total Cost',
3575            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3576            p_date_effective        =>  p_pa_request_rec.effective_date,
3577            p_screen_entry_value    =>  p_health_benefits.temps_total_cost
3578           );
3579        end if;
3580        if p_health_benefits.pre_tax_waiver is null then
3581           ghr_history_fetch.fetch_element_entry_value
3582           (p_element_name          =>  'Health Benefits',
3583            p_input_value_name      =>  'Pre tax Waiver',
3584            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3585            p_date_effective        =>  p_pa_request_rec.effective_date,
3586            p_screen_entry_value    =>  p_health_benefits.pre_tax_waiver
3587           );
3588        end if;
3589     end if;
3590     --
3591     hr_utility.set_location('Leaving ' ||l_proc,5);
3592     --
3593   END health_benefits;
3594   --
3595   --
3596   Procedure health_ben_pre_tax is
3597     l_proc        varchar2(70) := 'non_sf52_extra_info - health_ben_pre_tax';
3598   Begin
3599     --
3600     hr_utility.set_location('Entering ' ||l_proc,5);
3601     --
3602     p_health_ben_pre_tax.enrollment       := l_pa_request_ei_rec.rei_information3;
3603     p_health_ben_pre_tax.health_plan      := l_pa_request_ei_rec.rei_information4;
3604     p_health_ben_pre_tax.temps_total_cost := l_pa_request_ei_rec.rei_information5;
3605     if p_health_ben_pre_tax.enrollment       is not null or
3606        p_health_ben_pre_tax.health_plan      is not null or
3607        p_health_ben_pre_tax.temps_total_cost is not null then
3608        p_health_ben_pre_tax.health_ben_pre_tax_flag := 'Y';
3609     end if;
3610     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3611        if p_health_ben_pre_tax.enrollment is null then
3612           ghr_history_fetch.fetch_element_entry_value
3613           (p_element_name          =>  'Health Benefits Pre tax',
3614            p_input_value_name      =>  'Enrollment',
3615            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3616            p_date_effective        =>  p_pa_request_rec.effective_date,
3617            p_screen_entry_value    =>  p_health_ben_pre_tax.enrollment
3618           );
3619        end if;
3620        if p_health_ben_pre_tax.health_plan is null then
3621           ghr_history_fetch.fetch_element_entry_value
3622           (p_element_name          =>  'Health Benefits Pre tax',
3623            p_input_value_name      =>  'Health Plan',
3624            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3625            p_date_effective        =>  p_pa_request_rec.effective_date,
3626            p_screen_entry_value    =>  p_health_ben_pre_tax.health_plan
3627           );
3628        end if;
3629        if p_health_ben_pre_tax.temps_total_cost is null then
3630           ghr_history_fetch.fetch_element_entry_value
3631           (p_element_name          =>  'Health Benefits Pre Tax',
3632            p_input_value_name      =>  'Temps Total Cost',
3633            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3634            p_date_effective        =>  p_pa_request_rec.effective_date,
3635            p_screen_entry_value    =>  p_health_ben_pre_tax.temps_total_cost
3636           );
3637        end if;
3638     end if;
3639     --
3640     hr_utility.set_location('Leaving ' ||l_proc,5);
3641     --
3642   END health_ben_pre_tax;
3643   --
3644   Procedure danger_pay is
3645     l_proc        varchar2(70) := 'non_sf52_extra_info - danger_pay';
3646   Begin
3647     --
3648     hr_utility.set_location('Entering ' ||l_proc,5);
3649     --
3650     p_danger_pay.last_action_code   := l_pa_request_ei_rec.rei_information3;
3651     p_danger_pay.location           := l_pa_request_ei_rec.rei_information4;
3652     if p_danger_pay.last_action_code    is not null or
3653        p_danger_pay.location            is not null then
3654        p_danger_pay.danger_flag := 'Y';
3655     end if;
3656     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3657        if p_danger_pay.last_action_code is null then
3658           ghr_history_fetch.fetch_element_entry_value
3659           (p_element_name          =>  'Danger Pay',
3660            p_input_value_name      =>  'Last Action Code',
3661            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3662            p_date_effective        =>  p_pa_request_rec.effective_date,
3663            p_screen_entry_value    =>  p_danger_pay.last_action_code
3664           );
3665        end if;
3666        if p_danger_pay.location is null then
3667           ghr_history_fetch.fetch_element_entry_value
3668           (p_element_name          =>  'Danger Pay',
3669            p_input_value_name      =>  'Location',
3670            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3671            p_date_effective        =>  p_pa_request_rec.effective_date,
3672            p_screen_entry_value    =>  p_danger_pay.location
3673           );
3674        end if;
3675     end if;
3676     --
3677     hr_utility.set_location('Leaving ' ||l_proc,5);
3678     --
3679   END danger_pay;
3680   --
3681   --
3682   Procedure imminent_danger_pay is
3683     l_proc        varchar2(70) := 'non_sf52_extra_info - imminent_danger_pay';
3684   Begin
3685     --
3686     hr_utility.set_location('Entering ' ||l_proc,5);
3687     --
3688     p_imminent_danger_pay.amount             := l_pa_request_ei_rec.rei_information3;
3689     p_imminent_danger_pay.location           := l_pa_request_ei_rec.rei_information4;
3690     p_imminent_danger_pay.last_action_code   := l_pa_request_ei_rec.rei_information5;
3691     if p_imminent_danger_pay.amount             is not null or
3692        p_imminent_danger_pay.last_action_code   is not null or
3693        p_imminent_danger_pay.location           is not null  then
3694        p_imminent_danger_pay.imminent_danger_flag := 'Y';
3695     end if;
3696     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3697        if p_imminent_danger_pay.amount is null then
3698           ghr_history_fetch.fetch_element_entry_value
3699           (p_element_name          =>  'Imminent Danger Pay',
3700            p_input_value_name      =>  'Amount',
3701            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3702            p_date_effective        =>  p_pa_request_rec.effective_date,
3703            p_screen_entry_value    =>  p_imminent_danger_pay.amount
3704           );
3705        end if;
3706        if p_imminent_danger_pay.last_action_code is null then
3707           ghr_history_fetch.fetch_element_entry_value
3708           (p_element_name          =>  'Imminent Danger Pay',
3709            p_input_value_name      =>  'Last Action Code',
3710            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3711            p_date_effective        =>  p_pa_request_rec.effective_date,
3712            p_screen_entry_value    =>  p_imminent_danger_pay.last_action_code
3713           );
3714        end if;
3715        if p_imminent_danger_pay.location is null then
3716           ghr_history_fetch.fetch_element_entry_value
3717           (p_element_name          =>  'Imminent Danger Pay',
3718            p_input_value_name      =>  'Location',
3719            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3720            p_date_effective        =>  p_pa_request_rec.effective_date,
3721            p_screen_entry_value    =>  p_imminent_danger_pay.location
3722           );
3723        end if;
3724     end if;
3725     --
3726     hr_utility.set_location('Leaving ' ||l_proc,5);
3727     --
3728   END imminent_danger_pay;
3729   --
3730   --
3731   Procedure living_quarters_allow is
3732     l_proc        varchar2(70) := 'non_sf52_extra_info - living_quarters_allow';
3733   Begin
3734     --
3735     hr_utility.set_location('Entering ' ||l_proc,5);
3736     --
3737     p_living_quarters_allow.purchase_amount      := l_pa_request_ei_rec.rei_information3;
3738     p_living_quarters_allow.purchase_date        := l_pa_request_ei_rec.rei_information4;
3739     p_living_quarters_allow.rent_amount          := l_pa_request_ei_rec.rei_information5;
3740     p_living_quarters_allow.utility_amount       := l_pa_request_ei_rec.rei_information6;
3741     p_living_quarters_allow.last_action_code     := l_pa_request_ei_rec.rei_information7;
3742     p_living_quarters_allow.location             := l_pa_request_ei_rec.rei_information8;
3743     p_living_quarters_allow.quarters_type        := l_pa_request_ei_rec.rei_information9;
3744     p_living_quarters_allow.shared_percent       := l_pa_request_ei_rec.rei_information10;
3745     p_living_quarters_allow.no_of_family_members := l_pa_request_ei_rec.rei_information11;
3746     p_living_quarters_allow.summer_record_ind    := l_pa_request_ei_rec.rei_information12;
3747     p_living_quarters_allow.quarters_group       := l_pa_request_ei_rec.rei_information13;
3748     p_living_quarters_allow.currency             := l_pa_request_ei_rec.rei_information14;
3749 
3750     if p_living_quarters_allow.purchase_amount      is not null or
3751        p_living_quarters_allow.purchase_date        is not null or
3752        p_living_quarters_allow.rent_amount          is not null or
3753        p_living_quarters_allow.utility_amount       is not null or
3754        p_living_quarters_allow.last_action_code     is not null or
3755        p_living_quarters_allow.location             is not null or
3756        p_living_quarters_allow.quarters_type        is not null or
3757        p_living_quarters_allow.shared_percent       is not null or
3758        p_living_quarters_allow.no_of_family_members is not null or
3759        p_living_quarters_allow.summer_record_ind    is not null or
3760        p_living_quarters_allow.quarters_group       is not null or
3761        p_living_quarters_allow.currency             is not null then
3762        p_living_quarters_allow.living_quarters_allow_flag := 'Y';
3763     end if;
3764 
3765     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3766        if p_living_quarters_allow.purchase_amount is null then
3767           ghr_history_fetch.fetch_element_entry_value
3768           (p_element_name          =>  'Living Quarters Allowance',
3769            p_input_value_name      =>  'Purchase Amount',
3770            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3771            p_date_effective        =>  p_pa_request_rec.effective_date,
3772            p_screen_entry_value    =>  p_living_quarters_allow.purchase_amount
3773           );
3774        end if;
3775        if p_living_quarters_allow.purchase_date is null then
3776           ghr_history_fetch.fetch_element_entry_value
3777           (p_element_name          =>  'Living Quarters Allowance',
3778            p_input_value_name      =>  'Purchase Date',
3779            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3780            p_date_effective        =>  p_pa_request_rec.effective_date,
3781            p_screen_entry_value    =>  p_living_quarters_allow.purchase_date
3782           );
3783        end if;
3784        if p_living_quarters_allow.rent_amount is null then
3785           ghr_history_fetch.fetch_element_entry_value
3786           (p_element_name          =>  'Living Quarters Allowance',
3787            p_input_value_name      =>  'Rent Amount',
3788            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3789            p_date_effective        =>  p_pa_request_rec.effective_date,
3790            p_screen_entry_value    =>  p_living_quarters_allow.rent_amount
3791           );
3792        end if;
3793        if p_living_quarters_allow.utility_amount is null then
3794           ghr_history_fetch.fetch_element_entry_value
3795           (p_element_name          =>  'Living Quarters Allowance',
3796            p_input_value_name      =>  'Utility Amount',
3797            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3798            p_date_effective        =>  p_pa_request_rec.effective_date,
3799            p_screen_entry_value    =>  p_living_quarters_allow.utility_amount
3800           );
3801        end if;
3802        if p_living_quarters_allow.last_action_code is null then
3803           ghr_history_fetch.fetch_element_entry_value
3804           (p_element_name          =>  'Living Quarters Allowance',
3805            p_input_value_name      =>  'Last Action Code',
3806            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3807            p_date_effective        =>  p_pa_request_rec.effective_date,
3808            p_screen_entry_value    =>  p_living_quarters_allow.last_action_code
3809           );
3810        end if;
3811        if p_living_quarters_allow.location is null then
3812           ghr_history_fetch.fetch_element_entry_value
3813           (p_element_name          =>  'Living Quarters Allowance',
3814            p_input_value_name      =>  'Location',
3815            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3816            p_date_effective        =>  p_pa_request_rec.effective_date,
3817            p_screen_entry_value    =>  p_living_quarters_allow.location
3818           );
3819        end if;
3820        if p_living_quarters_allow.quarters_type is null then
3821           ghr_history_fetch.fetch_element_entry_value
3822           (p_element_name          =>  'Living Quarters Allowance',
3823            p_input_value_name      =>  'Quarters Type',
3824            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3825            p_date_effective        =>  p_pa_request_rec.effective_date,
3826            p_screen_entry_value    =>  p_living_quarters_allow.quarters_type
3827           );
3828        end if;
3829        if p_living_quarters_allow.shared_percent is null then
3830           ghr_history_fetch.fetch_element_entry_value
3831           (p_element_name          =>  'Living Quarters Allowance',
3832            p_input_value_name      =>  'Shared Percent',
3833            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3834            p_date_effective        =>  p_pa_request_rec.effective_date,
3835            p_screen_entry_value    =>  p_living_quarters_allow.shared_percent
3836           );
3837        end if;
3838        if p_living_quarters_allow.no_of_family_members is null then
3839           ghr_history_fetch.fetch_element_entry_value
3840           (p_element_name          =>  'Living Quarters Allowance',
3841            p_input_value_name      =>  'No. Family Members',
3842            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3843            p_date_effective        =>  p_pa_request_rec.effective_date,
3844            p_screen_entry_value    =>  p_living_quarters_allow.no_of_family_members
3845           );
3846        end if;
3847        if p_living_quarters_allow.summer_record_ind is null then
3848           ghr_history_fetch.fetch_element_entry_value
3849           (p_element_name          =>  'Living Quarters Allowance',
3850            p_input_value_name      =>  'Summer Record Ind',
3851            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3852            p_date_effective        =>  p_pa_request_rec.effective_date,
3853            p_screen_entry_value    =>  p_living_quarters_allow.summer_record_ind
3854           );
3855        end if;
3856        if p_living_quarters_allow.quarters_group is null then
3857           ghr_history_fetch.fetch_element_entry_value
3858           (p_element_name          =>  'Living Quarters Allowance',
3859            p_input_value_name      =>  'Quarters Group',
3860            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3861            p_date_effective        =>  p_pa_request_rec.effective_date,
3862            p_screen_entry_value    =>  p_living_quarters_allow.quarters_group
3863           );
3864        end if;
3865        if p_living_quarters_allow.currency is null then
3866           ghr_history_fetch.fetch_element_entry_value
3867           (p_element_name          =>  'Living Quarters Allowance',
3868            p_input_value_name      =>  'Currency',
3869            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3870            p_date_effective        =>  p_pa_request_rec.effective_date,
3871            p_screen_entry_value    =>  p_living_quarters_allow.currency
3872           );
3873        end if;
3874     end if;
3875     --
3876     hr_utility.set_location('Leaving ' ||l_proc,5);
3877     --
3878   END living_quarters_allow;
3879   --
3880   --
3881   Procedure post_diff_amt is
3882     l_proc        varchar2(70) := 'non_sf52_extra_info - post_diff_amt';
3883   Begin
3884     --
3885     hr_utility.set_location('Entering ' ||l_proc,5);
3886     --
3887     p_post_diff_amt.amount               := l_pa_request_ei_rec.rei_information3;
3888     p_post_diff_amt.last_action_code     := l_pa_request_ei_rec.rei_information4;
3889     p_post_diff_amt.location             := l_pa_request_ei_rec.rei_information5;
3890     p_post_diff_amt.no_of_family_members := l_pa_request_ei_rec.rei_information6;
3891 
3892 
3893     if p_post_diff_amt.amount               is not null or
3894        p_post_diff_amt.last_action_code     is not null or
3895        p_post_diff_amt.location             is not null or
3896        p_post_diff_amt.no_of_family_members is not null then
3897        p_post_diff_amt.post_diff_amt_flag  := 'Y';
3898     end if;
3899     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3900        if p_post_diff_amt.amount is null then
3901           ghr_history_fetch.fetch_element_entry_value
3902 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
3903 			(p_element_name          =>  'Post Allowance',
3904            p_input_value_name      =>  'Amount',
3905            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3906            p_date_effective        =>  p_pa_request_rec.effective_date,
3907            p_screen_entry_value    =>  p_post_diff_amt.amount
3908           );
3909        end if;
3910        if p_post_diff_amt.last_action_code is null then
3911           ghr_history_fetch.fetch_element_entry_value
3912 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
3913 			(p_element_name          =>  'Post Allowance',
3914            p_input_value_name      =>  'Last Action Code',
3915            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3916            p_date_effective        =>  p_pa_request_rec.effective_date,
3917            p_screen_entry_value    =>  p_post_diff_amt.last_action_code
3918           );
3919        end if;
3920        if p_post_diff_amt.location is null then
3921           ghr_history_fetch.fetch_element_entry_value
3922 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
3923 			(p_element_name          =>  'Post Allowance',
3924 		   p_input_value_name      =>  'Location',
3925            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3926            p_date_effective        =>  p_pa_request_rec.effective_date,
3927            p_screen_entry_value    =>  p_post_diff_amt.location
3928           );
3929        end if;
3930        if p_post_diff_amt.no_of_family_members is null then
3931           ghr_history_fetch.fetch_element_entry_value
3932 --          (p_element_name          =>  'Post Differential Amount', -- Bug 2645878 Renamed element
3933 			(p_element_name          =>  'Post Allowance',
3934            p_input_value_name      =>  'No. Family Members',
3935            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3936            p_date_effective        =>  p_pa_request_rec.effective_date,
3937            p_screen_entry_value    =>  p_post_diff_amt.no_of_family_members
3938           );
3939        end if;
3940     end if;
3941     --
3942     hr_utility.set_location('Leaving ' ||l_proc,5);
3943     --
3944   END post_diff_amt;
3945   --
3946   --
3947   Procedure post_diff_percent is
3948     l_proc        varchar2(70) := 'non_sf52_extra_info - post_diff_percent';
3949   Begin
3950     --
3951     hr_utility.set_location('Entering ' ||l_proc,5);
3952     --
3953     p_post_diff_percent.percent              := l_pa_request_ei_rec.rei_information3;
3954     p_post_diff_percent.last_action_code     := l_pa_request_ei_rec.rei_information4;
3955     p_post_diff_percent.location             := l_pa_request_ei_rec.rei_information5;
3956     if p_post_diff_percent.percent              is not null or
3957        p_post_diff_percent.last_action_code     is not null or
3958        p_post_diff_percent.location             is not null then
3959        p_post_diff_percent.post_diff_percent_flag  := 'Y';
3960     end if;
3961     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
3962        if p_post_diff_percent.percent is null then
3963           ghr_history_fetch.fetch_element_entry_value
3964 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
3965 			(p_element_name          =>  'Post Differential',
3966            p_input_value_name      =>  'Percentage',
3967            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3968            p_date_effective        =>  p_pa_request_rec.effective_date,
3969            p_screen_entry_value    =>  p_post_diff_percent.percent
3970           );
3971        end if;
3972        if p_post_diff_percent.last_action_code is null then
3973           ghr_history_fetch.fetch_element_entry_value
3974 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
3975 			(p_element_name          =>  'Post Differential',
3976            p_input_value_name      =>  'Last Action Code',
3977            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3978            p_date_effective        =>  p_pa_request_rec.effective_date,
3979            p_screen_entry_value    =>  p_post_diff_percent.last_action_code
3980           );
3981        end if;
3982        if p_post_diff_percent.location is null then
3983           ghr_history_fetch.fetch_element_entry_value
3984 --          (p_element_name          =>  'Post Differential Percent', -- Bug 2645878 Renamed element
3985 			(p_element_name          =>  'Post Differential',
3986            p_input_value_name      =>  'Location',
3987            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
3988            p_date_effective        =>  p_pa_request_rec.effective_date,
3989            p_screen_entry_value    =>  p_post_diff_percent.location
3990           );
3991        end if;
3992     end if;
3993     --
3994     hr_utility.set_location('Leaving ' ||l_proc,5);
3995     --
3996   END post_diff_percent;
3997   --
3998   --
3999   Procedure sep_maintenance_allow is
4000     l_proc        varchar2(70) := 'non_sf52_extra_info - sep_maintenance_allow';
4001   Begin
4002     --
4003     hr_utility.set_location('Entering ' ||l_proc,5);
4004     --
4005     p_sep_maintenance_allow.amount               := l_pa_request_ei_rec.rei_information3;
4006     p_sep_maintenance_allow.last_action_code     := l_pa_request_ei_rec.rei_information4;
4007     p_sep_maintenance_allow.category             := l_pa_request_ei_rec.rei_information5;
4008 
4009     if p_sep_maintenance_allow.amount               is not null or
4010        p_sep_maintenance_allow.last_action_code     is not null or
4011        p_sep_maintenance_allow.category             is not null then
4012        p_sep_maintenance_allow.sep_maint_allow_flag  := 'Y';
4013     end if;
4014     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4015        if p_sep_maintenance_allow.amount is null then
4016           ghr_history_fetch.fetch_element_entry_value
4017           (p_element_name          =>  'Separate Maintenance Allowance',
4018            p_input_value_name      =>  'Amount',
4019            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4020            p_date_effective        =>  p_pa_request_rec.effective_date,
4021            p_screen_entry_value    =>  p_sep_maintenance_allow.amount
4022           );
4023        end if;
4024        if p_sep_maintenance_allow.last_action_code is null then
4025           ghr_history_fetch.fetch_element_entry_value
4026           (p_element_name          =>  'Separate Maintenance Allowance',
4027            p_input_value_name      =>  'Last Action Code',
4028            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4029            p_date_effective        =>  p_pa_request_rec.effective_date,
4030            p_screen_entry_value    =>  p_sep_maintenance_allow.last_action_code
4031           );
4032        end if;
4033        if p_sep_maintenance_allow.category is null then
4034           ghr_history_fetch.fetch_element_entry_value
4035           (p_element_name          =>  'Separate Maintenance Allowance',
4036            p_input_value_name      =>  'Category',
4037            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4038            p_date_effective        =>  p_pa_request_rec.effective_date,
4039            p_screen_entry_value    =>  p_sep_maintenance_allow.category
4040           );
4041        end if;
4042     end if;
4043     --
4044     hr_utility.set_location('Leaving ' ||l_proc,5);
4045     --
4046   END sep_maintenance_allow;
4047   --
4048   --
4049   Procedure supplemental_post_allow is
4050     l_proc        varchar2(70) := 'non_sf52_extra_info - supplemental_post_allow';
4051   Begin
4052     --
4053     hr_utility.set_location('Entering ' ||l_proc,5);
4054     --
4055     p_supplemental_post_allow.amount   := l_pa_request_ei_rec.rei_information3;
4056 
4057     if p_supplemental_post_allow.amount   is not null then
4058        p_supplemental_post_allow.sup_post_allow_flag  := 'Y';
4059     end if;
4060     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4061        if p_supplemental_post_allow.amount is null then
4062           ghr_history_fetch.fetch_element_entry_value
4063           (p_element_name          =>  'Supplemental Post Allowance',
4064            p_input_value_name      =>  'Amount',
4065            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4066            p_date_effective        =>  p_pa_request_rec.effective_date,
4067            p_screen_entry_value    =>  p_supplemental_post_allow.amount
4068           );
4069        end if;
4070     End if;
4071     hr_utility.set_location('Leaving ' ||l_proc,5);
4072     --
4073   END supplemental_post_allow;
4074   --
4075   --
4076   Procedure temp_lodge_allow is
4077     l_proc        varchar2(70) := 'non_sf52_extra_info - temp_lodge_allow';
4078   Begin
4079     --
4080     hr_utility.set_location('Entering ' ||l_proc,5);
4081     --
4082     p_temp_lodge_allow.allowance_type  := l_pa_request_ei_rec.rei_information3;
4083     p_temp_lodge_allow.daily_rate      := l_pa_request_ei_rec.rei_information4;
4084 
4085     if p_temp_lodge_allow.allowance_type   is not null and
4086        p_temp_lodge_allow.daily_rate is not null then
4087        p_temp_lodge_allow.temp_lodge_allow_flag  := 'Y';
4088     end if;
4089     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4090        if p_temp_lodge_allow.allowance_type is null then
4091           ghr_history_fetch.fetch_element_entry_value
4092           (p_element_name          =>  'Temporary Lodging Allowance',
4093            p_input_value_name      =>  'Allowance Type',
4094            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4095            p_date_effective        =>  p_pa_request_rec.effective_date,
4096            p_screen_entry_value    =>  p_temp_lodge_allow.allowance_type
4097           );
4098        end if;
4099        if p_temp_lodge_allow.daily_rate is null then
4100           ghr_history_fetch.fetch_element_entry_value
4101           (p_element_name          =>  'Temporary Lodging Allowance',
4102            p_input_value_name      =>  'Daily Rate',
4103            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4104            p_date_effective        =>  p_pa_request_rec.effective_date,
4105            p_screen_entry_value    =>  p_temp_lodge_allow.daily_rate
4106           );
4107        end if;
4108     End if;
4109     hr_utility.set_location('Leaving ' ||l_proc,5);
4110     --
4111   END temp_lodge_allow;
4112   --
4113   --
4114   Procedure premium_pay is
4115     l_proc        varchar2(70) := 'non_sf52_extra_info - premium_pay';
4116   Begin
4117     --
4118     hr_utility.set_location('Entering ' ||l_proc,5);
4119     --
4120     p_premium_pay.premium_pay_ind := l_pa_request_ei_rec.rei_information3;
4121     p_premium_pay.amount          := l_pa_request_ei_rec.rei_information4;
4122 
4123     if p_premium_pay.premium_pay_ind is not null or
4124        p_premium_pay.amount   is not null then
4125        p_premium_pay.premium_pay_flag  := 'Y';
4126     end if;
4127     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4128        if p_premium_pay.premium_pay_ind is null then
4129           ghr_history_fetch.fetch_element_entry_value
4130           (p_element_name          =>  'Premium Pay',
4131            p_input_value_name      =>  'Premium Pay Ind',
4132            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4133            p_date_effective        =>  p_pa_request_rec.effective_date,
4134            p_screen_entry_value    =>  p_premium_pay.premium_pay_ind
4135           );
4136        end if;
4137        if p_premium_pay.amount is null then
4138           ghr_history_fetch.fetch_element_entry_value
4139           (p_element_name          =>  'Premium Pay',
4140            p_input_value_name      =>  'Amount',
4141            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4142            p_date_effective        =>  p_pa_request_rec.effective_date,
4143            p_screen_entry_value    =>  p_premium_pay.amount
4144           );
4145        end if;
4146     End if;
4147     hr_utility.set_location('Leaving ' ||l_proc,5);
4148     --
4149   END premium_pay;
4150   --
4151   --
4152   Procedure retirement_annuity is
4153     l_proc        varchar2(70) := 'non_sf52_extra_info - retirement_annuity';
4154   Begin
4155     --
4156     hr_utility.set_location('Entering ' ||l_proc,5);
4157     --
4158     p_retirement_annuity.annuity_sum         := l_pa_request_ei_rec.rei_information3;
4159     p_retirement_annuity.eligibility_expires := l_pa_request_ei_rec.rei_information4;
4160 
4161     if p_retirement_annuity.annuity_sum         is not null or
4162        p_retirement_annuity.eligibility_expires is not null then
4163        p_retirement_annuity.retirement_annuity_flag  := 'Y';
4164     end if;
4165     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4166        if p_retirement_annuity.annuity_sum is null then
4167           ghr_history_fetch.fetch_element_entry_value
4168           (p_element_name          =>  'Retirement Annuity',
4169            p_input_value_name      =>  'Sum',
4170            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4171            p_date_effective        =>  p_pa_request_rec.effective_date,
4172            p_screen_entry_value    =>  p_retirement_annuity.annuity_sum
4173           );
4174        end if;
4175        if p_retirement_annuity.eligibility_expires is null then
4176           ghr_history_fetch.fetch_element_entry_value
4177           (p_element_name          =>  'Retirement Annuity',
4178            p_input_value_name      =>  'Eligibility Expires',
4179            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4180            p_date_effective        =>  p_pa_request_rec.effective_date,
4181            p_screen_entry_value    =>  p_retirement_annuity.eligibility_expires
4182           );
4183        end if;
4184     End if;
4185     hr_utility.set_location('Leaving ' ||l_proc,5);
4186     --
4187   END retirement_annuity;
4188   --
4189   --
4190   Procedure severance_pay is
4191     l_proc        varchar2(70) := 'non_sf52_extra_info - severance_pay';
4192   Begin
4193     --
4194     hr_utility.set_location('Entering ' ||l_proc,5);
4195     --
4196     p_severance_pay.amount                  := l_pa_request_ei_rec.rei_information3;
4197     p_severance_pay.total_entitlement_weeks := l_pa_request_ei_rec.rei_information4;
4198     p_severance_pay.number_weeks_paid       := l_pa_request_ei_rec.rei_information5;
4199     p_severance_pay.weekly_amount           := l_pa_request_ei_rec.rei_information6;
4200 
4201     if p_severance_pay.amount                  is not null or
4202        p_severance_pay.total_entitlement_weeks is not null or
4203        p_severance_pay.number_weeks_paid       is not null or
4204        p_severance_pay.weekly_amount           is not null then
4205        p_severance_pay.severance_pay_flag  := 'Y';
4206     end if;
4207     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4208        if p_severance_pay.amount is null then
4209           ghr_history_fetch.fetch_element_entry_value
4210           (p_element_name          =>  'Severance Pay',
4211            p_input_value_name      =>  'Amount',
4212            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4213            p_date_effective        =>  p_pa_request_rec.effective_date,
4214            p_screen_entry_value    =>  p_severance_pay.amount
4215           );
4216        end if;
4217        if p_severance_pay.total_entitlement_weeks is null then
4218           ghr_history_fetch.fetch_element_entry_value
4219           (p_element_name          =>  'Severance Pay',
4220            p_input_value_name      =>  'Total Entitlement Weeks',
4221            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4222            p_date_effective        =>  p_pa_request_rec.effective_date,
4223            p_screen_entry_value    =>  p_severance_pay.total_entitlement_weeks
4224           );
4225        end if;
4226        if p_severance_pay.number_weeks_paid is null then
4227           ghr_history_fetch.fetch_element_entry_value
4228           (p_element_name          =>  'Severance Pay',
4229            p_input_value_name      =>  'Number Weeks Paid',
4230            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4231            p_date_effective        =>  p_pa_request_rec.effective_date,
4232            p_screen_entry_value    =>  p_severance_pay.number_weeks_paid
4233           );
4234        end if;
4235        if p_severance_pay.weekly_amount is null then
4236           ghr_history_fetch.fetch_element_entry_value
4237           (p_element_name          =>  'Severance Pay',
4238            p_input_value_name      =>  'Weekly Amount',
4239            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4240            p_date_effective        =>  p_pa_request_rec.effective_date,
4241            p_screen_entry_value    =>  p_severance_pay.weekly_amount
4242           );
4243        end if;
4244     End if;
4245     hr_utility.set_location('Leaving ' ||l_proc,5);
4246     --
4247   END severance_pay;
4248   --
4249   --
4250 /*
4251   Procedure thrift_saving_plan is
4252     l_proc   varchar2(70) := 'non_sf52_extra_info - thrift_saving_plan';
4253   Begin
4254     --
4255     hr_utility.set_location('Entering ' ||l_proc,5);
4256     --
4257     p_thrift_saving_plan.amount           := l_pa_request_ei_rec.rei_information3;
4258     p_thrift_saving_plan.rate             := l_pa_request_ei_rec.rei_information4;
4259     p_thrift_saving_plan.g_fund           := l_pa_request_ei_rec.rei_information5;
4260     p_thrift_saving_plan.f_fund           := l_pa_request_ei_rec.rei_information6;
4261     p_thrift_saving_plan.c_fund           := l_pa_request_ei_rec.rei_information7;
4262     p_thrift_saving_plan.status           := l_pa_request_ei_rec.rei_information8;
4263     p_thrift_saving_plan.status_date      := l_pa_request_ei_rec.rei_information9;
4264     p_thrift_saving_plan.agncy_contrib_elig_date := l_pa_request_ei_rec.rei_information10;
4265     p_thrift_saving_plan.emp_contrib_elig_date := l_pa_request_ei_rec.rei_information11;
4266 
4267     if p_thrift_saving_plan.amount           is not null or
4268        p_thrift_saving_plan.rate             is not null or
4269        p_thrift_saving_plan.g_fund           is not null or
4270        p_thrift_saving_plan.f_fund           is not null or
4271        p_thrift_saving_plan.c_fund           is not null or
4272        p_thrift_saving_plan.status           is not null or
4273        p_thrift_saving_plan.status_date      is not null or
4274        p_thrift_saving_plan.agncy_contrib_elig_date is not null then
4275        p_thrift_saving_plan.tsp_flag  := 'Y';
4276     end if;
4277 
4278 -- Bug#2146912  Added set_extra_info call
4279      set_extra_info(p_per_scd_info.scd_tsp,l_pa_request_ei_rec.rei_information12,
4280                     p_per_scd_info.per_scd_info_flag, 'Y');
4281 
4282     If l_session.noa_id_correct is not null then -- for correction fetch the existing values
4283        if p_thrift_saving_plan.amount is null then
4284           ghr_history_fetch.fetch_element_entry_value
4285           (p_element_name          =>  'TSP',
4286            p_input_value_name      =>  'Amount',
4287            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4288            p_date_effective        =>  p_pa_request_rec.effective_date,
4289            p_screen_entry_value    =>  p_thrift_saving_plan.amount
4290           );
4291        end if;
4292        if p_thrift_saving_plan.rate is null then
4293           ghr_history_fetch.fetch_element_entry_value
4294           (p_element_name          =>  'TSP',
4295            p_input_value_name      =>  'Rate',
4296            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4297            p_date_effective        =>  p_pa_request_rec.effective_date,
4298            p_screen_entry_value    =>  p_thrift_saving_plan.rate
4299           );
4300        end if;
4301        if p_thrift_saving_plan.g_fund is null then
4302           ghr_history_fetch.fetch_element_entry_value
4303           (p_element_name          =>  'TSP',
4304            p_input_value_name      =>  'G Fund',
4305            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4306            p_date_effective        =>  p_pa_request_rec.effective_date,
4307            p_screen_entry_value    =>  p_thrift_saving_plan.g_fund
4308           );
4309        end if;
4310        if p_thrift_saving_plan.f_fund is null then
4311           ghr_history_fetch.fetch_element_entry_value
4312           (p_element_name          =>  'TSP',
4313            p_input_value_name      =>  'F Fund',
4314            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4315            p_date_effective        =>  p_pa_request_rec.effective_date,
4316            p_screen_entry_value    =>  p_thrift_saving_plan.f_fund
4317           );
4318        end if;
4319        if p_thrift_saving_plan.c_fund is null then
4320           ghr_history_fetch.fetch_element_entry_value
4321           (p_element_name          =>  'TSP',
4322            p_input_value_name      =>  'C Fund',
4323            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4324            p_date_effective        =>  p_pa_request_rec.effective_date,
4325            p_screen_entry_value    =>  p_thrift_saving_plan.c_fund
4326           );
4327        end if;
4328        if p_thrift_saving_plan.status is null then
4329           ghr_history_fetch.fetch_element_entry_value
4330           (p_element_name          =>  'TSP',
4331            p_input_value_name      =>  'Status',
4332            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4333            p_date_effective        =>  p_pa_request_rec.effective_date,
4334            p_screen_entry_value    =>  p_thrift_saving_plan.status
4335           );
4336        end if;
4337        if p_thrift_saving_plan.status_date is null then
4338           ghr_history_fetch.fetch_element_entry_value
4339           (p_element_name          =>  'TSP',
4340            p_input_value_name      =>  'Status Date',
4341            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4342            p_date_effective        =>  p_pa_request_rec.effective_date,
4343            p_screen_entry_value    =>  p_thrift_saving_plan.status_date
4344           );
4345        end if;
4346        if p_thrift_saving_plan.agncy_contrib_elig_date is null then
4347           ghr_history_fetch.fetch_element_entry_value
4348           (p_element_name          =>  'TSP',
4349            p_input_value_name      =>  'Agncy Contrib Elig Date',
4350            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4351            p_date_effective        =>  p_pa_request_rec.effective_date,
4352            p_screen_entry_value    =>  p_thrift_saving_plan.agncy_contrib_elig_date
4353           );
4354        end if;
4355        if p_thrift_saving_plan.emp_contrib_elig_date is null then
4356           ghr_history_fetch.fetch_element_entry_value
4357           (p_element_name          =>  'TSP',
4358            p_input_value_name      =>  'Emp Contrib Elig Date',
4359            p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4360            p_date_effective        =>  p_pa_request_rec.effective_date,
4361            p_screen_entry_value    =>  p_thrift_saving_plan.emp_contrib_elig_date
4362           );
4363        end if;
4364     end if;
4365     hr_utility.set_location('Leaving ' ||l_proc,5);
4366     --
4367   END thrift_saving_plan;*/
4368   --
4369   --
4370   Procedure retention_allow_review is
4371     l_proc   varchar2(70) := 'non_sf52_extra_info - retention_allow_review';
4372   Begin
4373     --
4374     hr_utility.set_location('Entering ' ||l_proc,5);
4375        If  p_pa_request_rec.employee_assignment_id is not null then
4376       ghr_api.retrieve_element_entry_value
4377               (p_element_name          => 'Retention Allowance',
4378                p_input_value_name      => 'Date',
4379                p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4380                p_effective_date        => nvl(p_pa_request_rec.effective_date,trunc(sysdate)) ,
4381                p_value                 => p_retention_allow_review.review_date,
4382                p_multiple_error_flag   => l_multiple_error_flag
4383                );
4384     set_extra_info(p_retention_allow_review.review_date,
4385                    l_pa_request_ei_rec.rei_information3,
4386                    p_retention_allow_review.retention_allow_review_flag, 'N');
4387     --
4388    end if;
4389   End retention_allow_review;
4390   --
4391   Procedure chg_in_tenure is
4392     l_proc  varchar2(70) := 'non_sf52_extra - chg_in_tenure';
4393   Begin
4394     hr_utility.set_location('Entering ' ||l_proc,5);
4395     IF l_session.noa_id_correct is not null THEN
4396       set_extra_info(p_per_group1.appointment_type,l_pa_request_ei_rec.rei_information3,p_per_group1.per_group1_flag);
4397     ELSE
4398       p_per_group1.appointment_type           :=   l_pa_request_ei_rec.rei_information3;
4399       p_per_group1.per_group1_flag            :=  'Y';
4400     END IF;
4401     hr_utility.set_location('Leaving ' ||p_per_group1.appointment_type ||l_proc,10);
4402   End chg_in_tenure;
4403   --
4404   -- 4352589 BEN_EIT Changes Assinging Eligibility Expires to Benefits EIT.
4405   Procedure chg_in_fegli  is
4406     l_proc  varchar2(70) := 'non_sf52_extra - chg_in_fegli';
4407   Begin
4408       hr_utility.set_location('Entering ' ||l_proc,5);
4409       --
4410       p_per_benefit_info.FEGLI_Date_Eligibility_Expires := l_pa_request_ei_rec.rei_information1;
4411       If p_per_benefit_info.FEGLI_Date_Eligibility_Expires is not null then
4412          p_per_benefit_info.per_benefit_info_flag := 'Y';
4413       End If;
4414     hr_utility.set_location('Leaving ' ||l_proc,10);
4415   End chg_in_fegli;
4416   --
4417 --Pradeep
4418 Procedure mddds_pay is
4419   l_proc                varchar2(72) := 'mddds_pay';
4420 
4421 Begin
4422 
4423   hr_utility.set_location('Entering ' ||l_proc,6);
4424 
4425   set_extra_info(p_mddds_special_pay.Full_Time_Status,
4426 	     l_pa_request_ei_rec.rei_information9,
4427 	     p_mddds_special_pay.mddds_special_pay_flag,
4428 	     'Y'  );
4429   set_extra_info(p_mddds_special_pay.Length_of_Service,
4430 	     l_pa_request_ei_rec.rei_information10,
4431 	     p_mddds_special_pay.mddds_special_pay_flag,
4432 	     'Y'  );
4433   set_extra_info(p_mddds_special_pay.Scarce_Specialty,
4434 	     l_pa_request_ei_rec.rei_information3,
4435 	     p_mddds_special_pay.mddds_special_pay_flag,
4436 	     'Y'  );
4437   set_extra_info(p_mddds_special_pay.Specialty_or_Board_Cert,
4438 	     l_pa_request_ei_rec.rei_information4,
4439 	     p_mddds_special_pay.mddds_special_pay_flag,
4440 	     'Y'  );
4441   set_extra_info(p_mddds_special_pay.Geographic_Location,
4442 	     l_pa_request_ei_rec.rei_information5,
4443 	     p_mddds_special_pay.mddds_special_pay_flag,
4444 	     'Y'  );
4445   set_extra_info(p_mddds_special_pay.Exceptional_Qualifications,
4446 	     l_pa_request_ei_rec.rei_information6,
4447 	     p_mddds_special_pay.mddds_special_pay_flag,
4448 	     'Y'  );
4449   set_extra_info(p_mddds_special_pay.Executive_Position,
4450 	     l_pa_request_ei_rec.rei_information7,
4451 	     p_mddds_special_pay.mddds_special_pay_flag,
4452 	     'Y'  );
4453   set_extra_info(p_mddds_special_pay.Dentist_Post_Graduate_Training,
4454 	     l_pa_request_ei_rec.rei_information8,
4455 	     p_mddds_special_pay.mddds_special_pay_flag,
4456 	     'Y'  );
4457   set_extra_info(p_mddds_special_pay.amount,
4458 	     l_pa_request_ei_rec.rei_information11,
4459 	     p_mddds_special_pay.mddds_special_pay_flag,
4460 	     'Y'  );
4461 
4462   set_extra_info(p_mddds_special_pay.mddds_special_pay_date,
4463 	     fnd_date.canonical_to_date(l_pa_request_ei_rec.rei_information12),
4464 	     p_mddds_special_pay.mddds_special_pay_flag,
4465 	     'Y'  );
4466   set_extra_info(p_mddds_special_pay.premium_pay_ind,
4467 	     l_pa_request_ei_rec.rei_information13,
4468 	     p_mddds_special_pay.mddds_special_pay_flag,
4469 	     'Y'  );
4470 
4471 End;
4472   ----Pradeep
4473 Procedure premium_pay_ind is
4474   l_proc                varchar2(72) := 'premium_pay_ind';
4475 
4476 Begin
4477 
4478   hr_utility.set_location('Entering ' ||l_proc,7);
4479 
4480 
4481   set_extra_info(p_premium_pay_ind.premium_pay_ind,
4482 	     l_pa_request_ei_rec.rei_information3,
4483 	     p_premium_pay_ind.premium_pay_ind_flag,
4484 	     'Y'  );
4485 
4486 End;
4487 
4488 -- Bug 4724337 Race or National Origin changes
4489 Procedure race_ethnic_info is
4490   l_proc   varchar2(72) := 'race_ethnic_info';
4491 
4492 Begin
4493 
4494   hr_utility.set_location('Entering ' ||l_proc,7);
4495 
4496   set_extra_info(p_race_ethnic_info.p_hispanic,l_pa_request_ei_rec.rei_information3,
4497    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4498   set_extra_info(p_race_ethnic_info.p_american_indian,l_pa_request_ei_rec.rei_information4,
4499    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4500   set_extra_info(p_race_ethnic_info.p_asian,l_pa_request_ei_rec.rei_information5,
4501    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4502   set_extra_info(p_race_ethnic_info.p_black_afr_american,l_pa_request_ei_rec.rei_information6,
4503    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4504   set_extra_info(p_race_ethnic_info.p_hawaiian_pacific,l_pa_request_ei_rec.rei_information7,
4505    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4506   set_extra_info(p_race_ethnic_info.p_white,l_pa_request_ei_rec.rei_information8,
4507    				 p_race_ethnic_info.p_race_ethnic_info_flag, 'Y'  );
4508 End;
4509 
4510 Procedure student_loan_repay is
4511   l_proc varchar2(80):= 'non_sf52_extra - student_loan_repay';
4512 
4513 begin
4514     hr_utility.set_location('Entering ' ||l_proc,5);
4515       --
4516       set_extra_info(p_student_loan_repay.p_amount,
4517 	     p_pa_request_rec.award_amount,
4518 	     p_student_loan_repay.p_student_loan_flag,
4519 	     'Y'  );
4520 
4521       set_extra_info(p_student_loan_repay.p_repay_schedule,
4522 	     l_pa_request_ei_rec.rei_information8,
4523 	     p_student_loan_repay.p_student_loan_flag,
4524 	     'Y'  );
4525 
4526       set_extra_info(p_student_loan_repay.p_review_date,
4527 	     l_pa_request_ei_rec.rei_information9,
4528 	     p_student_loan_repay.p_student_loan_flag,
4529 	     'Y'  );
4530 
4531       If p_student_loan_repay.p_review_date is not null then
4532          p_student_loan_repay.p_student_loan_flag := 'Y';
4533       End If;
4534 
4535 --   p_student_loan_repay.p_amount :=p_pa_request_rec.award_amount;
4536 --     p_student_loan_repay.p_repay_schedule  := l_pa_request_ei_rec.rei_information8;
4537 --      p_student_loan_repay.p_review_date     := l_pa_request_ei_rec.rei_information9;
4538 
4539     hr_utility.set_location('Leaving ' ||l_proc,10);
4540 end;
4541 
4542   -- Bug 4280026
4543   Procedure key_emergency_essntl is
4544      l_proc      varchar2(70) := 'non_sf52_extra - key_emergency_essntl';
4545   Begin
4546      hr_utility.set_location('Entering ' ||l_proc,5);
4547      set_extra_info(p_asg_non_sf52.key_emer_essential_empl,
4548                     l_pa_request_ei_rec.rei_information3,p_asg_non_sf52.asg_non_sf52_flag, 'Y');
4549      hr_utility.set_location('Leaving ' ||l_proc,10);
4550   End key_emergency_essntl;
4551 
4552   -- Bug 5482191
4553   Procedure ghr_conv_dates is
4554      l_proc      varchar2(70) := 'non_sf52_extra - ghr_conv_dates';
4555   Begin
4556      hr_utility.set_location('Entering ' ||l_proc,5);
4557      set_extra_info(p_per_conversions.date_conv_career_begins,
4558                       l_pa_request_ei_rec.rei_information3,p_per_conversions.per_conversions_flag,'Y');
4559      set_extra_info(p_per_conversions.date_conv_career_due,
4560                       l_pa_request_ei_rec.rei_information4,p_per_conversions.per_conversions_flag,'Y');
4561      set_extra_info(p_per_conversions.date_recmd_conv_begins,
4562                       l_pa_request_ei_rec.rei_information5,p_per_conversions.per_conversions_flag,'Y');
4563      set_extra_info(p_per_conversions.date_recmd_conv_due,
4564                       l_pa_request_ei_rec.rei_information7,p_per_conversions.per_conversions_flag,'Y');
4565      set_extra_info(p_per_conversions.date_vra_conv_due,
4566                       l_pa_request_ei_rec.rei_information6,p_per_conversions.per_conversions_flag,'Y');
4567      hr_utility.set_location('Leaving ' ||l_proc,10);
4568   End ghr_conv_dates;
4569 
4570 
4571 -- Start of Bug 6312144 -- New IPA Benefits Continuation EIT
4572   Procedure ipa_benefits_cont is
4573      l_proc      varchar2(70) := 'non_sf52_extra - ipa_benefits_cont';
4574   Begin
4575      hr_utility.set_location('Entering ' ||l_proc,5);
4576      set_extra_info(p_ipa_benefits_cont.FEGLI_Indicator,
4577                       l_pa_request_ei_rec.rei_information1,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4578      set_extra_info(p_ipa_benefits_cont.FEGLI_Election_Date,
4579                       l_pa_request_ei_rec.rei_information2,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4580      set_extra_info(p_ipa_benefits_cont.FEGLI_Elec_Not_Date,
4581                       l_pa_request_ei_rec.rei_information3,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4582      set_extra_info(p_ipa_benefits_cont.FEHB_Indicator,
4583                       l_pa_request_ei_rec.rei_information4,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4584      set_extra_info(p_ipa_benefits_cont.FEHB_Election_Date,
4585                       l_pa_request_ei_rec.rei_information5,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4586      set_extra_info(p_ipa_benefits_cont.FEHB_Elec_Notf_Date,
4587                       l_pa_request_ei_rec.rei_information6,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4588      set_extra_info(p_ipa_benefits_cont.retirement_Indicator,
4589                       l_pa_request_ei_rec.rei_information7,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4590      set_extra_info(p_ipa_benefits_cont.retirement_Elec_Date,
4591                       l_pa_request_ei_rec.rei_information12,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4592      set_extra_info(p_ipa_benefits_cont.retirement_Elec_Notf_Date,
4593                       l_pa_request_ei_rec.rei_information8,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4594      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Elec_Date,
4595                       l_pa_request_ei_rec.rei_information9,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4596      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pay_Notf_Date,
4597                       l_pa_request_ei_rec.rei_information10,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4598      set_extra_info(p_ipa_benefits_cont.Cont_Term_Insuff_Pmt_Type_Code,
4599                       l_pa_request_ei_rec.rei_information11,p_ipa_benefits_cont.per_ben_cont_info_flag,'Y');
4600      hr_utility.set_location('Leaving ' ||l_proc,10);
4601   End ipa_benefits_cont;
4602 
4603 
4604  -- Bug 6312144 -- New Federal Benefits Info EIT
4605   Procedure ben_info_cont is
4606      l_proc      varchar2(70) := 'non_sf52_extra - Federal Benefit Info';
4607   Begin
4608      hr_utility.set_location('Entering ' ||l_proc,5);
4609      set_extra_info(p_per_benefit_info.FEGLI_Assignment_Ind,
4610                       l_pa_request_ei_rec.rei_information1,p_per_benefit_info.per_benefit_info_flag,'Y');
4611      set_extra_info(p_per_benefit_info.FEGLI_Post_Elec_Basic_Ins_Amt,
4612                       l_pa_request_ei_rec.rei_information2,p_per_benefit_info.per_benefit_info_flag,'Y');
4613      set_extra_info(p_per_benefit_info.FEGLI_Court_Order_Ind,
4614                       l_pa_request_ei_rec.rei_information3,p_per_benefit_info.per_benefit_info_flag,'Y');
4615      set_extra_info(p_per_benefit_info.Desg_FEGLI_Benf_Ind,
4616                       l_pa_request_ei_rec.rei_information4,p_per_benefit_info.per_benefit_info_flag,'Y');
4617      set_extra_info(p_per_benefit_info.FEHB_Event_Code,
4618                       l_pa_request_ei_rec.rei_information5,p_per_benefit_info.per_benefit_info_flag,'Y');
4619      hr_utility.set_location('Leaving ' ||l_proc,10);
4620   End ben_info_cont;
4621 
4622   -- Bug 6312144 -- Retirement system information
4623   Procedure retirement_info is
4624      l_proc      varchar2(70) := 'non_sf52_extra - Retirement System Info';
4625   Begin
4626      hr_utility.set_location('Entering ' ||l_proc,5);
4627      set_extra_info(p_retirement_info.special_population_code,
4628                       l_pa_request_ei_rec.rei_information1,p_retirement_info.per_retirement_info_flag,'Y');
4629      set_extra_info(p_retirement_info.App_Exc_CSRS_Ind,
4630                       l_pa_request_ei_rec.rei_information2,p_retirement_info.per_retirement_info_flag,'Y');
4631      set_extra_info(p_retirement_info.App_Exc_FERS_Ind,
4632                       l_pa_request_ei_rec.rei_information3,p_retirement_info.per_retirement_info_flag,'Y');
4633      set_extra_info(p_retirement_info.FICA_Coverage_Ind1,
4634                       l_pa_request_ei_rec.rei_information4,p_retirement_info.per_retirement_info_flag,'Y');
4635      set_extra_info(p_retirement_info.FICA_Coverage_Ind2,
4636                       l_pa_request_ei_rec.rei_information5,p_retirement_info.per_retirement_info_flag,'Y');
4637      hr_utility.set_location('Leaving ' ||l_proc,10);
4638   End retirement_info;
4639    /* --Begin Bug# 4588575
4640     Procedure ghr_prob_info is
4641     l_proc      varchar2(70) := 'non_sf52_extra - ghr_prob_info';
4642     Begin
4643         hr_utility.set_location('Entering ' ||l_proc,55);
4644         set_extra_info(p_per_probations.date_prob_trial_period_begin ,
4645                        l_pa_request_ei_rec.rei_information10,p_per_probations.per_probation_flag);
4646         set_extra_info(p_per_probations.date_prob_trial_period_ends  ,
4647                        l_pa_request_ei_rec.rei_information11,p_per_probations.per_probation_flag);
4648         set_extra_info(p_per_probations.date_spvr_mgr_prob_begins  ,
4649                        l_pa_request_ei_rec.rei_information12,p_per_probations.per_probation_flag);
4650         set_extra_info(p_per_probations.date_spvr_mgr_prob_ends  ,
4651                        l_pa_request_ei_rec.rei_information13,p_per_probations.per_probation_flag);
4652         set_extra_info(p_per_probations.spvr_mgr_prob_completion  ,
4653                        l_pa_request_ei_rec.rei_information14,p_per_probations.per_probation_flag);
4654         set_extra_info(p_per_probations.date_ses_prob_expires ,
4655                        l_pa_request_ei_rec.rei_information15,p_per_probations.per_probation_flag);
4656          hr_utility.set_location('Leaving ' ||l_proc,56);
4657     End ghr_prob_info;
4658 
4659     PROCEDURE chg_scd_info is
4660         l_proc   varchar2(70)  := 'non_sf52_extra - chg_scd_info';
4661     Begin
4662         hr_utility.set_location('Entering ' ||l_proc,6);
4663         set_extra_info(p_per_scd_info.scd_civilian,l_pa_request_ei_rec.rei_information10,
4664                 p_per_scd_info.per_scd_info_flag, 'Y');
4665         set_extra_info(p_per_scd_info.scd_rif,l_pa_request_ei_rec.rei_information11,
4666                 p_per_scd_info.per_scd_info_flag, 'Y');
4667         set_extra_info(p_per_scd_info.scd_retirement,l_pa_request_ei_rec.rei_information12,
4668                 p_per_scd_info.per_scd_info_flag, 'Y');
4669         set_extra_info(p_per_scd_info.scd_ses,l_pa_request_ei_rec.rei_information13,
4670                 p_per_scd_info.per_scd_info_flag, 'Y');
4671         set_extra_info(p_per_scd_info.scd_spl_retirement,l_pa_request_ei_rec.rei_information14,
4672                 p_per_scd_info.per_scd_info_flag, 'Y');
4673         hr_utility.set_location('Leaving  ' ||l_proc,60);
4674     End chg_scd_info;
4675     --end Bug# 4588575
4676     */ --Backout the changes done for Bug# 4588575
4677 Begin
4678 
4679   -- Get session variables  to identify if a CORRECTION action is being performed
4680   ghr_history_api.get_g_session_var(l_session);
4681   --
4682 
4683   --  l_pos_org                    := p_pos_grp1.positions_organization;
4684   -- Get Element Entry Values in case of 'CORRECTION' -- only those elements that come off an extra_info
4685 
4686   If l_session.noa_id_correct is not null then
4687     ghr_history_fetch.fetch_element_entry_value
4688     (p_element_name          =>  'Within Grade Increase',
4689      p_input_value_name      =>  'Date Due',
4690      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4691      p_date_effective        =>  p_pa_request_rec.effective_date,
4692      p_screen_entry_value    =>  p_within_grade_increase.p_date_wgi_due
4693      );
4694     ghr_history_fetch.fetch_element_entry_value
4695     (p_element_name          =>  'Within Grade Increase',
4696      p_input_value_name      =>  'Pay Date',
4697      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4698      p_date_effective        =>  p_pa_request_rec.effective_date,
4699      p_screen_entry_value    =>  p_within_grade_increase.p_wgi_pay_date
4700      );
4701     ghr_history_fetch.fetch_element_entry_value
4702     (p_element_name          =>  'Within Grade Increase',
4703      p_input_value_name      =>  'Postponmt Effective',
4704      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4705      p_date_effective        =>  p_pa_request_rec.effective_date,
4706      p_screen_entry_value    =>  p_within_grade_increase.p_date_wgi_postpone_effective
4707      );
4708     ghr_history_fetch.fetch_element_entry_value
4709     (p_element_name          =>  'Within Grade Increase',
4710      p_input_value_name      =>  'Last Equivalent Increase',
4711      p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4712      p_date_effective        =>  p_pa_request_rec.effective_date,
4713      p_screen_entry_value    =>  p_within_grade_increase.p_last_equi_incr
4714      );
4715     -- The foll. if conditions ensure that we fetch the elements only
4716     -- on correction to a noa relevant to the specific  elements
4717     If p_pa_request_rec.first_noa_code = '816' then
4718       ghr_history_fetch.fetch_element_entry_value
4719       (p_element_name         =>  'Relocation Bonus',
4720       p_input_value_name      =>  'Expiration Date',
4721       p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4722       p_date_effective        =>  p_pa_request_rec.effective_date,
4723       p_screen_entry_value    =>  p_relocation_bonus.p_date_reloc_exp
4724       );
4725     End if;
4726     If p_pa_request_rec.first_noa_code  = '815' then
4727       ghr_history_fetch.fetch_element_entry_value
4728       (p_element_name         =>  'Recruitment Bonus',
4729       p_input_value_name      =>  'Expiration Date',
4730       p_assignment_id         =>  p_pa_request_rec.employee_assignment_id,
4731       p_date_effective        =>  p_pa_request_rec.effective_date,
4732       p_screen_entry_value    =>  p_recruitment_bonus.p_date_recruit_exp
4733       );
4734     End if;
4735   End if;
4736 
4737  -- Bug 3260890
4738 
4739   For info_type in c_info_types loop
4740      l_information_type := info_type.information_type;
4741      hr_utility.set_location('l_information_type :' || l_information_type,1);
4742      l_pa_request_ei_rec := null;
4743      FOR pa_request_extra_info IN c_pa_request_extra_info LOOP
4744         l_pa_request_ei_rec := pa_request_extra_info;
4745      END LOOP;
4746 
4747      hr_utility.set_location('rei 3 ' || l_pa_request_ei_rec.rei_information3,1);
4748      hr_utility.set_location('rei 4 ' || l_pa_request_ei_rec.rei_information4,1);
4749      hr_utility.set_location('rei 5 ' || l_pa_request_ei_rec.rei_information5,1);
4750      hr_utility.set_location('rei 6 ' || l_pa_request_ei_rec.rei_information6,1);
4751      hr_utility.set_location('rei 7 ' || l_pa_request_ei_rec.rei_information7,1);
4752      hr_utility.set_location('rei 8 ' || l_pa_request_ei_rec.rei_information8,1);
4753      hr_utility.set_location('rei 9 ' || l_pa_request_ei_rec.rei_information9,1);
4754      hr_utility.set_location('rei 11 ' || l_pa_request_ei_rec.rei_information11,1);
4755 
4756      --
4757      if l_information_type = 'GHR_US_PAR_APPT_INFO' then
4758         hr_utility.set_location(l_proc,5);
4759         hr_utility.set_location('info type ' || l_information_type,1);
4760         appt_info;
4761      elsif l_information_type =  'GHR_US_PAR_APPT_TRANSFER' then
4762         hr_utility.set_location(l_proc,10);
4763         hr_utility.set_location('info type ' || l_information_type,2);
4764         appt_transfer;
4765      elsif l_information_type =  'GHR_US_PAR_CONV_APP' then
4766         hr_utility.set_location(l_proc,15);
4767         hr_utility.set_location('info type ' || l_information_type,3);
4768         conv_appt;
4769      elsif l_information_type = 'GHR_US_PAR_RETURN_TO_DUTY' then
4770         hr_utility.set_location(l_proc,20);
4771         hr_utility.set_location('info type ' || l_information_type,4);
4772         return_to_duty;
4773      elsif l_information_type = 'GHR_US_PAR_REASSIGNMENT' then
4774         hr_utility.set_location(l_proc,25);
4775         hr_utility.set_location('info type ' || l_information_type,5);
4776         reassign;
4777      elsif l_information_type = 'GHR_US_PAR_POSN_CHG' then
4778         hr_utility.set_location(l_proc,30);
4779         hr_utility.set_location('info type ' || l_information_type,6);
4780         posn_chg;
4781      elsif l_information_type = 'GHR_US_PAR_CHG_HOURS' then
4782         hr_utility.set_location(l_proc,35);
4783         hr_utility.set_location('info type ' || l_information_type,7);
4784         chg_sched_hours;
4785      elsif l_information_type = 'GHR_US_PAR_REALIGNMENT' then
4786         hr_utility.set_location(l_proc,40);
4787         hr_utility.set_location('info type ' || l_information_type,8);
4788         realign;
4789      elsif l_information_type =  'GHR_US_PAR_CHG_DATA_ELEMENT' then
4790         hr_utility.set_location(l_proc,45);
4791         hr_utility.set_location('info type ' || l_information_type,9);
4792         chg_data_elm;
4793      elsif  l_information_type =  'GHR_US_PAR_CHG_RETIRE_PLAN' then
4794         hr_utility.set_location(l_proc,50);
4795         hr_utility.set_location('info type ' || l_information_type,10);
4796         chg_ret_plan;
4797      elsif  l_information_type =  'GHR_US_PAR_CHG_SCD' then
4798         hr_utility.set_location(l_proc,55);
4799         hr_utility.set_location('info type ' || l_information_type,11);
4800         chg_scd;
4801 /* Bug # 1165309
4802      elsif  l_information_type =  'GHR_US_PAR_DENIAL_WGI' then
4803         hr_utility.set_location(l_proc,60);
4804         hr_utility.set_location('info type ' || l_information_type,12);
4805         denial_wgi;
4806 */
4807      elsif  l_information_type =  'GHR_US_PAR_SALARY_CHG' then
4808         hr_utility.set_location(l_proc,65);
4809         hr_utility.set_location('info type ' || l_information_type,13);
4810         salary_change;
4811      elsif  l_information_type =  'GHR_US_PAR_RECRUIT_BONUS' then
4812         hr_utility.set_location(l_proc,70);
4813         hr_utility.set_location('info type ' || l_information_type,14);
4814         recruitment_bonus;
4815      elsif  l_information_type =  'GHR_US_PAR_RELOC_BONUS' then
4816         hr_utility.set_location(l_proc,75);
4817         hr_utility.set_location('info type ' || l_information_type,15);
4818         relocation_bonus;
4819      elsif  l_information_type =  'GHR_US_PAR_AWARDS_BONUS' then
4820         hr_utility.set_location(l_proc,80);
4821         hr_utility.set_location('info type ' || l_information_type,16);
4822         government_awards;
4823      elsif  l_information_type =  'GHR_US_PAR_NON_PAY_DUTY_STATUS' then
4824         hr_utility.set_location(l_proc,85);
4825         hr_utility.set_location('info type ' || l_information_type,17);
4826         non_pay_duty_status;
4827      elsif  l_information_type =  'GHR_US_PAR_TERM_RET_GRADE' then
4828         hr_utility.set_location(l_proc,90);
4829         hr_utility.set_location('info type ' || l_information_type,18);
4830         term_retained_grade;
4831      elsif  l_information_type =  'GHR_US_PAR_QSI_AWARD' then
4832         hr_utility.set_location(l_proc,95);
4833         hr_utility.set_location('info type ' || l_information_type,19);
4834         quality_step_increase;
4835      elsif  l_information_type =  'GHR_US_PAR_LWOP_INFO' then
4836         hr_utility.set_location(l_proc,100);
4837         hr_utility.set_location('info type ' || l_information_type,20);
4838         lwop_info;
4839      elsif  l_information_type =  'GHR_US_PAR_ENTITLEMENT' then
4840         hr_utility.set_location(l_proc,105);
4841         hr_utility.set_location('info type ' || l_information_type,21);
4842         entitlement;
4843      elsif  l_information_type =  'GHR_US_PAR_FOR_LANG_PROF_PAY' then
4844         hr_utility.set_location(l_proc,110);
4845         hr_utility.set_location('info type ' || l_information_type,22);
4846         for_lang_pay;
4847      elsif  l_information_type =  'GHR_US_PAR_EDP_PAY' then
4848         hr_utility.set_location(l_proc,115);
4849         hr_utility.set_location('info type ' || l_information_type,23);
4850         edp_pay;
4851      elsif  l_information_type =  'GHR_US_PAR_HAZARD_PAY' then
4852         hr_utility.set_location(l_proc,116);
4853         hr_utility.set_location('info type ' || l_information_type,24);
4854         hazard_pay;
4855 /* Commented Out as as all future benefits enrollments are either
4856  through the Benefits PUI or FEHB module
4857      elsif  l_information_type =  'GHR_US_PAR_HEALTH_BENEFITS' then
4858         hr_utility.set_location(l_proc,120);
4859         hr_utility.set_location('info type ' || l_information_type,25);
4860         health_benefits;
4861      elsif  l_information_type =  'GHR_US_PAR_HEALTH_BEN_PRE_TAX' then
4862         hr_utility.set_location(l_proc,121);
4863         hr_utility.set_location('info type ' || l_information_type,25);
4864         health_ben_pre_tax;
4865 */
4866      elsif  l_information_type =  'GHR_US_PAR_DANGER_PAY' then
4867         hr_utility.set_location(l_proc,125);
4868         hr_utility.set_location('info type ' || l_information_type,26);
4869         danger_pay;
4870      elsif  l_information_type =  'GHR_US_PAR_IMMNT_DANGER_PAY' then
4871         hr_utility.set_location(l_proc,130);
4872         hr_utility.set_location('info type ' || l_information_type,27);
4873         imminent_danger_pay;
4874      elsif  l_information_type =  'GHR_US_PAR_LIVING_QUART_ALLOW' then
4875         hr_utility.set_location(l_proc,135);
4876         hr_utility.set_location('info type ' || l_information_type,28);
4877         living_quarters_allow;
4878      elsif  l_information_type =  'GHR_US_PAR_POST_DIFF_PERCENT' then
4879         hr_utility.set_location(l_proc,140);
4880         hr_utility.set_location('info type ' || l_information_type,29);
4881         post_diff_percent;
4882      elsif  l_information_type =  'GHR_US_PAR_POST_DIFF_AMOUNT' then
4883         hr_utility.set_location(l_proc,145);
4884         hr_utility.set_location('info type ' || l_information_type,30);
4885         post_diff_amt;
4886      elsif  l_information_type =  'GHR_US_PAR_SEP_MAINT_ALLOWANCE' then
4887         hr_utility.set_location(l_proc,150);
4888         hr_utility.set_location('info type ' || l_information_type,31);
4889         sep_maintenance_allow;
4890      elsif  l_information_type =  'GHR_US_PAR_SUP_POST_ALLOWANCE' then
4891         hr_utility.set_location(l_proc,155);
4892         hr_utility.set_location('info type ' || l_information_type,32);
4893         supplemental_post_allow;
4894      elsif  l_information_type =  'GHR_US_PAR_TMP_LODGE_ALLOWANCE' then
4895         hr_utility.set_location(l_proc,160);
4896         hr_utility.set_location('info type ' || l_information_type,33);
4897         temp_lodge_allow;
4898      elsif  l_information_type =  'GHR_US_PAR_PREMIUM_PAY' then
4899         hr_utility.set_location(l_proc,165);
4900         hr_utility.set_location('info type ' || l_information_type,34);
4901         premium_pay;
4902      elsif  l_information_type =  'GHR_US_PAR_RETIREMENT_ANNUITY' then
4903         hr_utility.set_location(l_proc,170);
4904         hr_utility.set_location('info type ' || l_information_type,35);
4905         retirement_annuity;
4906      elsif  l_information_type =  'GHR_US_PAR_SEVERANCE_PAY' then
4907         hr_utility.set_location(l_proc,175);
4908         hr_utility.set_location('info type ' || l_information_type,36);
4909         severance_pay;
4910      /*elsif  l_information_type =  'GHR_US_PAR_TSP' then
4911         hr_utility.set_location(l_proc,180);
4912         hr_utility.set_location('info type ' || l_information_type,37);
4913         thrift_saving_plan;*/
4914      elsif  l_information_type =  'GHR_US_PAR_RET_ALLOWANCE' then
4915         hr_utility.set_location(l_proc,180);
4916         hr_utility.set_location('info type ' || l_information_type,37);
4917         retention_allow_review;
4918       elsif  l_information_type = 'GHR_US_PAR_CHG_TEN' then
4919         hr_utility.set_location(l_proc,110);
4920         chg_in_tenure;
4921       --Bug#2759379  Added FEGLI related Code
4922       elsif  l_information_type = 'GHR_US_PAR_FEGLI' then
4923         hr_utility.set_location(l_proc,110);
4924         chg_in_fegli;
4925       elsif l_information_type = 'GHR_US_PAR_MD_DDS_PAY' then
4926          hr_utility.set_location(l_proc,200);
4927          mddds_pay;
4928       elsif l_information_type = 'GHR_US_PAR_PREMIUM_PAY_IND' then
4929          hr_utility.set_location(l_proc,200);
4930          premium_pay_ind;
4931       elsif l_information_type = 'GHR_US_PAR_STUDENT_LOAN' then
4932         hr_utility.set_location(l_proc,190);
4933         student_loan_repay;
4934       -- Bug#3385386 Added FTA condition.
4935       elsif  l_information_type =  'GHR_US_PAR_FOR_TRANSER_ALLOW' then
4936         hr_utility.set_location(l_proc,210);
4937         hr_utility.set_location('info type ' || l_information_type,22);
4938         fta;
4939 	  elsif l_information_type = 'GHR_US_PAR_BENEFITS'   then
4940 	    hr_utility.set_location(l_proc,210);
4941 		hr_utility.set_location('info type ' || l_information_type,22);
4942 		appt_benefits;
4943 	  elsif l_information_type = 'GHR_US_PAR_MASS_TERM' then
4944 	    hr_utility.set_location(l_proc,210);
4945 		hr_utility.set_location('info type ' || l_information_type,22);
4946 		separate352;
4947 	  -- Bug 4724337 Race or National Origin changes
4948 	  elsif l_information_type = 'GHR_US_PAR_ETHNICITY_RACE' then
4949 	  	hr_utility.set_location(l_proc,210);
4950 		hr_utility.set_location('info type ' || l_information_type,22);
4951 		race_ethnic_info;
4952       -- Bug 4486823 RRR Changes
4953 	  elsif l_information_type = 'GHR_US_PAR_SERVICE_OBLIGATION' then
4954 	  	hr_utility.set_location(l_proc,220);
4955 		hr_utility.set_location('info type ' || l_information_type,22);
4956 		service_obligation;
4957         -- Bug 4724337 Race or National Origin changes
4958 	  elsif l_information_type = 'GHR_US_PAR_RETENTION_INCENTIVE' then
4959 	  	hr_utility.set_location(l_proc,230);
4960 		hr_utility.set_location('info type ' || l_information_type,22);
4961 		incentive_retention;
4962         -- Bug 4486823 RRR Changes
4963       elsif l_information_type = 'GHR_US_PAR_EMERG_ESSNTL_ASG' then
4964         hr_utility.set_location(l_proc,240);
4965         hr_utility.set_location('info type ' || l_information_type,22);
4966         key_emergency_essntl;
4967       -- Bug 4280026 Key Emergency Essential Changes .
4968 	  -- Begin Bug# 4126188
4969 	  elsif l_information_type = 'GHR_US_PAR_TERM_RG_POSN_CHG' then
4970         hr_utility.set_location(l_proc,250);
4971         hr_utility.set_location('info type ' || l_information_type,22);
4972         rg_posn_chg;
4973 	  -- end Bug# 4126188
4974       elsif l_information_type = 'GHR_US_PAR_CONVERSION_DATES' then
4975         hr_utility.set_location(l_proc,260);
4976         hr_utility.set_location('info type ' || l_information_type,22);
4977         ghr_conv_dates;
4978         -- Bug 5482191
4979        --start of Bug# 6312144
4980       elsif l_information_type = 'GHR_US_PAR_BENEFITS_CONT' then
4981          hr_utility.set_location(l_proc,270);
4982          hr_utility.set_location('info type ' || l_information_type,22);
4983          ipa_benefits_cont;
4984       elsif l_information_type = 'GHR_US_PAR_BENEFIT_INFO' then
4985          hr_utility.set_location(l_proc,280);
4986          hr_utility.set_location('info type ' || l_information_type,22);
4987          ben_info_cont;
4988       elsif l_information_type = 'GHR_US_PAR_RETIRMENT_SYS_INFO' then
4989          hr_utility.set_location(l_proc,290);
4990          hr_utility.set_location('info type ' || l_information_type,22);
4991          retirement_info;
4992          --end of Bug# 6312144
4993       /*   --Begin Bug# 4588575
4994       elsif l_information_type = 'GHR_US_PAR_PROBATION_INFO' then
4995          hr_utility.set_location(l_proc,270);
4996          hr_utility.set_location('info type ' || l_information_type,270);
4997          ghr_prob_info;
4998       elsif l_information_type = 'GHR_US_PAR_SCD_INFO' then
4999          hr_utility.set_location(l_proc,280);
5000          hr_utility.set_location('info type ' || l_information_type,280);
5001          chg_scd_info;
5002          --end Bug# 4588575
5003       */ --Backout the changes done for Bug# 4588575
5004       end if;
5005   End loop;     -- info types
5006 
5007 
5008     -- Bug#5668878 Begin
5009     IF p_pa_request_rec.first_noa_code = '892' THEN
5010 
5011         l_psi := ghr_pa_requests_pkg.get_personnel_system_indicator
5012                  (p_pa_request_rec.to_position_id,
5013                   p_pa_request_rec.effective_date);
5014 
5015          IF l_psi <> '00' THEN
5016             p_within_grade_increase.p_last_equi_incr := p_pa_request_rec.effective_date;
5017             p_within_grade_increase.p_date_wgi_due := NULL;
5018             p_within_grade_increase.p_wgi_pay_date := NULL;
5019             p_within_grade_increase.p_wgi_flag       := 'Y';
5020         END IF;
5021 
5022     END IF;
5023     -- Bug#5668878 End
5024   -- Rohini
5025   l_noa_code := p_pa_request_rec.first_noa_code;
5026  /* if l_noa_code = '352' then
5027    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
5028                             p_per_separate_retire.agency_code_transfer_to ,38);
5029      set_extra_info(p_per_separate_retire.agency_code_transfer_to,
5030                     l_pa_request_ei_rec.rei_information3,
5031 ------ AVR          p_pa_request_rec.first_noa_information1,
5032                     p_per_separate_Retire.per_sep_Retire_flag);
5033    hr_utility.set_location('p_per_separate_retire.agency_code_transfer_to = ' ||
5034                             p_per_separate_retire.agency_code_transfer_to ,38);
5035   End if; */
5036   --
5037   --  Process Generic Agency information
5038   --
5039   -- Updating the record groups with Agency Info
5040 
5041   p_agency_sf52.agency_use_block_25  := p_generic_ei_rec.rei_information3;
5042   p_agency_sf52.agency_data_block_40 := p_generic_ei_rec.rei_information4;
5043   p_agency_sf52.agency_data_block_41 := p_generic_ei_rec.rei_information5;
5044   p_agency_sf52.agency_data_block_42 := p_generic_ei_rec.rei_information6;
5045   p_agency_sf52.agency_data_block_43 := p_generic_ei_rec.rei_information7;
5046   p_agency_sf52.agency_data_block_44 := p_generic_ei_rec.rei_information8;
5047   -- Set Flag to 'Y'
5048   p_agency_sf52.agency_flag := 'Y';
5049   --
5050   -- Bug# 4672772 Begin
5051 	for asg_stat_rec in c_user_status loop
5052 	  l_old_user_status				:= asg_stat_rec.user_status;
5053 	  l_old_system_status			:= asg_stat_rec.per_system_status;
5054 	  l_old_effective_start_date	:= asg_stat_rec.effective_start_date -1;
5055 	  hr_utility.set_location('Old User status is '||l_old_user_status,96);
5056 	  exit;
5057     end loop;
5058 	-- Bug# 4672772 End
5059 
5060   hr_utility.set_location('Leaving  - process_non_sf52_extra_info',170);
5061 
5062   -- NTE start dates processing
5063   -- Added 515 -- Venkat 04/26
5064   If l_noa_code in ('108','115','117','122','148','149','153',
5065                     '154','171','190','508','515','517','522','548',
5066                     '549','553','554','571','590','741') then
5067     --Bug# 4602352 703 is removed from the list
5068     p_asg_nte_dates.asg_nte_start_date      := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5069     hr_utility.set_location('inside asg nte dates ',1);
5070     hr_utility.set_location('nte date ' || (p_asg_nte_dates.asg_nte_start_date),2);
5071     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5072   --Begin Bug# 4602352
5073   Elsif  l_noa_code ='703' and (l_old_user_status <> 'Term Limited Appt') THEN
5074     p_asg_nte_dates.asg_nte_start_date      := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5075     hr_utility.set_location('inside asg nte dates for 703 ',111);
5076     hr_utility.set_location('nte date ' || (p_asg_nte_dates.asg_nte_start_date),2);
5077     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5078   --End Bug# 4602352
5079   Elsif l_noa_code = '472' then
5080     p_asg_nte_dates.furlough_nte_start_date := fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5081     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5082   Elsif l_noa_code = '462' then
5083     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5084     p_asg_nte_dates.lwp_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5085   Elsif l_noa_code = '460' then
5086    p_asg_nte_dates.lwop_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5087     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5088   Elsif l_noa_code = '480' then
5089     p_asg_nte_dates.sabatical_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5090     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5091   Elsif l_noa_code = '450' then
5092     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5093     p_asg_nte_dates.suspension_nte_start_date :=  fnd_date.date_to_canonical(p_pa_request_rec.effective_date);
5094   End if;
5095 
5096 
5097   -- NTE dates processing
5098 
5099   If  l_noa_code in ('108','115','117','122','148','149','153',
5100                      '154','171','190','508','515','517','522',
5101                      '548','549','553','554','571','590',--'703', Removed for Bug# 4602352
5102                      '741','750','760','761','762','765','769','770') then
5103     p_asg_nte_dates.assignment_nte       :=   p_pa_request_rec.first_noa_information1;
5104     hr_utility.set_location('dates ' || p_asg_nte_dates.assignment_nte,1);
5105     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5106   --Begin Bug# 4602352
5107   Elsif  l_noa_code ='703' and (l_old_user_status <> 'Term Limited Appt') THEN
5108     p_asg_nte_dates.assignment_nte       :=   p_pa_request_rec.first_noa_information1;
5109     hr_utility.set_location('dates ' || p_asg_nte_dates.assignment_nte,100);
5110     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5111   --End Bug# 4602352
5112   Elsif l_noa_code in ('472','772') then
5113     hr_utility.set_location(' furlough nte dates for 472 and 772',1);
5114     p_asg_nte_dates.furlough_nte         :=   p_pa_request_rec.first_noa_information1;
5115     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5116   Elsif l_noa_code  = '462' then
5117     p_asg_nte_dates.lwp_nte              :=   p_pa_request_rec.first_noa_information1;
5118     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5119   Elsif l_noa_code  in ('460','773') then
5120     p_asg_nte_dates.lwop_nte             :=   p_pa_request_rec.first_noa_information1;
5121     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5122   Elsif l_noa_code  = '480' then
5123     p_asg_nte_dates.sabatical_nte        :=   p_pa_request_rec.first_noa_information1;
5124     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5125   Elsif l_noa_code  = '450' then
5126     p_asg_nte_dates.suspension_nte       :=   p_pa_request_rec.first_noa_information1;
5127     p_asg_nte_dates.asg_nte_dates_flag := 'Y';
5128   End if;
5129 
5130   --
5131   -- Processing for clearing of NTE dates\
5132   -- Bug 2941621 Included 280 and also furlough dates in the condition
5133 
5134 
5135 
5136   if (l_noa_code IN ('293','280')) then
5137 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5138 	p_asg_nte_dates.lwp_nte 					:= null;
5139 	p_asg_nte_dates.lwp_nte_start_date 			:= null;
5140 	p_asg_nte_dates.suspension_nte 				:= null;
5141 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5142 	p_asg_nte_dates.furlough_nte	 			:= null;
5143 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5144   elsif (l_noa_code = '292') then
5145 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5146 	p_asg_nte_dates.lwop_nte 					:= null;
5147 	p_asg_nte_dates.lwop_nte_start_date			:= null;
5148 	p_asg_nte_dates.suspension_nte 				:= null;
5149 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5150 	p_asg_nte_dates.furlough_nte	 			:= null;
5151 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5152   elsif (l_noa_code = '452') then
5153 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5154 	p_asg_nte_dates.suspension_nte 			:= null;
5155 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5156   elsif (l_noa_code in ('500','501','507','512','520','524','540',
5157                         '541','542','543','546','549','550','551',
5158                         '555','570')) then
5159      -- Removed 721 from the list for bug# 3215526
5160      -- Removed '702','713','740' from the list 3698464
5161      --
5162 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5163 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5164 	p_asg_nte_dates.assignment_nte		 	:= null;
5165 
5166   -- Bug# 4672772 Begin
5167   elsif l_noa_code in ('702','713') AND (l_old_user_status = 'Temp. Promotion NTE') THEN
5168         FOR user_apnt_status_rec IN c_user_apnt_status
5169         LOOP
5170             l_user_apnt_status := user_apnt_status_rec.user_status;
5171             l_user_apnt_eff_date := user_apnt_status_rec.effective_start_date;
5172             EXIT;
5173         END LOOP;
5174         --Begin Bug#6083404
5175         FOR user_actv_appt_rec IN c_user_actv_appt
5176         LOOP
5177             l_user_actv_apnt_status := user_actv_appt_rec.user_status;
5178             EXIT;
5179         END LOOP;
5180         --End Bug# 6083404
5181         IF l_user_apnt_status = 'Temp. Appointment NTE'
5182             and nvl(l_user_actv_apnt_status,'XXX') <>'Active Appointment' THEN
5183         --Bug# 6083404 added l_user_actv_apnt_status condition
5184             ghr_history_fetch.fetch_asgei
5185                       (p_assignment_id              =>  p_pa_request_rec.employee_assignment_id,
5186                        p_information_type           => 'GHR_US_ASG_NTE_DATES',
5187                        p_date_effective             =>  l_user_apnt_eff_date,
5188                        p_asg_ei_data                =>  l_asg_extra_info_rec
5189                       );
5190             p_asg_nte_dates.asg_nte_dates_flag 		:= 'Y';
5191             p_asg_nte_dates.asg_nte_start_date 		:= l_asg_extra_info_rec.aei_information3;
5192             p_asg_nte_dates.assignment_nte		 	:= l_asg_extra_info_rec.aei_information4;
5193         ELSE
5194             p_asg_nte_dates.asg_nte_dates_flag 		:= 'Y';
5195             p_asg_nte_dates.asg_nte_start_date 		:= null;
5196             p_asg_nte_dates.assignment_nte		 	:= null;
5197         END IF;
5198 	-- Bug# 4672772 End
5199   --Begin Bug# 4602352
5200   elsif l_noa_code in ('702','713','740') AND (l_old_user_status = 'Temp. Appointment NTE') THEN
5201     p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5202 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5203 	p_asg_nte_dates.assignment_nte		 	    := null;
5204   --End Bug# 4602352
5205   elsif (l_noa_code in ('300','301','302','303','304','312','317',
5206                         '330','350','351','353','355','356','357','385')) then
5207 	p_asg_nte_dates.asg_nte_dates_flag 			:= 'Y';
5208 	p_asg_nte_dates.asg_nte_start_date 			:= null;
5209 	p_asg_nte_dates.assignment_nte		 	:= null;
5210 	p_asg_nte_dates.lwop_nte 				:= null;
5211 	p_asg_nte_dates.lwop_nte_start_date			:= null;
5212 	p_asg_nte_dates.suspension_nte 			:= null;
5213 	p_asg_nte_dates.suspension_nte_start_date 	:= null;
5214 	p_asg_nte_dates.furlough_nte	 			:= null;
5215 	p_asg_nte_dates.furlough_nte_start_date	 	:= null;
5216 	p_asg_nte_dates.sabatical_nte	 			:= null;
5217 	p_asg_nte_dates.sabatical_nte_start_date	 	:= null;
5218   end if;
5219 
5220 END Process_Non_Sf52_Extra_Info;
5221 --
5222 End  GHR_SF52_PRE_UPDATE;
5223 --