DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ASSIGNMENTS_F1_PKG

Source


1 PACKAGE BODY PER_ASSIGNMENTS_F1_PKG AS
2 /* $Header: peasg01t.pkb 120.50.12020000.8 2013/02/06 07:35:03 srannama ship $ */
3 --
4 g_package  varchar2(33) := 'per_assignments_f1_pkg.';  -- Global package name
5 g_debug    boolean; -- debug flag
6 --
7 -----------------------------------------------------------------------------
8 --
9 -- PROCEDURE: iud_update_primary
10 --
11 -- If there is to be a change to the Primary Flag and the current assignment
12 -- will be the primary one after the change then we must ensure that the
13 -- end date on the assignment is not going to be reset as a result of
14 -- removing future TERMINATION records (see Termination Logic). This is the
15 -- case when the P_NEW_END_DATE field is not NULL.
16 --
17 -- When there is to be a change the Primary Flag then all the assignments
18 -- affected must be updated.
19 --
20 -- HR_ASSIGNMENT.UPDATE_PRIMARY performs the following logic :-
21 --
22 -- If the P_NEW_PRIM_FLAG is 'Y' then all future rows for the current
23 -- assignment must have PRIMARY_FLAG set to 'Y' and all other assignments
24 -- that have future PRIMARY_FLAG = 'Y' must be set to non-primary.
25 --
26 -- If the P_NEW_PRIM_FLAG is 'N' then the new primary assignment
27 -- P_NEW_PRIM_ASS_ID should be made PRIMARY. This may involve performing
28 -- a date effective insert aswell as updating all future rows. In addition
29 -- all other assignments with future PRIMARY FLAG = 'Y' should be set to
30 -- non-primary.
31 --
32 procedure iud_update_primary(
33    p_mod_mode     varchar2,
34    p_new_prim_flag      varchar2,
35    p_prim_date_from  date,
36    p_new_end_date    date,
37    p_eot       date,
38    p_pd_os_id     number,
39    p_ass_id    number,
40    p_new_prim_ass_id IN OUT NOCOPY number,
41    p_prim_change_flag   IN OUT NOCOPY varchar2) is
42 --
43 
44 l_fin_proc_date    date;
45 l_person_id        number;
46 l_assignment_type  per_all_assignments_f.assignment_type%TYPE;
47 l_pdp_date_start   date;
48 --
49 l_proc            varchar2(18) :=  'iud_update_primary';
50 --
51 
52 -- Start changes for bug 9644377
53 l_object_version_number number;
54 l_effective_start_date  date;
55 l_effective_end_date    date;
56 -- End changes for bug 9664377
57 
58 --
59 -- Fetch the person ID and assignment type
60 -- so the period of placement can be obtained
61 -- for contingent workers.
62 --
63 CURSOR csr_get_assignment_info IS
64 SELECT paaf.person_id
65       ,paaf.assignment_type
66       ,paaf.period_of_placement_date_start
67       ,paaf.object_version_number -- added for bug 9644377
68 FROM   per_all_assignments_f paaf
69 WHERE  paaf.assignment_id = p_ass_id
70 AND    paaf.assignment_type IN ('E', 'C');
71 --
72 -- Bug 3240313 starts here.
73 --
74 CURSOR csr_get_new_asg_info IS
75 SELECT paaf.person_id
76       ,paaf.assignment_type
77       ,paaf.period_of_placement_date_start
78       ,paaf.object_version_number -- added for bug 9644377
79 FROM   per_all_assignments_f paaf
80 WHERE  paaf.assignment_id = p_new_prim_ass_id
81 AND    paaf.assignment_type IN ('E', 'C');
82 --
83 -- Bug 3240313 ends here.
84 --
85 -- Get the termination dates for the period of placement and
86 -- period of service.
87 --
88 CURSOR csr_get_term_dates IS
89 SELECT NVL(final_process_date, p_eot)
90 FROM   per_periods_of_service
91 WHERE  period_of_service_id = p_pd_os_id
92 UNION
93 SELECT NVL(pdp.final_process_date, p_eot)
94 FROM   per_periods_of_placement pdp
95 WHERE  pdp.person_id = l_person_id
96 AND    pdp.date_start = l_pdp_date_start;
97 
98 BEGIN
99   g_debug := hr_utility.debug_enabled; -- get debug status
100   IF g_debug THEN
101     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
102   END IF;
103 
104   --
105   -- Fetch the desired assignment details.
106   --
107   OPEN  csr_get_assignment_info;
108   FETCH csr_get_assignment_info INTO l_person_id
109                                     ,l_assignment_type
110                                     ,l_pdp_date_start
111                                     ,l_object_version_number; --added for bug 6744377
112   --
113   -- Bug 3240313 starts here.
114   --
115   IF g_debug THEN
116     hr_utility.set_location( g_package || l_proc, 10);
117   END IF;
118 
119   IF csr_get_assignment_info%notfound then
120      OPEN csr_get_new_asg_info;
121      FETCH csr_get_new_asg_info INTO l_person_id
122                                     ,l_assignment_type
123                                     ,l_pdp_date_start
124                                     ,l_object_version_number; --added for bug 6744377
125      CLOSE csr_get_new_asg_info;
126   END IF;
127   --
128   -- Bug 3240313 ends here.
129   --
130   CLOSE csr_get_assignment_info;
131 
132   IF g_debug THEN
133     hr_utility.set_location( g_package || l_proc, 20);
134   END IF;
135 
136    if p_new_prim_flag = 'Y' and
137       (p_new_end_date <> p_eot and p_new_end_date is not null) then
138       --
139       -- Get final process date of the pos / pop.
140       --
141       OPEN  csr_get_term_dates;
142       FETCH csr_get_term_dates into l_fin_proc_date;
143       if (csr_get_term_dates%notfound) or
144             (p_new_end_date <> l_fin_proc_date) then
145          CLOSE csr_get_term_dates;
146          fnd_message.set_name('PAY',
147             'HR_6438_EMP_ASS_NOT_CONTIN');
148          fnd_message.raise_error;
149       end if;
150       close csr_get_term_dates;
151    end if;
152    --
153    if p_new_prim_flag = 'Y' then
154       p_new_prim_ass_id := p_ass_id;
155    end if;
156 --
157 -- Comment from hr_assignment.update_primary pkg body:
158 --
159 --      For the Current Assignment, if the operation is not ZAP then updates
160 --         all the future rows to the NEW_PRIMARY_FLAG value.
161 --      For other assignments,
162 --         if the other assignment is the new primary then ensure that there
163 --         is a record starting on the correct date with Primary Flag = 'Y'
164 --         and update all other future changes to the same Primary value.
165 --      For any other assignments
166 --             if the assignment is primary on the date in question then
167 --             ensure that that there is a row on this date with primary
168 --             flag = 'N' and that all future changes are set to 'N'
169 --             otherwise
170 --             ensure that all future primary flags are set to 'N'.
171 --      NB. This uses several calls to DO_PRIMARY_UPDATE which handles the
172 --          date effective insert for an individual assignment row if one
173 --          is required.
174 --
175 -- The 0 parameters below are p_last_updated_by and p_last_update_login, not
176 -- really used at the moment.
177 --
178   IF l_assignment_type <> 'C' THEN
179   IF g_debug THEN
180     hr_utility.set_location( g_package || l_proc, 30);
181   END IF;
182 
183 
184   -- Start changes for bug 9644377
185    if p_mod_mode in ('UPDATE','CORRECTION') then
186    hr_assignment_api.set_new_primary_asg(
187     p_effective_date         =>  p_prim_date_from
188     ,p_person_id             =>  l_person_id
189     ,p_assignment_id         =>  p_new_prim_ass_id
190     ,p_object_version_number =>  l_object_version_number
191     ,p_effective_start_date  =>  l_effective_start_date
192     ,p_effective_end_date    =>  l_effective_end_date
193     );
194    else
195    hr_assignment.update_primary(
196          p_ass_id,
197          p_pd_os_id,
198          p_new_prim_ass_id,
199          p_prim_date_from,
200          p_new_prim_flag,
201          p_mod_mode,
202          0,
203          0);
204    end if;
205   -- End changes for bug 9644377
206 
207   ELSIF l_assignment_type = 'C' THEN
208   IF g_debug THEN
209     hr_utility.set_location( g_package || l_proc, 40);
210   END IF;
211 
212 
213   -- Start changes for bug 9644377
214    if p_mod_mode IN ('UPDATE','CORRECTION') then
215      hr_assignment_api.set_new_primary_cwk_asg(
216      p_effective_date         =>  p_prim_date_from
217      ,p_person_id             =>  l_person_id
218      ,p_assignment_id         =>  p_new_prim_ass_id
219      ,p_object_version_number =>  l_object_version_number
220      ,p_effective_start_date  =>  l_effective_start_date
221      ,p_effective_end_date    =>  l_effective_end_date
222      );
223    else
224      hr_assignment.update_primary_cwk(
225          p_ass_id,
226          l_person_id,
227          l_pdp_date_start,
228          p_new_prim_ass_id,
229          p_prim_date_from,
230          p_new_prim_flag,
231          p_mod_mode,
232          0,
233          0);
234    end if;
235  -- End changes for bug 9644377
236 
237   END IF;
238 
239    p_prim_change_flag := 'N';
240    --
241   IF g_debug THEN
242     hr_utility.set_location( 'Leaving ' ||g_package || l_proc, 50);
243   END IF;
244 
245 end iud_update_primary;
246 -----------------------------------------------------------------------------
247 procedure update_group(
248    p_pg_id     number,
249    p_group_name   varchar2,
250     p_bg_id       number) is
251 --
252 -- Called post-insert/update.
253 --  Start of fix 2762904
254    cursor c_flex is
255        SELECT bg.people_group_structure flex_num
256               FROM   PER_BUSINESS_GROUPS BG
257        WHERE  BG.BUSINESS_GROUP_ID= p_bg_id;
258 
259    -- Bug fix 3648612.
260    -- Cursor modified to improve performance.
261 
262    cursor  c_seg(p_flexnum number) is
263      select rownum, format_type
264            from fnd_id_flex_segments_vl f, fnd_flex_value_sets v
265      where f.flex_value_set_id = v.flex_value_set_id(+)
266      and   id_flex_code ='GRP'
267      and   f.application_id = 801 -- bug fix 3648612.
268      and id_flex_num =  p_flexnum
269      and display_flag='Y'
270      and enabled_flag='Y'
271    order by segment_num;
272 
273    l_xname varchar2(240);
274    l_ch_seg FND_FLEX_EXT.SegmentArray;
275    c number;
276    l_rnum number;
277    l_format varchar2(1);
278    l_flexnum number;
279    l_delimiter  varchar2(1);
280    l_dateformat varchar2(30);
281     i  number := 1;
282    -- end of Fix 2762904
283 --
284 l_proc            varchar2(12) :=  'update_group';
285 --
286 begin
287   g_debug := hr_utility.debug_enabled; -- get debug status
288   IF g_debug THEN
289     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
290   END IF;
291 
292    if p_pg_id <> -1 then
293    --
294    -- This is an existing desc flex record, update group_name held on
295    -- combinations table.
296    -- Start if fix 2762904
297     l_xname := p_group_name;
298     if l_xname is not null then
299     open c_flex;
300     fetch c_flex into l_flexnum;
301     if c_flex%notfound  then
302        close c_flex;
303     end if;
304     close c_flex;
305     l_delimiter := FND_FLEX_APIS.get_segment_delimiter(
306                                                  x_application_id => 801,
307                                                  x_id_flex_code   => 'GRP' ,
308                                                  x_id_flex_num    => l_flexnum );
309    c := fnd_flex_ext.breakup_segments(l_xname,l_delimiter,l_ch_seg);
310    fnd_profile.get('ICX_DATE_FORMAT_MASK',l_dateformat);
311 
312   IF g_debug THEN
313     hr_utility.set_location( g_package || l_proc, 10);
314   END IF;
315 
316     For  x in c_seg(l_flexnum) loop
317 
318      --fnd_message.debug('Date Format: '||l_dateformat);
319     -- fnd_message.debug('Format : '||x.format_type ||'Seg' ||l_ch_seg(i));
320      if x.format_type in ('X') then
321          l_ch_seg(i) := to_char(to_date(l_ch_seg(i), l_dateformat),'DD-MON-RRRR');
322       --fnd_message.debug('Format :' || l_ch_seg(i));
323       elsif x.format_type in ('Y') then
324         --  fnd_message.debug ('date format '||l_dateformat);
325        --   fnd_message.debug('Length '||length(l_ch_seg(i)));
326           l_ch_seg(i):= to_char(to_date(l_ch_seg(i),l_dateformat||' HH24:MI:SS'),'DD-MON-RRRR HH24:MI:SS');
327      end if;
328 
329      i := i + 1;
330    end loop;
331    l_xname:= fnd_flex_ext.concatenate_segments(c,l_ch_seg,l_delimiter);
332   -- p_group_name := l_xname;
333    end if;
334    --End of Fix 2762904
335   IF g_debug THEN
336     hr_utility.set_location( g_package || l_proc, 20);
337   END IF;
338       update   pay_people_groups
339       set   group_name  = l_xname
340       where people_group_id = P_PG_ID
341            and    (group_name     <> p_group_name
342                         or group_name is null)
343 	   and  l_xname is not null; -- 4103321
344       --
345       -- Commented out as not needed and causes process to hang if
346       -- called and people_group_name has not changed
347       --
348       /*
349       if sql%rowcount = 0 then
350          fnd_message.set_name('PAY',
351             'HR_6153_ALL_PROCEDURE_FAIL');
352                         fnd_message.set_token('PROCEDURE',
353                            'PER_ASSIGNMENTS_F1_PKG.UPDATE_GROUP');
354                         fnd_message.set_token('STEP', '1');
355          fnd_message.raise_error;
356       end if;
357       */
358    end if;
359    --
360   IF g_debug THEN
361     hr_utility.set_location( 'Leaving ' || g_package || l_proc, 30);
362   END IF;
363 end update_group;
364 -----------------------------------------------------------------------------
365 
366 -----------------------------------------------------------------------------
367 -- Added to test LOCK is FIXING the Issue
368 ---- changes completed for bug 5219266
369 -----------------------------------------------------------------------------
370 procedure update_scl(
371    p_scl_id number,
372    p_scl_concat   varchar2) is
373 --
374 --
375 
376 CURSOR csr_chk_scl is
377     SELECT null
378       FROM hr_soft_coding_keyflex
379      where  soft_coding_keyflex_id =  p_scl_id
380        and (concatenated_segments  <> p_scl_concat
381         or concatenated_segments is null);
382   --
383   l_exists  varchar2(30);
384   l_proc   varchar2(72) := g_package||'update_scl ';
385   --
386   procedure update_scl_auto
387    ( p_scl_id number,
388      p_scl_concat   varchar2
389    ) is
390     PRAGMA AUTONOMOUS_TRANSACTION;
391     --
392     CURSOR csr_scl_lock is
393       SELECT null
394        FROM 	hr_soft_coding_keyflex
395        where  soft_coding_keyflex_id =  p_scl_id
396        for update nowait;
397     --
398     l_exists  varchar2(30);
399     l_proc    varchar2(72) := g_package||'update_scl_auto ';
400 
401     begin
402 
403     --  if g_debug then
404       hr_utility.set_location('Entering:'|| l_proc, 10);
405     --  end if;
406     --
407     -- The outer procedure has already establish that an update is
408     -- required. This sub-procedure uses an autonomous transaction
409     -- to ensure that any commits do not impact the main transaction.
410     -- If the row is successfully locked then continue and update the
411     -- row. If the row cannot be locked then another transaction must
412     -- be performing the update. So it is acceptable for this
413     -- transaction to silently trap the error and continue.
414     --
415     -- Note: It is necessary to perform the lock test because in
416     -- a batch data upload scenario multiple sessions could be
417     -- attempting to insert or update the same Key Flexfield
418     -- combination at the same time. Just directly updating the row,
419     -- without first locking, can cause sessions to hang and reduce
420     -- batch throughput.
421     --
422     open csr_scl_lock;
423     fetch csr_scl_lock into l_exists;
424     if csr_scl_lock%found then
425     close csr_scl_lock;
426 
427 
428     --    if g_debug then
429         hr_utility.set_location(l_proc, 20);
430     --    end if;
431       --
432       -- Lock obtained by this transaction, updating the concatenated
433       -- segment string should be performed.
434       --
435           update  hr_soft_coding_keyflex
436   	  set     concatenated_segments  = p_scl_concat
437   	  where   soft_coding_keyflex_id = p_scl_id
438           and (concatenated_segments   <> p_scl_concat
439           or  concatenated_segments is null);
440       --
441       -- Commit this change so the change is immediately visible to
442       -- other transactions. Also ensuring that it is not undone if
443       -- the main transaction is rolled back. This commit is only
444       -- acceptable inside an API because it is being performed inside
445       -- an autonomous transaction and AOL code has previously
446       -- inserted the Key Flexfield combination row in another
447       -- autonomous transaction.
448       commit;
449     else
450 --changes for bug 6333879 starts here
451       Rollback;
452 --changes for bug 6333879 ends here
453       close csr_scl_lock;
454     end if;
455 
456 
457     -- if g_debug then
458      hr_utility.set_location('Leaving:'|| l_proc, 30);
459     -- end if;
460 
461   Exception
462     When HR_Api.Object_Locked then
463       --
464       -- This autonomous transaction was unable to lock the row.
465       -- It can be assumed that another transaction has locked the
466       -- row and is performing the update. Hence the error can
467       -- be suppressed without raising it to the end user.
468       --
469       hr_utility.set_location('Leaving:'|| l_proc, 40);
470   end update_scl_auto;
471 
472  begin
473 --
474 
475   --if g_debug then
476   hr_utility.set_location('Entering:'|| l_proc, 10);
477   --end if;
478   --
479   -- First find out if it is necessary to update the concatenated
480   -- segment string column. This select is being done to avoid the
481   -- performance unnecessary overhead of set-up an autonomous
482   -- transaction when an update is not required. Updates are only
483   -- expected immediately after the combination row was first inserted.
484   --
485   open csr_chk_scl;
486   fetch csr_chk_scl into l_exists;
487   if csr_chk_scl%found then
488     close csr_chk_scl;
489     update_scl_auto
490       (p_scl_id  => p_scl_id
491       ,p_scl_concat   => p_scl_concat
492       );
493 
494       -- changes for bug 13324926 start here
495   open csr_chk_scl;
496   fetch csr_chk_scl into l_exists;
497   if csr_chk_scl%found then
498    close csr_chk_scl;
499    update  hr_soft_coding_keyflex
500   	  set     concatenated_segments  = p_scl_concat
501   	  where   soft_coding_keyflex_id = p_scl_id
502           and (concatenated_segments   <> p_scl_concat
503           or  concatenated_segments is null);
504     else
505      close csr_chk_scl;
506    end if;
507       -- changes for bug 13324926 end here
508 
509 
510   else
511     close csr_chk_scl;
512   end if;
513   --
514 
515  --if g_debug then
516   hr_utility.set_location('Leaving:'|| l_proc, 20);
517  --end if;
518 
519 end update_scl;
520 -----------------------------------------------------------------------------
521 
522 /* procedure update_scl(
523    p_scl_id number,
524    p_scl_concat   varchar2) is
525 --
526 -- Called post-insert/update.
527 --
528 begin
529    if p_scl_id <> -1 then
530    --
531    -- This is an existing desc flex record, update concatenated_segments
532    -- field held on hr_soft_coding_keyflex table.
533    --
534       update   hr_soft_coding_keyflex
535       set   concatenated_segments   = p_scl_concat
536       where soft_coding_keyflex_id  = p_scl_id;
537       --
538       if sql%rowcount = 0 then
539          fnd_message.set_name('PAY',
540             'HR_6153_ALL_PROCEDURE_FAIL');
541                         fnd_message.set_token('PROCEDURE',
542                            'PER_ASSIGNMENTS_F1_PKG.UPDATE_SCL');
543                         fnd_message.set_token('STEP', '1');
544          fnd_message.raise_error;
545       end if;
546    end if;
547    --
548 end update_scl; */
549 -- changes ended
550 -- changes completed for bug 5219266
551 -----------------------------------------------------------------------------
552 procedure do_cancel_reterm(
553    p_ass_id    number,
554    p_bg_id        number,
555    p_cancel_atd      date,
556    p_cancel_lspd     date,
557    p_reterm_atd      date,
558    p_reterm_lspd     date) is
559 --
560 -- Run the check to see whether this update operation will result
561 -- in a TERM_STATUS being removed or superceded by an earlier one.
562 -- This also checks to see whether the operation will cause a new
563 -- "leading TERM_ASSIGN" to be implicitly created (i.e. a row in the
564 -- future becomes the "leading TERM_ASSIGN").
565 --
566 -- VT 10/07/96 bug #306710
567 l_entries_chng VARCHAR2(1) := 'N';
568 --
569 l_proc            varchar2(16) :=  'do_cancel_reterm';
570 --
571 begin
572     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
573    hrentmnt.maintain_entries_asg(
574       p_ass_id,
575       p_bg_id,
576       'CNCL_TERM',
577       p_cancel_atd,
578       p_cancel_lspd,
579       null,
580       null,
581       null,
582       null);
583         per_saladmin_utility.adjust_pay_proposals(p_assignment_id => p_ass_id);
584  --
585    if p_reterm_atd is not null then
586       hrempter.terminate_entries_and_alus(
587          p_ass_id,
588          p_reterm_atd,
589          p_reterm_lspd,
590          null,
591          null,
592          l_entries_chng);
593    end if;
594    --
595     hr_utility.set_location('Leaving: '|| g_package || l_proc, 10);
596 end do_cancel_reterm;
597 ----------------------------------------------------------------------------
598 procedure future_del_cleanup(
599    p_ass_id number,
600    p_grd_id number,
601    p_sess_date date,
602    p_calling_proc  varchar2,
603         p_val_st_date   date,
604    p_val_end_date date,
605    p_datetrack_mode varchar2,
606    p_future_spp_warnings OUT NOCOPY boolean
607    ) is
608 
609 l_future_spp_warning boolean;
610 --
611 l_proc            varchar2(18) :=  'future_del_cleanup';
612 --
613 begin
614    --
615    -- The 2 0's are last_updated_by, last_update_login.
616    --
617     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
618    hr_assignment.del_ref_int_delete(
619       p_ass_id,
620       p_grd_id,
621       'FUTURE',
622       p_sess_date,
623       0, 0,
624       p_calling_proc,
625       p_val_st_date,
626       p_val_end_date,
627       p_datetrack_mode,
628       l_future_spp_warning);
629 
630    p_future_spp_warnings := l_future_spp_warning;
631 --
632     hr_utility.set_location('Leaving: '|| g_package || l_proc, 10);
633 end future_del_cleanup;
634 ----------------------------------------------------------------------------
635 procedure tidy_up_ref_int(
636    p_mode      varchar2,
637    p_sess_date date,
638    p_new_end_date date,
639    p_val_end_date date,
640    p_eff_end_date date,
641    p_ass_id number,
642    p_cost_warning OUT NOCOPY boolean) is
643    l_mode      varchar2(30);
644    l_new_end_date date;
645    l_old_end_date date;
646  --
647  l_proc            varchar2(15) :=  'tidy_up_ref_int';
648 --
649 --
650 --  Procedure to reset the end dates of rows in child tables related to the
651 --  Assignment. This procedure is called when the Assignment is ended using
652 --  'END' and when the row is opened up using 'FUTURE_CHANGE' or
653 --  'DELETE_NEXT_CHANGE'.
654 --
655 begin
656     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
657    l_mode := p_mode;
658    --
659    if l_mode = 'END' then
660       l_new_end_date    := p_sess_date;
661       l_old_end_date    := p_sess_date;
662    elsif l_mode = 'INT-END' then
663       l_new_end_date    := p_new_end_date;
664       l_old_end_date    := p_sess_date;
665       l_mode      := 'END';
666    else
667       l_new_end_date    := nvl(p_new_end_date, p_val_end_date);
668       l_old_end_date := p_eff_end_date;
669    end if;
670    --
671    -- The 2 0's are last_updated_by, last_update_login.
672    --
673    hr_assignment.tidy_up_ref_int(
674       p_ass_id,
675       l_mode,
676       l_new_end_date,
677       l_old_end_date,
678       0, 0, p_cost_warning);
679    --
680 
681     hr_utility.set_location('Leaving: '|| g_package || l_proc, 10);
682 end tidy_up_ref_int;
683 ----------------------------------------------------------------------------
684 procedure terminate_entries(
685    p_per_sys_st   varchar2,
686    p_ass_id number,
687    p_sess_date date,
688    p_val_st_date  date) is
689    l_start_date   date;
690 begin
691     hr_utility.set_location('Entering: '|| 'PER_ASSIGNMENTS_F1_PKG.terminate_entries' , 5);
692    if p_per_sys_st = 'END' then
693       l_start_date   := p_sess_date;
694    else
695       l_start_date   := p_val_st_date;
696    end if;
697    --
698    hr_assignment.call_terminate_entries(
699       p_ass_id,
700       p_per_sys_st,
701       l_start_date);
702    --
703 end terminate_entries;
704 -----------------------------------------------------------------------------
705 procedure set_end_date(
706    p_new_end_date date,
707    p_ass_id number) is
708 --
709 -- Update the value of effective end date to the NEW END DATE determined by
710 -- CHECK_TERM.
711 -- This is to ensure that assignments cannot be 'opened up' past the Period
712 -- of Service End Date.
713 --
714 begin
715     hr_utility.set_location('Entering: '|| 'PER_ASSIGNMENTS_F1_PKG.set_end_date' , 5);
716 
717    update   per_assignments_f a
718    set   a.effective_end_date = P_NEW_END_DATE
719    where a.assignment_id      = P_ASS_ID
720    and   a.effective_end_date = (
721       select   max(a2.effective_end_date)
722       from  per_assignments_f a2
723       where a2.assignment_id = a.assignment_id);
724 end set_end_date;
725 -----------------------------------------------------------------------------
726 procedure maintain_entries(
727    p_dt_upd_mode     varchar2,
728    p_dt_del_mode     varchar2,
729    p_per_sys_st      varchar2,
730    p_sess_date    date,
731    p_val_start_date  date,
732    p_val_end_date    date,
733    p_new_end_date    date,
734    p_ass_id    number,
735    p_bg_id        number,
736    p_old_pay_id      number,
737    p_new_pay_id      number,
738    p_old_pg_id       number, -- Added for bug#3924690
739    p_new_pg_id       number, -- Added for bug#3924690
740    p_s_grd_id		 number,  -- Bug#13960540
741    p_grd_id		     number,  -- Bug#13960540
742    p_old_org_id      number,  -- Bug#13960540
743    p_new_org_id      number,  -- Bug#13960540
744    p_old_emp_cat     varchar2,  -- Bug#13960540
745    p_new_emp_cat     varchar2,  -- Bug#13960540
746    p_raise_warning      IN OUT NOCOPY varchar2) is
747    l_val_start_date  date;
748    l_val_end_date    date;
749    l_mode         varchar2(30);
750    l_entries_changed varchar2(1);
751 --
752 -- Maintain element entries for insert/update/delete
753 --
754 begin
755 --
756   hr_utility.set_location('per_assignments_f1_pkg.maintain_entries',1);
757   hr_utility.set_location('p_old_pg_id :'||to_char(p_old_pg_id),1);
758   hr_utility.set_location('p_new_pg_id :'||to_char(p_new_pg_id),1);
759 
760    if p_dt_upd_mode is null then
761       if p_dt_del_mode is null then
762          l_mode := 'INSERT';
763       else
764          l_mode := p_dt_del_mode;
765       end if;
766    else
767       if p_per_sys_st = 'END' then
768          l_mode := 'DELETE';
769       else
770          l_mode := p_dt_upd_mode;
771       end if;
772    end if;
773    --
774    if l_mode = 'DELETE' then
775       l_val_start_date := p_sess_date;
776    else
777       l_val_start_date := p_val_start_date;
778    end if;
779    --
780    if p_new_end_date is null then
781       l_val_end_date := p_val_end_date;
782    else
783       l_val_end_date := p_new_end_date;
784    end if;
785    --
786    -- N.B. If the mode is 'DELETE' i.e. we are ending the assignment
787    -- then the date passed in is the end date of the Assignment.
788    -- The validation start date of a date effectively deleted row is
789    -- the day after the deletion therefore we must add one day on to the
790    -- data in this case.
791    --
792    if l_mode = 'DELETE' then
793       l_val_start_date := l_val_start_date + 1;
794    end if;
795    --
796 hr_utility.set_location('per_assignments_f1_pkg.maintain_entries',2);
797 
798     hrentmnt.maintain_entries_asg(
799        P_ASSIGNMENT_ID           => p_ass_id,
800        P_OLD_PAYROLL_ID          => p_old_pay_id,
801        P_NEW_PAYROLL_ID          => p_new_pay_id,
802        P_BUSINESS_GROUP_ID       => p_bg_id,
803        P_OPERATION               => 'ASG_CRITERIA',
804        P_ACTUAL_TERM_DATE        => null,
805        P_LAST_STANDARD_DATE      => null,
806        P_FINAL_PROCESS_DATE      => null,
807        P_DT_MODE                 => l_mode,
808        P_VALIDATION_START_DATE   => l_val_start_date,
809        P_VALIDATION_END_DATE     => l_val_end_date,
810        P_ENTRIES_CHANGED         => l_entries_changed,
811        P_OLD_HIRE_DATE           => null,           -- p_old_hire_date. Added for bug#3924690.
812        P_OLD_PEOPLE_GROUP_ID     => p_old_pg_id,    -- Added for bug#3924690.
813        P_NEW_PEOPLE_GROUP_ID     => p_new_pg_id,    -- Added for bug#3924690.
814        P_OLD_GRADE_ID            => p_s_grd_id,     -- Added for Bug#13960540
815        P_NEW_GRADE_ID            =>	p_grd_id,       -- Added for Bug#13960540
816        P_OLD_ORGANIZATION_ID     => p_old_org_id,   -- Added for Bug#13960540
817        P_NEW_ORGANIZATION_ID     => p_new_org_id,   -- Added for Bug#13960540
818        P_OLD_EMPLOYMENT_CATEGORY => p_old_emp_cat,  -- Added for Bug#13960540
819        P_NEW_EMPLOYMENT_CATEGORY => p_new_emp_cat   -- Added for Bug#13960540
820        );
821    --
822    if l_entries_changed = 'Y' then
823         per_saladmin_utility.adjust_pay_proposals(p_assignment_id => p_ass_id);
824 	per_saladmin_utility.handle_asg_crit_change (p_assignment_id => p_ass_id, p_effective_date => l_val_start_date);  -- bug 9181563
825         p_raise_warning := 'Y';
826    elsif l_entries_changed = 'S' then
827         per_saladmin_utility.adjust_pay_proposals(p_assignment_id => p_ass_id);
828 	per_saladmin_utility.handle_asg_crit_change (p_assignment_id => p_ass_id, p_effective_date => l_val_start_date);  -- bug 9181563
829 	p_raise_warning := 'S';
830    else
831 	p_raise_warning := 'N';
832    end if;
833    --
834 end  maintain_entries;
835 -----------------------------------------------------------------------------
836 procedure post_update(
837   p_upd_mode                     varchar2,
838   p_new_prim_flag             varchar2,
839   p_val_st_date                   date,
840   p_new_end_date                 date,
841   p_eot                          date,
842   p_pd_os_id                     number,
843   p_ass_id                       number,
844   p_new_prim_ass_id     IN OUT NOCOPY number,
845   p_prim_change_flag   IN OUT NOCOPY varchar2,
846    p_old_pg_id                   number, -- Bug#3924690
847    p_new_pg_id                   number,
848    p_old_org_id                  number,    -- Added for Bug#13960540
849    p_new_org_id                  number,    -- Added for Bug#13960540
850    p_old_emp_cat                 varchar2,  -- Added for Bug#13960540
851    p_new_emp_cat                 varchar2,  -- Added for Bug#13960540
852    p_grd_id                      number,
853    p_sess_date                   date,
854    p_s_grd_id                    number,
855    p_eff_end_date              date,
856    p_per_sys_st                  varchar2,
857         p_old_per_sys_st                varchar2,  --#2404335
858    p_val_end_date                date,
859    p_del_mode                     varchar2,
860    p_bg_id                          number,
861    p_old_pay_id                    number,
862    p_new_pay_id                  number,
863    p_group_name                  varchar2,
864    p_was_end_assign             varchar2,
865    p_cancel_atd                    date,
866    p_cancel_lspd                 date,
867    p_reterm_atd                  date,
868    p_reterm_lspd                 date,
869    p_scl_id                      number,
870    p_scl_concat                    varchar2,
871   p_end_salary                varchar2 ,
872     p_warning               IN OUT NOCOPY varchar2,
873     p_re_entry_point     IN OUT NOCOPY number,
874   p_future_spp_warning     OUT NOCOPY boolean) is
875   --
876   -- Define local variables
877   --
878     l_per_sys_st              varchar2(30);
879     l_raise_warning           varchar2(1);
880   l_element_entry_id       number;
881     l_calling_proc               varchar2(30);
882     l_future_spp_warnings    boolean;
883     l_cost_warning           boolean;
884     l_min_start_date         date;
885   l_dummy_warning          boolean;
886   --
887   l_proc VARCHAR2(72) := g_package||'post_update';
888   --
889   cursor csr_get_salary is
890     select element_entry_id
891     from   pay_element_entries_f
892     where  assignment_id = p_ass_id
893     and    creator_type = 'SP'
894     and    p_val_st_date between
895            effective_start_date and effective_end_date;
896   --
897   -- Check to see if min effective_start_date for spp record is less
898   -- then the effective date of the process
899   --
900   cursor csr_min_spp_date is
901     select min(effective_start_date)
902     from   per_spinal_point_placements_f
903     where  assignment_id = p_ass_id;
904   --
905   --
906     -- Start of 3335915
907     -- Start of Fix for Bug 2849080
908     --
909     -- Declare Cursor.
910     /*
911     cursor csr_grade_step is
912      select spp.placement_id, spp.object_version_number ,step_id,
913              spp.effective_end_date,spp.effective_start_date
914      from per_spinal_point_placements_f  spp
915          where spp.assignment_id = p_ass_id
916          and p_val_st_date between spp.effective_start_date
917                        and spp.effective_end_date;
918 
919    CURSOR csr_spp_id IS
920         SELECT spp.placement_id , spp.object_version_number,spp.effective_start_date
921         FROM  per_spinal_point_placements_f spp
922         WHERE assignment_id = p_ass_id
923         and p_sess_date between spp.effective_start_date
924                         and spp.effective_end_date;
925 
926     -- Declare Local Variables
927         l_placement_id number;
928     l_object_version_number number;
929     l_step_id number ;
930     l_spp_end_date date ;
931     l_spp_st_date date;
932     l_max_spp_date date ;
933     l_datetrack_mode varchar2(30);
934     l_effective_start_date date;
935     l_effective_end_date date;
936     --
937     --  End of Fix for bug 2849080
938     --
939     */
940     -- End of 3335915
941 ---------------------------------------------------------
942 -- Payroll Object Group functionality - requires call to
943 -- pay_pog_all_assignments_pkg. This is designed to be called from a row
944 -- handler user hook, hence has many parameters that are not available here.
945 -- So a cursor is used to return the values, to pass to the pog procedure.
946 --
947 cur_asg_rec per_asg_shd.g_rec_type;
948 --
949   cursor asg_details(p_asg_id number
950                     ,p_eff_date date)
951   is
952   select assignment_id
953   ,effective_start_date
954   ,effective_end_date
955   ,business_group_id
956   ,recruiter_id
957   ,grade_id
958   ,position_id
959   ,job_id
960   ,assignment_status_type_id
961   ,payroll_id
962   ,location_id
963   ,person_referred_by_id
964   ,supervisor_id
965   ,special_ceiling_step_id
966   ,person_id
967   ,recruitment_activity_id
968   ,source_organization_id
969   ,organization_id
970   ,people_group_id
971   ,soft_coding_keyflex_id
972   ,vacancy_id
973   ,pay_basis_id
974   ,assignment_sequence
975   ,assignment_type
976   ,primary_flag
977   ,application_id
978   ,assignment_number
979   ,change_reason
980   ,comment_id
981   ,null
982   ,date_probation_end
983   ,default_code_comb_id
984   ,employment_category
985   ,frequency
986   ,internal_address_line
987   ,manager_flag
988   ,normal_hours
989   ,perf_review_period
990   ,perf_review_period_frequency
991   ,period_of_service_id
992   ,probation_period
993   ,probation_unit
994   ,sal_review_period
995   ,sal_review_period_frequency
996   ,set_of_books_id
997   ,source_type
998   ,time_normal_finish
999   ,time_normal_start
1000   ,bargaining_unit_code
1001   ,labour_union_member_flag
1002   ,hourly_salaried_code
1003   ,request_id
1004   ,program_application_id
1005   ,program_id
1006   ,program_update_date
1007   ,ass_attribute_category
1008   ,ass_attribute1
1009   ,ass_attribute2
1010   ,ass_attribute3
1011   ,ass_attribute4
1012   ,ass_attribute5
1013   ,ass_attribute6
1014   ,ass_attribute7
1015   ,ass_attribute8
1016   ,ass_attribute9
1017   ,ass_attribute10
1018   ,ass_attribute11
1019   ,ass_attribute12
1020   ,ass_attribute13
1021   ,ass_attribute14
1022   ,ass_attribute15
1023   ,ass_attribute16
1024   ,ass_attribute17
1025   ,ass_attribute18
1026   ,ass_attribute19
1027   ,ass_attribute20
1028   ,ass_attribute21
1029   ,ass_attribute22
1030   ,ass_attribute23
1031   ,ass_attribute24
1032   ,ass_attribute25
1033   ,ass_attribute26
1034   ,ass_attribute27
1035   ,ass_attribute28
1036   ,ass_attribute29
1037   ,ass_attribute30
1038   ,title
1039   ,object_version_number
1040   ,contract_id
1041   ,establishment_id
1042   ,collective_agreement_id
1043   ,cagr_grade_def_id
1044   ,cagr_id_flex_num
1045   ,notice_period
1046   ,notice_period_uom
1047   ,employee_category
1048   ,work_at_home
1049   ,job_post_source_name
1050   ,posting_content_id
1051   ,period_of_placement_date_start
1052   ,vendor_id
1053   ,vendor_employee_number
1054   ,vendor_assignment_number
1055   ,assignment_category
1056   ,project_title
1057   ,applicant_rank
1058   ,grade_ladder_pgm_id
1059   ,supervisor_assignment_id
1060   ,vendor_site_id
1061   ,po_header_id
1062   ,po_line_id
1063   ,projected_assignment_end
1064   from per_all_assignments_f
1065   where assignment_id = p_asg_id
1066   and   p_eff_date between effective_start_date
1067                        and effective_end_date;
1068   --
1069   ---------------------------------------------------------
1070   --
1071   procedure delete_any_pay_proposals(p_ass_id   number,
1072                                        p_ass_end_date date) is
1073   --
1074   -- Private proc to delete any pay proposals which have
1075   -- a change date after the validation start date of the
1076   -- current assignment. It is used for assignments
1077   -- which have just been ended or terminated.
1078   --
1079   begin
1080     --
1081       delete   from per_pay_proposals p
1082       where p.assignment_id      = P_ASS_ID
1083       and   p.change_date     > P_ASS_END_DATE;
1084     --
1085   end delete_any_pay_proposals;
1086 --
1087 ---------------------------------------------------------
1088 begin
1089   --
1090   hr_utility.set_location('Entering : '||l_proc,10);
1091   hr_utility.set_location(l_proc||' Update Mode: '||p_upd_mode,11);
1092   hr_utility.set_location(l_proc||' p_sess_date = '||p_sess_date,12);
1093   --
1094         hr_utility.set_location('peasg01t.pkb.post_update..p_grd_id:' || p_grd_id,11);  -- Bug#13960540
1095         hr_utility.set_location('peasg01t.pkb.post_update..p_s_grd_id:' || p_s_grd_id,11);
1096         hr_utility.set_location('peasg01t.pkb.post_update..p_old_org_id:' || p_old_org_id,11);
1097         hr_utility.set_location('peasg01t.pkb.post_update..p_new_org_id:' || p_new_org_id,11);
1098         hr_utility.set_location('peasg01t.pkb.post_update..p_old_emp_cat:' || p_old_emp_cat,11);
1099         hr_utility.set_location('peasg01t.pkb.post_update..p_new_emp_cat:' || p_new_emp_cat,11); -- Bug#13960540
1100  --
1101    p_warning := null;
1102    --
1103    -- If the assignment was updated to End Assign then value would
1104    -- have been reset at pre-update so validate now against END.
1105    --
1106    if p_was_end_assign = 'Y' then
1107     --
1108       l_per_sys_st := 'END';
1109     --
1110    else
1111     --
1112       l_per_sys_st := p_per_sys_st;
1113     --
1114     end if;
1115     --
1116   hr_utility.trace('Reentry Point is '||to_char(p_re_entry_point));
1117   hr_utility.trace('l_per_sys_st is '||l_per_sys_st);
1118   --
1119    if p_re_entry_point = 1 then
1120     --
1121       goto RE_ENTRY_POINT_1;
1122     --
1123    elsif p_re_entry_point = 2 then
1124     --
1125       goto RE_ENTRY_POINT_2;
1126     --
1127   end if;
1128     --
1129     if p_prim_change_flag = 'Y' then
1130     --
1131     hr_utility.set_location(l_proc,20);
1132     --
1133         iud_update_primary( p_upd_mode,
1134                         p_new_prim_flag,
1135                         p_val_st_date,
1136                         p_new_end_date,
1137                         p_eot,
1138                         p_pd_os_id,
1139                         p_ass_id,
1140                         p_new_prim_ass_id,
1141                         p_prim_change_flag);
1142     --
1143     end if;
1144     --
1145   hr_utility.set_location(l_proc,30);
1146   --
1147    update_group(  p_new_pg_id,
1148          p_group_name,
1149                         p_bg_id);
1150     --
1151   hr_utility.set_location(l_proc,40);
1152   --
1153     update_scl(
1154       p_scl_id,
1155       p_scl_concat);
1156     --
1157   if p_upd_mode = 'UPDATE_OVERRIDE' then
1158       --
1159     hr_utility.set_location(l_proc,50);
1160     --
1161     hr_assignment_internal.maintain_spp_asg
1162       (p_assignment_id                => p_ass_id
1163       ,p_datetrack_mode               => p_upd_mode
1164       ,p_validation_start_date        => p_val_st_Date
1165       ,p_validation_end_date          => p_val_end_date
1166       ,p_grade_id                         => p_grd_id
1167       ,p_spp_delete_warning           => l_future_spp_warnings);
1168     --
1169     p_future_spp_warning := l_future_spp_warnings;
1170     --
1171         -- Execute the future changes delete cleanup trigger. This is
1172         -- because part of the functionality of the UPDATE_OVERRIDE
1173         -- option is to perform a future changes delete.
1174         --
1175         l_calling_proc := 'POST_UPDATE';
1176     --
1177       future_del_cleanup(
1178             p_ass_id,
1179             p_grd_id,
1180             p_sess_date,
1181             l_calling_proc,
1182             p_val_st_date,
1183             p_val_end_date,
1184             p_upd_mode,
1185             l_dummy_warning);
1186     --
1187     hr_utility.set_location(l_proc,60);
1188     --
1189   --
1190   -- If datetrack mode is not UPDATE_OVERRIDE
1191   --
1192     else
1193         --
1194         -- Check to see if the grade has changed. If so then date
1195         -- effectively delete any spinal point placement records that
1196         -- exist on or after the validation start date. Perform if
1197         -- p_s_grd_id is not null.
1198         -- Note that processing of placements for the update mode of
1199         -- UPDATE_OVERRIDE is handled by the FUTURE_DEL_CLEANUP
1200         -- procedure.
1201         -- Perform a date effective delete on the spinal point
1202         -- placements table for the current assignment, based on the
1203         -- value in VALIDATION_START_DATE. First delete all records
1204         -- starting after the day before this date, then end the
1205         -- current placement record.
1206         --
1207         -- Added code to select the minimum grade step for the new grade
1208         -- so that the future records can be deleted and then the current
1209          -- record end dated and the next record being inserted with
1210         -- the assignment on the minimum step for the grade with the
1211         -- auto increment flag not ticked and without a increment number
1212      --
1213     -- Start of 3335915
1214     /*
1215     -- Start of Fix for Bug 2849080
1216     --
1217      hr_utility.set_location('p_was_end_assign'||p_was_end_assign,2);
1218      hr_utility.set_location('l_per_sys_st '||l_per_sys_st,2);
1219 
1220     IF (p_grd_id is not null ) and (p_grd_id = p_s_grd_id) then
1221   -- start of fix for bug 3053428
1222         IF l_per_sys_st = 'END' then
1223 
1224         OPEN csr_spp_id;
1225         FETCH csr_spp_id  INTO l_placement_id, l_object_version_number,l_spp_end_date;
1226 
1227         IF csr_spp_id%found then
1228          IF (l_spp_end_date <> p_sess_date) THEN
1229            hr_sp_placement_api.delete_spp
1230            (p_effective_date        => P_sess_date
1231            ,p_datetrack_mode        => 'DELETE'
1232            ,p_placement_id          => l_placement_id
1233            ,p_object_version_number => l_object_version_number
1234            ,p_effective_start_date  => l_effective_start_date
1235            ,p_effective_end_date    => l_effective_end_date);
1236            END IF;
1237         END if;
1238 
1239         CLOSE csr_spp_id;
1240     -- -- End of fix for bug 3053428
1241    ElSe
1242 
1243     hr_utility.set_location('Ass Eff dt matching ',2);
1244 
1245        OPEN csr_grade_step;
1246        FETCH csr_grade_step
1247         INTO l_placement_id,l_object_version_number,l_step_id, l_spp_end_date,l_spp_st_date;
1248 
1249 
1250         IF  csr_grade_step%found  then
1251             hr_utility.set_location('Record Found  ',2);
1252             select max(effective_end_date)
1253              into   l_max_spp_date
1254              from   per_spinal_point_placements_f
1255              where  placement_id = l_placement_id;
1256 
1257           hr_utility.set_location('PD: Max SPP End Dt '|| l_max_spp_date,2);
1258           hr_utility.set_location('PD: Current SPP end dt '||l_spp_end_date,2);
1259           hr_utility.set_location('PD: Val Dt '|| p_val_st_date,2);
1260           hr_utility.set_location('PD: Current SPP st dt '||l_spp_st_date,2);
1261 
1262             IF (l_spp_st_date = p_val_st_date) THEN
1263                l_datetrack_mode :=  'CORRECTION';
1264             ELSIF (l_max_spp_date = l_spp_end_date) THEN
1265                 l_datetrack_mode := 'UPDATE';
1266             ELSE
1267                 l_datetrack_mode := 'UPDATE_CHANGE_INSERT';
1268             END IF;
1269 
1270           hr_utility.set_location('PD: Date Track Mode '||l_datetrack_mode,2);
1271 
1272 
1273               hr_utility.set_location('Calling upadate_spp from post_update ',2);
1274               hr_utility.set_location('effective_date       : '||p_val_st_date,2);
1275               hr_utility.set_location('datetrack_mode       : '||l_datetrack_mode,2);
1276               hr_utility.set_location('placement_id         : '||l_placement_id ,2);
1277               hr_utility.set_location('OVN                  : '||l_object_version_number,2);
1278               hr_utility.set_location('Step Id              : '||l_step_id,2);
1279               hr_utility.set_location('Effective Start date : '||l_effective_start_date,2);
1280               hr_utility.set_location('Efective end date    : '||l_effective_end_date,2);
1281               hr_utility.set_location ('Session Date        : '||p_sess_date, 2);
1282 
1283 
1284                 hr_sp_placement_api.update_spp
1285                         (p_effective_date        => p_val_st_date
1286                         ,p_datetrack_mode        => l_datetrack_mode
1287                         ,p_placement_id          => l_placement_id
1288                         ,p_object_version_number => l_object_version_number
1289                         ,p_step_id               => l_step_id
1290                         ,p_effective_start_date  => l_effective_start_date
1291                         ,p_effective_end_date    => l_effective_end_date);
1292 
1293 
1294 
1295 
1296              hr_utility.set_location('Call to update_SPP finished ',2);
1297 
1298         END IF;
1299         CLOSE csr_grade_step;
1300 
1301       END IF;
1302     END IF;
1303     --
1304     --End of Fix for bug 2849080
1305     --
1306     */
1307     -- End of 3335915
1308 
1309     if (p_s_grd_id <> p_grd_id) or
1310        (p_grd_id is null and p_s_grd_id is not null) then
1311       --
1312       hr_utility.set_location(l_proc||'Grade ID = '||p_grd_id,70);
1313       hr_utility.set_location(l_proc||'Asg ID = '||p_ass_id,71);
1314             hr_utility.set_location(l_proc||'Val Start Date = '||p_val_st_date,72);
1315            --
1316       -- Check that the effective date of the process is not less than the min
1317       -- effective start date for the spp record for the assignment
1318            -- If it is then the process will not be able to update the current step
1319            -- as there is none so raise an error
1320       --
1321       open csr_min_spp_date;
1322       fetch csr_min_spp_date into l_min_start_date;
1323       --
1324       if l_min_start_date > p_val_st_date then
1325         --
1326         fnd_message.set_name('PER', 'HR_289771_SPP_MIN_START_DATE');
1327         hr_utility.raise_error;
1328         --
1329       end if;
1330       --
1331       close csr_min_spp_date;
1332       --
1333       hr_utility.set_location(l_proc,80);
1334       --
1335       hr_assignment_internal.maintain_spp_asg
1336         (p_assignment_id                => p_ass_id
1337         ,p_datetrack_mode               => p_upd_mode
1338         ,p_validation_start_date        => p_val_st_Date
1339         ,p_validation_end_date          => p_val_end_date
1340         ,p_grade_id                          => p_grd_id
1341         ,p_spp_delete_warning           => l_future_spp_warnings);
1342       --
1343     end if; -- if p_s_grd_id <> p_grd_id then
1344    --
1345  end if;
1346  --
1347  <<RE_ENTRY_POINT_1>>
1348  --
1349  hr_utility.set_location(l_proc||' RE_ENTRY_POINT_1 ',90);
1350  --
1351    if l_per_sys_st = 'END' then
1352      --
1353    hr_utility.set_location(l_proc,100);
1354    --
1355       -- Date Effectively Delete any of the assignments' children
1356       -- records.
1357       -- The following tables are affected
1358       -- PER_SPINAL_POINT_PLACEMENTS_F
1359       -- Warn the user that any associated spinal point placement
1360       -- records will be deleted and prompt the user to continue.
1361       -- Then DE delete any such records.
1362       --
1363       -- RE_ENTRY_POINT_1 is really further down so need 2nd goto
1364       -- within this IF construct.
1365       --
1366    if p_re_entry_point = 1 then
1367      --
1368      hr_utility.set_location(l_proc,110);
1369      --
1370          goto RE_ENTRY_POINT_1a;
1371      --
1372       end if;
1373      --
1374       l_calling_proc := 'POST_UPDATE';
1375    --
1376    hr_utility.set_location(l_proc,120);
1377    --
1378       hr_assignment.del_ref_int_delete
1379      (p_ass_id,
1380             null,
1381             'END',
1382             p_sess_date,
1383             0,
1384       0,
1385             l_calling_proc,
1386             p_val_st_date,
1387             p_val_end_date,
1388             p_upd_mode,
1389             l_future_spp_warnings);
1390    --
1391    hr_utility.set_location(l_proc,130);
1392    --
1393    p_future_spp_warning := l_future_spp_warnings;
1394        --
1395    -- NB l_cost_Warning is not set in this scenario.
1396    -- It is only used if mode is FUTURE>
1397        --
1398    --
1399    -- Fix for bug 4278579 starts here.
1400    -- Move the proc call down after to the maintain_entries().
1401    --
1402    /*
1403    tidy_up_ref_int
1404      ('END',
1405             p_sess_date,
1406          p_new_end_date,
1407          p_val_end_date,
1408         p_eff_end_date,
1409         p_ass_id,
1410         l_cost_warning);
1411    */
1412    --
1413    -- Fix for bug 4278579 ends here.
1414    --
1415    hr_utility.set_location(l_proc,140);
1416     --
1417     -- Pass null dt delete mode to ensure it is null.
1418      --
1419    hr_utility.set_location(l_proc,150);
1420    --
1421       maintain_entries
1422      (p_upd_mode,
1423             null,
1424       l_per_sys_st,
1425       p_sess_date,
1426       p_val_st_date,
1427       p_val_end_date,
1428       p_new_end_date,
1429       p_ass_id,
1430       p_bg_id,
1431       p_old_pay_id,
1432       p_new_pay_id,
1433       p_old_pg_id,  -- Added for Bug#3924690
1434       p_new_pg_id,  -- Added for Bug#3924690.
1435       p_s_grd_id,   -- Added for Bug#13960540
1436       p_grd_id,   -- Added for Bug#13960540
1437       p_old_org_id,   -- Added for Bug#13960540
1438       p_new_org_id,   -- Added for Bug#13960540
1439       p_old_emp_cat,  -- Added for Bug#13960540
1440       p_new_emp_cat,  -- Added for Bug#13960540
1441             l_raise_warning);
1442       --
1443       --
1444       -- Fix for bug 4278579 starts here.
1445       --
1446       tidy_up_ref_int
1447           ('END',
1448             p_sess_date,
1449             p_new_end_date,
1450             p_val_end_date,
1451             p_eff_end_date,
1452             p_ass_id,
1453             l_cost_warning);
1454       --
1455       -- Fix for bug 4278579 ends here.
1456       --
1457       hr_utility.set_location(l_proc,160);
1458       --
1459        if l_raise_warning in ('Y','S') then
1460      --
1461      hr_utility.set_location(l_proc,170);
1462      --
1463      if l_raise_warning = 'Y' then
1464        --
1465        hr_utility.set_location(l_proc,180);
1466        --
1467          p_warning := 'HR_7016_ASS_ENTRIES_CHANGED';
1468        --
1469      else
1470        --
1471        hr_utility.set_location(l_proc,190);
1472        --
1473             p_warning := 'HR_7442_ASS_SAL_ENT_CHANGED';
1474        --
1475      end if;
1476      --
1477        p_re_entry_point := 1;
1478        return;
1479      --
1480    end if;
1481        --
1482    <<RE_ENTRY_POINT_1a>>
1483    --
1484    hr_utility.set_location(l_proc||' RE_ENTRY_POINT_1a ',200);
1485        --
1486        terminate_entries
1487          (l_per_sys_st,
1488          p_ass_id,
1489          p_sess_date,
1490          p_val_st_date);
1491    --
1492    hr_utility.set_location(l_proc,210);
1493        --
1494        -- Now delete any pay proposals which have a change date
1495        -- after the end of this assignment.
1496        --
1497       delete_any_pay_proposals
1498          (p_ass_id,
1499          p_val_st_date);
1500         --
1501     hr_utility.set_location(l_proc,220);
1502     --
1503     end if;  -- if l_per_sys_st = 'END'
1504   --
1505    <<RE_ENTRY_POINT_2>>
1506   --
1507   hr_utility.set_location(l_proc||' RE_ENTRY_POINT2 ',230);
1508   --
1509   if l_per_sys_st <> 'END' then
1510       --
1511     hr_utility.set_location(l_proc,240);
1512     --
1513       -- If UPDATE_OVERRIDE caused TERM_ASSIGNs to be removed this may have
1514       --  caused the END DATE to move.
1515       --  If so, the new_end_date will be NOT NULL.
1516       --
1517     -- RE_ENTRY_POINT_2 is really further down so need 2nd goto
1518     -- within this IF construct.
1519     --
1520     if p_re_entry_point = 2 then
1521       --
1522       hr_utility.set_location(l_proc,250);
1523       --
1524       goto RE_ENTRY_POINT_2a;
1525       --
1526     end if;
1527     --
1528       if p_new_end_date is not null then
1529       --
1530       hr_utility.set_location(l_proc,260);
1531       --
1532          set_end_date(p_new_end_date,
1533                         p_ass_id);
1534       --
1535       end if;
1536     --
1537     hr_utility.set_location(l_proc,270);
1538     --
1539     do_cancel_reterm
1540       (p_ass_id,
1541        p_bg_id,
1542        p_cancel_atd,
1543        p_cancel_lspd,
1544        p_reterm_atd,
1545        p_reterm_lspd);
1546       --
1547     hr_utility.set_location(l_proc,280);
1548     --
1549     -- bug 5190394 added if condition
1550     if l_per_sys_st = 'TERM_ASSIGN' and p_val_st_date is not null
1551        	and (p_old_per_sys_st = l_per_sys_st) then
1552        null;
1553     else
1554       maintain_entries
1555       (p_upd_mode,
1556        p_del_mode,
1557        l_per_sys_st,
1558        p_sess_date,
1559        p_val_st_date,
1560        p_val_end_date,
1561        p_new_end_date,
1562        p_ass_id,
1563        p_bg_id,
1564        p_old_pay_id,
1565        p_new_pay_id,
1566        p_old_pg_id,    -- Added for bug#3924690
1567        p_new_pg_id,    -- Added for bug#3924690
1568        p_s_grd_id,     -- Added for Bug#13960540
1569        p_grd_id,       -- Added for Bug#13960540
1570        p_old_org_id,   -- Added for Bug#13960540
1571        p_new_org_id,   -- Added for Bug#13960540
1572        p_old_emp_cat,  -- Added for Bug#13960540
1573        p_new_emp_cat,  -- Added for Bug#13960540
1574          l_raise_warning);
1575     --
1576     hr_utility.set_location(l_proc,290);
1577     --
1578     if l_raise_warning in ('Y','S') then
1579       --
1580       hr_utility.set_location(l_proc,300);
1581       --
1582       if l_raise_warning = 'Y' then
1583         --
1584         hr_utility.set_location(l_proc,310);
1585         --
1586             p_warning := 'HR_7016_ASS_ENTRIES_CHANGED';
1587         --
1588       else
1589         --
1590         hr_utility.set_location(l_proc,320);
1591         --
1592             p_warning := 'HR_7442_ASS_SAL_ENT_CHANGED';
1593         --
1594       end if;
1595       --
1596          p_re_entry_point := 2;
1597          return;
1598       --
1599     end if;
1600     end if; -- bug 5190394
1601     --
1602     <<RE_ENTRY_POINT_2a>>
1603     --
1604     hr_utility.set_location(l_proc||' RE_ENTRY_POINT_2a',330);
1605     --
1606     if l_per_sys_st = 'TERM_ASSIGN' and
1607        p_val_st_date is not null then
1608       --
1609            if (p_old_per_sys_st <> l_per_sys_st) -- #2404335
1610            then
1611       --
1612                hr_utility.set_location(l_proc,340);
1613 
1614           terminate_entries(l_per_sys_st,
1615                                  p_ass_id,
1616                          p_sess_date,
1617                          p_val_st_date);
1618             end if;
1619       --
1620       hr_utility.set_location(l_proc,350);
1621       --
1622         delete_any_pay_proposals(p_ass_id,
1623                                     p_val_st_date);
1624       --
1625       end if;
1626     --
1627   end if; -- if l_per_sys_st <> 'END'
1628   --
1629   p_re_entry_point := 0;
1630   --
1631   -- Set out parameters
1632   --
1633   p_future_spp_warning := l_future_spp_warnings;
1634   --
1635   -- Payroll Object Group functionality, requires call to
1636   -- pay_pog_all_assignments_pkg. This is designed to be called from a row
1637   -- handler user hook, hence has many parameters that are not available here.
1638   -- So a cursor is used to return the current assignment values, to pass to
1639   -- the pog procedure. The 'old' values were stored in a global record, as
1640   -- part of the pre_update_bundle procedure, ready for use here.
1641   --
1642       hr_utility.set_location(l_proc,355);
1643 
1644   OPEN asg_details(p_ass_id, p_sess_date);
1645   FETCH asg_details into cur_asg_rec;
1646   IF asg_details%NOTFOUND THEN
1647     CLOSE asg_details;
1648     hr_utility.trace('no rows for cur_asg_rec');
1649   ELSE
1650     CLOSE asg_details;
1651   END IF;
1652   --
1653 
1654   hr_utility.set_location(l_proc,357);
1655 
1656   pay_pog_all_assignments_pkg.after_update
1657   (p_effective_date            => p_sess_date
1658   ,p_datetrack_mode            => p_upd_mode
1659   ,p_validation_start_date     => p_val_st_date
1660   ,p_validation_end_date       => p_val_end_date
1661   ,P_APPLICANT_RANK            => cur_asg_rec.applicant_rank
1662   ,P_APPLICATION_ID            => cur_asg_rec.application_id
1663   ,P_ASSIGNMENT_CATEGORY       => cur_asg_rec.assignment_category
1664   ,P_ASSIGNMENT_ID             => cur_asg_rec.assignment_id
1665   ,P_ASSIGNMENT_NUMBER         => cur_asg_rec.assignment_number
1666   ,P_ASSIGNMENT_STATUS_TYPE_ID => cur_asg_rec.assignment_status_type_id
1667   ,P_ASSIGNMENT_TYPE           => cur_asg_rec.assignment_type
1668   ,P_ASS_ATTRIBUTE1            => cur_asg_rec.ass_attribute1
1669   ,P_ASS_ATTRIBUTE10           => cur_asg_rec.ass_attribute10
1670   ,P_ASS_ATTRIBUTE11           => cur_asg_rec.ass_attribute11
1671   ,P_ASS_ATTRIBUTE12           => cur_asg_rec.ass_attribute12
1672   ,P_ASS_ATTRIBUTE13           => cur_asg_rec.ass_attribute13
1673   ,P_ASS_ATTRIBUTE14           => cur_asg_rec.ass_attribute14
1674   ,P_ASS_ATTRIBUTE15           => cur_asg_rec.ass_attribute15
1675   ,P_ASS_ATTRIBUTE16           => cur_asg_rec.ass_attribute16
1676   ,P_ASS_ATTRIBUTE17           => cur_asg_rec.ass_attribute17
1677   ,P_ASS_ATTRIBUTE18           => cur_asg_rec.ass_attribute18
1678   ,P_ASS_ATTRIBUTE19           => cur_asg_rec.ass_attribute19
1679   ,P_ASS_ATTRIBUTE2            => cur_asg_rec.ass_attribute2
1680   ,P_ASS_ATTRIBUTE20           => cur_asg_rec.ass_attribute20
1681   ,P_ASS_ATTRIBUTE21           => cur_asg_rec.ass_attribute21
1682   ,P_ASS_ATTRIBUTE22           => cur_asg_rec.ass_attribute22
1683   ,P_ASS_ATTRIBUTE23           => cur_asg_rec.ass_attribute23
1684   ,P_ASS_ATTRIBUTE24           => cur_asg_rec.ass_attribute24
1685   ,P_ASS_ATTRIBUTE25           => cur_asg_rec.ass_attribute25
1686   ,P_ASS_ATTRIBUTE26           => cur_asg_rec.ass_attribute26
1687   ,P_ASS_ATTRIBUTE27           => cur_asg_rec.ass_attribute27
1688   ,P_ASS_ATTRIBUTE28           => cur_asg_rec.ass_attribute28
1689   ,P_ASS_ATTRIBUTE29           => cur_asg_rec.ass_attribute29
1690   ,P_ASS_ATTRIBUTE3            => cur_asg_rec.ass_attribute3
1691   ,P_ASS_ATTRIBUTE30           => cur_asg_rec.ass_attribute30
1692   ,P_ASS_ATTRIBUTE4            => cur_asg_rec.ass_attribute4
1693   ,P_ASS_ATTRIBUTE5            => cur_asg_rec.ass_attribute5
1694   ,P_ASS_ATTRIBUTE6            => cur_asg_rec.ass_attribute6
1695   ,P_ASS_ATTRIBUTE7            => cur_asg_rec.ass_attribute7
1696   ,P_ASS_ATTRIBUTE8            => cur_asg_rec.ass_attribute8
1697   ,P_ASS_ATTRIBUTE9            => cur_asg_rec.ass_attribute9
1698   ,P_ASS_ATTRIBUTE_CATEGORY    => cur_asg_rec.ass_attribute_category
1699   ,P_BARGAINING_UNIT_CODE      => cur_asg_rec.bargaining_unit_code
1700   ,P_CAGR_GRADE_DEF_ID         => cur_asg_rec.cagr_grade_def_id
1701   ,P_CAGR_ID_FLEX_NUM          => cur_asg_rec.cagr_id_flex_num
1702   ,P_CHANGE_REASON             => cur_asg_rec.change_reason
1703   ,P_COLLECTIVE_AGREEMENT_ID   => cur_asg_rec.collective_agreement_id
1704   ,P_COMMENTS                  => cur_asg_rec.comment_text
1705   ,P_COMMENT_ID                => cur_asg_rec.comment_id
1706   ,P_CONTRACT_ID               => cur_asg_rec.contract_id
1707   ,P_DATE_PROBATION_END        => cur_asg_rec.date_probation_end
1708   ,P_DEFAULT_CODE_COMB_ID      => cur_asg_rec.default_code_comb_id
1709   ,P_EFFECTIVE_END_DATE        => cur_asg_rec.effective_end_date
1710   ,P_EFFECTIVE_START_DATE      => cur_asg_rec.effective_start_date
1711   ,P_EMPLOYEE_CATEGORY         => cur_asg_rec.employee_category
1712   ,P_EMPLOYMENT_CATEGORY       => cur_asg_rec.employment_category
1713   ,P_ESTABLISHMENT_ID          => cur_asg_rec.establishment_id
1714   ,P_FREQUENCY                 => cur_asg_rec.frequency
1715   ,P_GRADE_ID                  => cur_asg_rec.grade_id
1716   ,P_HOURLY_SALARIED_CODE      => cur_asg_rec.hourly_salaried_code
1717   ,P_HOURLY_SALARIED_WARNING   => null
1718   ,P_INTERNAL_ADDRESS_LINE     => cur_asg_rec.internal_address_line
1719   ,P_JOB_ID                    => cur_asg_rec.job_id
1720   ,P_JOB_POST_SOURCE_NAME      => cur_asg_rec.job_post_source_name
1721   ,P_LABOUR_UNION_MEMBER_FLAG  => cur_asg_rec.labour_union_member_flag
1722   ,P_LOCATION_ID               => cur_asg_rec.location_id
1723   ,P_MANAGER_FLAG              => cur_asg_rec.manager_flag
1724   ,P_NORMAL_HOURS              => cur_asg_rec.normal_hours
1725   ,P_NOTICE_PERIOD             => cur_asg_rec.notice_period
1726   ,P_NOTICE_PERIOD_UOM         => cur_asg_rec.notice_period_uom
1727   ,P_NO_MANAGERS_WARNING       => null
1728   ,P_OBJECT_VERSION_NUMBER     => cur_asg_rec.object_version_number
1729   ,P_ORGANIZATION_ID           => cur_asg_rec.organization_id
1730   ,P_ORG_NOW_NO_MANAGER_WARNING => null
1731   ,P_OTHER_MANAGER_WARNING     => null
1732   ,P_PAYROLL_ID                => cur_asg_rec.payroll_id
1733   ,P_PAYROLL_ID_UPDATED        => null
1734   ,P_PAY_BASIS_ID              => cur_asg_rec.pay_basis_id
1735   ,P_PEOPLE_GROUP_ID           => cur_asg_rec.people_group_id
1736   ,P_PERF_REVIEW_PERIOD        => cur_asg_rec.perf_review_period
1737   ,P_PERF_REVIEW_PERIOD_FREQUEN => cur_asg_rec.perf_review_period_frequency
1738   ,P_PERIOD_OF_SERVICE_ID      => cur_asg_rec.period_of_service_id
1739   ,P_PERSON_REFERRED_BY_ID     => cur_asg_rec.person_referred_by_id
1740   ,P_PLACEMENT_DATE_START      => cur_asg_rec.period_of_placement_date_start
1741   ,P_POSITION_ID               => cur_asg_rec.position_id
1742   ,P_POSTING_CONTENT_ID        => cur_asg_rec.posting_content_id
1743   ,P_PRIMARY_FLAG              => cur_asg_rec.primary_flag
1744   ,P_PROBATION_PERIOD          => cur_asg_rec.probation_period
1745   ,P_PROBATION_UNIT            => cur_asg_rec.probation_unit
1746   ,P_PROGRAM_APPLICATION_ID    => cur_asg_rec.program_application_id
1747   ,P_PROGRAM_ID                => cur_asg_rec.program_id
1748   ,P_PROGRAM_UPDATE_DATE       => cur_asg_rec.program_update_date
1749   ,P_PROJECT_TITLE             => cur_asg_rec.project_title
1750   ,P_RECRUITER_ID              => cur_asg_rec.recruiter_id
1751   ,P_RECRUITMENT_ACTIVITY_ID   => cur_asg_rec.recruitment_activity_id
1752   ,P_REQUEST_ID                => cur_asg_rec.request_id
1753   ,P_SAL_REVIEW_PERIOD         => cur_asg_rec.sal_review_period
1754   ,P_SAL_REVIEW_PERIOD_FREQUEN => cur_asg_rec.sal_review_period_frequency
1755   ,P_SET_OF_BOOKS_ID           => cur_asg_rec.set_of_books_id
1756   ,P_SOFT_CODING_KEYFLEX_ID    => cur_asg_rec.soft_coding_keyflex_id
1757   ,P_SOURCE_ORGANIZATION_ID    => cur_asg_rec.source_organization_id
1758   ,P_SOURCE_TYPE               => cur_asg_rec.source_type
1759   ,P_SPECIAL_CEILING_STEP_ID   => cur_asg_rec.special_ceiling_step_id
1760   ,P_SUPERVISOR_ID             => cur_asg_rec.supervisor_id
1761   ,P_TIME_NORMAL_FINISH        => cur_asg_rec.time_normal_finish
1762   ,P_TIME_NORMAL_START         => cur_asg_rec.time_normal_start
1763   ,P_TITLE                     => cur_asg_rec.title
1764   ,P_VACANCY_ID                => cur_asg_rec.vacancy_id
1765   ,P_VENDOR_ASSIGNMENT_NUMBER  => cur_asg_rec.vendor_assignment_number
1766   ,P_VENDOR_EMPLOYEE_NUMBER    => cur_asg_rec.vendor_employee_number
1767   ,P_VENDOR_ID                 => cur_asg_rec.vendor_id
1768   ,P_WORK_AT_HOME              => cur_asg_rec.work_at_home
1769   ,P_GRADE_LADDER_PGM_ID       => cur_asg_rec.grade_ladder_pgm_id
1770   ,P_SUPERVISOR_ASSIGNMENT_ID  => cur_asg_rec.supervisor_assignment_id
1771   ,P_VENDOR_SITE_ID            => cur_asg_rec.vendor_site_id
1772   ,P_PO_HEADER_ID              => cur_asg_rec.po_header_id
1773   ,P_PO_LINE_ID                => cur_asg_rec.po_line_id
1774   ,P_PROJECTED_ASSIGNMENT_END  => cur_asg_rec.projected_assignment_end
1775   ,P_APPLICANT_RANK_O
1776      => per_assignments_f2_pkg.g_old_asg_rec.applicant_rank
1777   ,P_APPLICATION_ID_O
1778      => per_assignments_f2_pkg.g_old_asg_rec.application_id
1779   ,P_ASSIGNMENT_CATEGORY_O
1780      => per_assignments_f2_pkg.g_old_asg_rec.assignment_category
1781   ,P_ASSIGNMENT_NUMBER_O
1782      => per_assignments_f2_pkg.g_old_asg_rec.assignment_number
1783   ,P_ASSIGNMENT_SEQUENCE_O
1784      => per_assignments_f2_pkg.g_old_asg_rec.assignment_sequence
1785   ,P_ASSIGNMENT_STATUS_TYPE_ID_O
1786      => per_assignments_f2_pkg.g_old_asg_rec.assignment_status_type_id
1787   ,P_ASSIGNMENT_TYPE_O
1788      => per_assignments_f2_pkg.g_old_asg_rec.assignment_type
1789   ,P_ASS_ATTRIBUTE1_O
1790      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute1
1791   ,P_ASS_ATTRIBUTE10_O
1792      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute10
1793   ,P_ASS_ATTRIBUTE11_O
1794      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute11
1795   ,P_ASS_ATTRIBUTE12_O
1796      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute12
1797   ,P_ASS_ATTRIBUTE13_O
1798      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute13
1799   ,P_ASS_ATTRIBUTE14_O
1800      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute14
1801   ,P_ASS_ATTRIBUTE15_O
1802      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute15
1803   ,P_ASS_ATTRIBUTE16_O
1804      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute16
1805   ,P_ASS_ATTRIBUTE17_O
1806      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute17
1807   ,P_ASS_ATTRIBUTE18_O
1808      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute18
1809   ,P_ASS_ATTRIBUTE19_O
1810      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute19
1811   ,P_ASS_ATTRIBUTE2_O
1812      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute2
1813   ,P_ASS_ATTRIBUTE20_O
1814      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute20
1815   ,P_ASS_ATTRIBUTE21_O
1816      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute21
1817   ,P_ASS_ATTRIBUTE22_O
1818      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute22
1819   ,P_ASS_ATTRIBUTE23_O
1820      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute23
1821   ,P_ASS_ATTRIBUTE24_O
1822      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute24
1823   ,P_ASS_ATTRIBUTE25_O
1824      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute25
1825   ,P_ASS_ATTRIBUTE26_O
1826      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute26
1827   ,P_ASS_ATTRIBUTE27_O
1828      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute27
1829   ,P_ASS_ATTRIBUTE28_O
1830      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute28
1831   ,P_ASS_ATTRIBUTE29_O
1832      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute29
1833   ,P_ASS_ATTRIBUTE3_O
1834      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute3
1835   ,P_ASS_ATTRIBUTE30_O
1836      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute30
1837   ,P_ASS_ATTRIBUTE4_O
1838      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute4
1839   ,P_ASS_ATTRIBUTE5_O
1840      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute5
1841   ,P_ASS_ATTRIBUTE6_O
1842      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute6
1843   ,P_ASS_ATTRIBUTE7_O
1844      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute7
1845   ,P_ASS_ATTRIBUTE8_O
1846      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute8
1847   ,P_ASS_ATTRIBUTE9_O
1848      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute9
1849   ,P_ASS_ATTRIBUTE_CATEGORY_O
1850      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute_category
1851   ,P_BARGAINING_UNIT_CODE_O
1852      => per_assignments_f2_pkg.g_old_asg_rec.bargaining_unit_code
1853   ,P_BUSINESS_GROUP_ID_O
1854      => per_assignments_f2_pkg.g_old_asg_rec.business_group_id
1855   ,P_CAGR_GRADE_DEF_ID_O
1856      => per_assignments_f2_pkg.g_old_asg_rec.cagr_grade_def_id
1857   ,P_CAGR_ID_FLEX_NUM_O
1858      => per_assignments_f2_pkg.g_old_asg_rec.cagr_id_flex_num
1859   ,P_CHANGE_REASON_O
1860      => per_assignments_f2_pkg.g_old_asg_rec.change_reason
1861   ,P_COLLECTIVE_AGREEMENT_ID_O
1862      => per_assignments_f2_pkg.g_old_asg_rec.collective_agreement_id
1863   ,P_COMMENT_ID_O
1864      => per_assignments_f2_pkg.g_old_asg_rec.comment_id
1865   ,P_CONTRACT_ID_O
1866      => per_assignments_f2_pkg.g_old_asg_rec.contract_id
1867   ,P_DATE_PROBATION_END_O
1868      => per_assignments_f2_pkg.g_old_asg_rec.date_probation_end
1869   ,P_DEFAULT_CODE_COMB_ID_O
1870      => per_assignments_f2_pkg.g_old_asg_rec.default_code_comb_id
1871   ,P_EFFECTIVE_END_DATE_O
1872      => per_assignments_f2_pkg.g_old_asg_rec.effective_end_date
1873   ,P_EFFECTIVE_START_DATE_O
1874      => per_assignments_f2_pkg.g_old_asg_rec.effective_start_date
1875   ,P_EMPLOYEE_CATEGORY_O
1876      => per_assignments_f2_pkg.g_old_asg_rec.employee_category
1877   ,P_EMPLOYMENT_CATEGORY_O
1878      => per_assignments_f2_pkg.g_old_asg_rec.employment_category
1879   ,P_ESTABLISHMENT_ID_O
1880      => per_assignments_f2_pkg.g_old_asg_rec.establishment_id
1881   ,P_FREQUENCY_O
1882      => per_assignments_f2_pkg.g_old_asg_rec.frequency
1883   ,P_GRADE_ID_O
1884      => per_assignments_f2_pkg.g_old_asg_rec.grade_id
1885   ,P_HOURLY_SALARIED_CODE_O
1886      => per_assignments_f2_pkg.g_old_asg_rec.hourly_salaried_code
1887   ,P_INTERNAL_ADDRESS_LINE_O
1888      => per_assignments_f2_pkg.g_old_asg_rec.internal_address_line
1889   ,P_JOB_ID_O
1890      => per_assignments_f2_pkg.g_old_asg_rec.job_id
1891   ,P_JOB_POST_SOURCE_NAME_O
1892      => per_assignments_f2_pkg.g_old_asg_rec.job_post_source_name
1893   ,P_LABOUR_UNION_MEMBER_FLAG_O
1894      => per_assignments_f2_pkg.g_old_asg_rec.labour_union_member_flag
1895   ,P_LOCATION_ID_O
1896      => per_assignments_f2_pkg.g_old_asg_rec.location_id
1897   ,P_MANAGER_FLAG_O
1898      => per_assignments_f2_pkg.g_old_asg_rec.manager_flag
1899   ,P_NORMAL_HOURS_O
1900      => per_assignments_f2_pkg.g_old_asg_rec.normal_hours
1901   ,P_NOTICE_PERIOD_O
1902      => per_assignments_f2_pkg.g_old_asg_rec.notice_period
1903   ,P_NOTICE_PERIOD_UOM_O
1904      => per_assignments_f2_pkg.g_old_asg_rec.notice_period_uom
1905   ,P_OBJECT_VERSION_NUMBER_O
1906      => per_assignments_f2_pkg.g_old_asg_rec.object_version_number
1907   ,P_ORGANIZATION_ID_O
1908      => per_assignments_f2_pkg.g_old_asg_rec.organization_id
1909   ,P_PAYROLL_ID_O
1910      => per_assignments_f2_pkg.g_old_asg_rec.payroll_id
1911   ,P_PAY_BASIS_ID_O
1912      => per_assignments_f2_pkg.g_old_asg_rec.pay_basis_id
1913   ,P_PEOPLE_GROUP_ID_O
1914      => per_assignments_f2_pkg.g_old_asg_rec.people_group_id
1915   ,P_PERF_REVIEW_PERIOD_O
1916      => per_assignments_f2_pkg.g_old_asg_rec.perf_review_period
1917   ,P_PERF_REVIEW_PERIOD_FREQUEN_O
1918      => per_assignments_f2_pkg.g_old_asg_rec.perf_review_period_frequency
1919   ,P_PERIOD_OF_SERVICE_ID_O
1920      => per_assignments_f2_pkg.g_old_asg_rec.period_of_service_id
1921   ,P_PERSON_ID_O
1922      => per_assignments_f2_pkg.g_old_asg_rec.person_id
1923   ,P_PERSON_REFERRED_BY_ID_O
1924      => per_assignments_f2_pkg.g_old_asg_rec.person_referred_by_id
1925   ,P_PLACEMENT_DATE_START_O
1926      => per_assignments_f2_pkg.g_old_asg_rec.period_of_placement_date_start
1927   ,P_POSITION_ID_O
1928      => per_assignments_f2_pkg.g_old_asg_rec.position_id
1929   ,P_POSTING_CONTENT_ID_O
1930      => per_assignments_f2_pkg.g_old_asg_rec.posting_content_id
1931   ,P_PRIMARY_FLAG_O
1932      => per_assignments_f2_pkg.g_old_asg_rec.primary_flag
1933   ,P_PROBATION_PERIOD_O
1934      => per_assignments_f2_pkg.g_old_asg_rec.probation_period
1935   ,P_PROBATION_UNIT_O
1936      => per_assignments_f2_pkg.g_old_asg_rec.probation_unit
1937   ,P_PROGRAM_APPLICATION_ID_O
1938      => per_assignments_f2_pkg.g_old_asg_rec.program_application_id
1939   ,P_PROGRAM_ID_O
1940      => per_assignments_f2_pkg.g_old_asg_rec.program_id
1941   ,P_PROGRAM_UPDATE_DATE_O
1942      => per_assignments_f2_pkg.g_old_asg_rec.program_update_date
1943   ,P_PROJECT_TITLE_O
1944      => per_assignments_f2_pkg.g_old_asg_rec.project_title
1945   ,P_RECRUITER_ID_O
1946      => per_assignments_f2_pkg.g_old_asg_rec.recruiter_id
1947   ,P_RECRUITMENT_ACTIVITY_ID_O
1948      => per_assignments_f2_pkg.g_old_asg_rec.recruitment_activity_id
1949   ,P_REQUEST_ID_O
1950      => per_assignments_f2_pkg.g_old_asg_rec.request_id
1951   ,P_SAL_REVIEW_PERIOD_O
1952      => per_assignments_f2_pkg.g_old_asg_rec.sal_review_period
1953   ,P_SAL_REVIEW_PERIOD_FREQUEN_O
1954      => per_assignments_f2_pkg.g_old_asg_rec.sal_review_period_frequency
1955   ,P_SET_OF_BOOKS_ID_O
1956      => per_assignments_f2_pkg.g_old_asg_rec.set_of_books_id
1957   ,P_SOFT_CODING_KEYFLEX_ID_O
1958      => per_assignments_f2_pkg.g_old_asg_rec.soft_coding_keyflex_id
1959   ,P_SOURCE_ORGANIZATION_ID_O
1960      => per_assignments_f2_pkg.g_old_asg_rec.source_organization_id
1961   ,P_SOURCE_TYPE_O
1962      => per_assignments_f2_pkg.g_old_asg_rec.source_type
1963   ,P_SPECIAL_CEILING_STEP_ID_O
1964      => per_assignments_f2_pkg.g_old_asg_rec.special_ceiling_step_id
1965   ,P_SUPERVISOR_ID_O
1966      => per_assignments_f2_pkg.g_old_asg_rec.supervisor_id
1967   ,P_TIME_NORMAL_FINISH_O
1968      => per_assignments_f2_pkg.g_old_asg_rec.time_normal_finish
1969   ,P_TIME_NORMAL_START_O
1970      => per_assignments_f2_pkg.g_old_asg_rec.time_normal_start
1971   ,P_TITLE_O
1972      => per_assignments_f2_pkg.g_old_asg_rec.title
1973   ,P_VACANCY_ID_O
1974      => per_assignments_f2_pkg.g_old_asg_rec.vacancy_id
1975   ,P_VENDOR_ASSIGNMENT_NUMBER_O
1976      => per_assignments_f2_pkg.g_old_asg_rec.vendor_assignment_number
1977   ,P_VENDOR_EMPLOYEE_NUMBER_O
1978      => per_assignments_f2_pkg.g_old_asg_rec.vendor_employee_number
1979   ,P_VENDOR_ID_O
1980      => per_assignments_f2_pkg.g_old_asg_rec.vendor_id
1981   ,P_WORK_AT_HOME_O
1982      => per_assignments_f2_pkg.g_old_asg_rec.work_at_home
1983   ,P_GRADE_LADDER_PGM_ID_O
1984      => per_assignments_f2_pkg.g_old_asg_rec.grade_ladder_pgm_id
1985   ,P_SUPERVISOR_ASSIGNMENT_ID_O
1986      => per_assignments_f2_pkg.g_old_asg_rec.supervisor_assignment_id
1987   ,P_VENDOR_SITE_ID_O
1988      => per_assignments_f2_pkg.g_old_asg_rec.vendor_site_id
1989   ,P_PO_HEADER_ID_O
1990      => per_assignments_f2_pkg.g_old_asg_rec.po_header_id
1991   ,P_PO_LINE_ID_O
1992      => per_assignments_f2_pkg.g_old_asg_rec.po_line_id
1993   ,P_PROJECTED_ASSIGNMENT_END_O
1994      => per_assignments_f2_pkg.g_old_asg_rec.projected_assignment_end
1995   );
1996   --
1997   hr_utility.set_location('Leaving : '||l_proc,999);
1998   --
1999 end post_update;
2000 -----------------------------------------------------------------------------
2001 procedure post_insert(
2002    p_prim_change_flag   IN OUT NOCOPY varchar2,
2003    p_val_st_date     date,
2004    p_new_end_date    date,
2005    p_eot       date,
2006    p_pd_os_id     number,
2007    p_ass_id    number,
2008    p_new_prim_ass_id IN OUT NOCOPY number,
2009    p_pg_id        number,
2010    p_group_name      varchar2,
2011    p_bg_id        number,
2012    p_dt_upd_mode     varchar2,
2013         p_dt_del_mode      varchar2,
2014         p_per_sys_st    varchar2,
2015         p_sess_date     date,
2016          p_val_end_date    date,
2017    p_new_pay_id      number,
2018    p_old_pay_id      number,
2019    p_scl_id    number,
2020    p_scl_concat      varchar2,
2021    p_warning      IN OUT NOCOPY varchar2) is
2022    --
2023    l_raise_warning      varchar2(1);
2024   --
2025   -- Payroll Object Group (POG) functionality.
2026   --
2027   ins_asg_rec per_asg_shd.g_rec_type;
2028   --
2029   cursor asg_details(p_asg_id number
2030                     ,p_eff_date date)
2031   is
2032   select assignment_id
2033   ,effective_start_date
2034   ,effective_end_date
2035   ,business_group_id
2036   ,recruiter_id
2037   ,grade_id
2038   ,position_id
2039   ,job_id
2040   ,assignment_status_type_id
2041   ,payroll_id
2042   ,location_id
2043   ,person_referred_by_id
2044   ,supervisor_id
2045   ,special_ceiling_step_id
2046   ,person_id
2047   ,recruitment_activity_id
2048   ,source_organization_id
2049   ,organization_id
2050   ,people_group_id
2051   ,soft_coding_keyflex_id
2052   ,vacancy_id
2053   ,pay_basis_id
2054   ,assignment_sequence
2055   ,assignment_type
2056   ,primary_flag
2057   ,application_id
2058   ,assignment_number
2059   ,change_reason
2060   ,comment_id
2061   ,null
2062   ,date_probation_end
2063   ,default_code_comb_id
2064   ,employment_category
2065   ,frequency
2066   ,internal_address_line
2067   ,manager_flag
2068   ,normal_hours
2069   ,perf_review_period
2070   ,perf_review_period_frequency
2071   ,period_of_service_id
2072   ,probation_period
2073   ,probation_unit
2074   ,sal_review_period
2075   ,sal_review_period_frequency
2076   ,set_of_books_id
2077   ,source_type
2078   ,time_normal_finish
2079   ,time_normal_start
2080   ,bargaining_unit_code
2081   ,labour_union_member_flag
2082   ,hourly_salaried_code
2083   ,request_id
2084   ,program_application_id
2085   ,program_id
2086   ,program_update_date
2087   ,ass_attribute_category
2088   ,ass_attribute1
2089   ,ass_attribute2
2090   ,ass_attribute3
2091   ,ass_attribute4
2092   ,ass_attribute5
2093   ,ass_attribute6
2094   ,ass_attribute7
2095   ,ass_attribute8
2096   ,ass_attribute9
2097   ,ass_attribute10
2098   ,ass_attribute11
2099   ,ass_attribute12
2100   ,ass_attribute13
2101   ,ass_attribute14
2102   ,ass_attribute15
2103   ,ass_attribute16
2104   ,ass_attribute17
2105   ,ass_attribute18
2106   ,ass_attribute19
2107   ,ass_attribute20
2108   ,ass_attribute21
2109   ,ass_attribute22
2110   ,ass_attribute23
2111   ,ass_attribute24
2112   ,ass_attribute25
2113   ,ass_attribute26
2114   ,ass_attribute27
2115   ,ass_attribute28
2116   ,ass_attribute29
2117   ,ass_attribute30
2118   ,title
2119   ,object_version_number
2120   ,contract_id
2121   ,establishment_id
2122   ,collective_agreement_id
2123   ,cagr_grade_def_id
2124   ,cagr_id_flex_num
2125   ,notice_period
2126   ,notice_period_uom
2127   ,employee_category
2128   ,work_at_home
2129   ,job_post_source_name
2130   ,posting_content_id
2131   ,period_of_placement_date_start
2132   ,vendor_id
2133   ,vendor_employee_number
2134   ,vendor_assignment_number
2135   ,assignment_category
2136   ,project_title
2137   ,applicant_rank
2138   ,grade_ladder_pgm_id
2139   ,supervisor_assignment_id
2140   ,vendor_site_id
2141   ,po_header_id
2142   ,po_line_id
2143   ,projected_assignment_end
2144   from per_all_assignments_f
2145   where assignment_id = p_asg_id
2146   and   p_eff_date between effective_start_date
2147                        and effective_end_date;
2148   --
2149   l_vsd date;
2150   l_ved date;
2151 --
2152 l_proc            varchar2(11) :=  'post_insert';
2153 --
2154 begin
2155   g_debug := hr_utility.debug_enabled; -- get debug status
2156   IF g_debug THEN
2157     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
2158   END IF;
2159 
2160    if p_prim_change_flag = 'Y' then
2161       --
2162       -- Perform primary flag validation / processing.
2163       --
2164       iud_update_primary(
2165          'INSERT',
2166          'Y',
2167          p_val_st_date,
2168          p_new_end_date,
2169          p_eot,
2170          p_pd_os_id,
2171          p_ass_id,
2172          p_new_prim_ass_id,
2173          p_prim_change_flag);
2174       --
2175       -- NB The above proc may have changed the last 2 parameters.
2176       --
2177    end if;
2178    --
2179   IF g_debug THEN
2180     hr_utility.set_location( g_package || l_proc, 10);
2181   END IF;
2182    update_group(
2183          p_pg_id,
2184          p_group_name,
2185                         p_bg_id);
2186    --
2187   IF g_debug THEN
2188     hr_utility.set_location( g_package || l_proc, 20);
2189   END IF;
2190    update_scl(
2191       p_scl_id,
2192       p_scl_concat);
2193    --
2194    -- Now insert assignment budget values from the defaults for this
2195    -- bg.
2196    -- NB to_char(0)'s are last_updated_by and last_update_login which
2197    -- are varchar2 parameters in load_budget_values.
2198    --
2199   IF g_debug THEN
2200     hr_utility.set_location( g_package || l_proc, 30);
2201   END IF;
2202    hr_assignment.load_budget_values(
2203       p_ass_id,
2204       p_bg_id,
2205       to_char(0),
2206       to_char(0),
2207       p_val_st_date,
2208       p_eot);
2209    --
2210    -- To load default assignment cost allocations
2211    --
2212   IF g_debug THEN
2213     hr_utility.set_location( g_package || l_proc, 40);
2214   END IF;
2215         declare
2216              l_position_id       number;
2217              --
2218              cursor c_position is
2219              select position_id
2220              from per_all_assignments
2221              where assignment_id = p_ass_id;
2222         begin
2223           --
2224           open c_position;
2225           fetch c_position into l_position_id;
2226           close c_position;
2227           --
2228   IF g_debug THEN
2229     hr_utility.set_location( g_package || l_proc, 45);
2230   END IF;
2231           hr_assignment.load_assignment_allocation
2232                                   (p_assignment_id => p_ass_id
2233                                   ,p_business_group_id => p_bg_id
2234                                   ,p_effective_date =>p_val_st_date
2235                                   ,p_position_id => l_position_id);
2236         end;
2237    --
2238    -- Insert element entries for new assignment, 1st 2 parameters are
2239    -- dt update and delete modes - ensure these are null.
2240    --
2241   IF g_debug THEN
2242     hr_utility.set_location( g_package || l_proc, 50);
2243   END IF;
2244    maintain_entries(
2245       null,
2246          null,
2247          p_per_sys_st,
2248          p_sess_date,
2249          p_val_st_date,
2250             p_val_end_date,
2251          p_new_end_date,
2252          p_ass_id,
2253             p_bg_id,
2254       p_old_pay_id,
2255       p_new_pay_id,
2256       null,    -- p_old_pg_id. Added for bug#3924690.
2257       null,    -- p_new_pg_id. Added for bug#3924690.
2258       null,    -- Added for Bug#13960540
2259       null,    -- Added for Bug#13960540
2260       null,    -- Added for Bug#13960540
2261       null,    -- Added for Bug#13960540
2262       null,    -- Added for Bug#13960540
2263       null,    -- Added for Bug#13960540
2264       l_raise_warning);
2265    --
2266         if l_raise_warning in ('Y','S') then
2267            if l_raise_warning = 'Y' then
2268               p_warning := 'HR_7016_ASS_ENTRIES_CHANGED';
2269            else
2270               p_warning := 'HR_7442_ASS_SAL_ENT_CHANGED';
2271            end if;
2272                    --
2273    end if;
2274   --
2275   -- Payroll Object Group functionality, requires call to
2276   -- pay_pog_all_assignments_pkg. This is designed to be called from a row
2277   -- handler user hook, hence has many parameters that are not available here.
2278   -- So a cursor is used to return the values, to pass to the pog procedure.
2279   --
2280   IF g_debug THEN
2281     hr_utility.set_location( g_package || l_proc, 60);
2282   END IF;
2283   OPEN asg_details(p_ass_id, p_sess_date);
2284   FETCH asg_details into ins_asg_rec;
2285   IF asg_details%NOTFOUND THEN
2286     CLOSE asg_details;
2287     hr_utility.trace('no rows for asg_details');
2288   ELSE
2289     CLOSE asg_details;
2290   END IF;
2291   --
2292   IF g_debug THEN
2293     hr_utility.set_location( g_package || l_proc, 70);
2294   END IF;
2295   dt_api.validate_dt_mode
2296   (p_effective_date          => p_sess_date
2297   ,p_datetrack_mode          => 'INSERT'
2298   ,p_base_table_name         => 'per_all_assignments_f'
2299   ,p_base_key_column         => 'assignment_id'
2300   ,p_base_key_value          => p_ass_id
2301   ,p_validation_start_date   => l_vsd
2302   ,p_validation_end_date     => l_ved
2303   );
2304   --
2305   IF g_debug THEN
2306     hr_utility.set_location( g_package || l_proc, 80);
2307   END IF;
2308 
2309   pay_pog_all_assignments_pkg.after_insert
2310   (p_effective_date             => p_sess_date
2311   ,p_validation_start_date      => l_vsd
2312   ,p_validation_end_date        => l_ved
2313   ,P_APPLICANT_RANK             => ins_asg_rec.applicant_rank
2314   ,P_APPLICATION_ID             => ins_asg_rec.program_application_id
2315   ,P_ASSIGNMENT_CATEGORY        => ins_asg_rec.assignment_category
2316   ,P_ASSIGNMENT_ID              => ins_asg_rec.assignment_id
2317   ,P_ASSIGNMENT_NUMBER          => ins_asg_rec.assignment_number
2318   ,P_ASSIGNMENT_SEQUENCE        => ins_asg_rec.assignment_sequence
2319   ,P_ASSIGNMENT_STATUS_TYPE_ID  => ins_asg_rec.assignment_status_type_id
2320   ,P_ASSIGNMENT_TYPE            => ins_asg_rec.assignment_type
2321   ,P_ASS_ATTRIBUTE1             => ins_asg_rec.ass_attribute1
2322   ,P_ASS_ATTRIBUTE10            => ins_asg_rec.ass_attribute10
2323   ,P_ASS_ATTRIBUTE11            => ins_asg_rec.ass_attribute11
2324   ,P_ASS_ATTRIBUTE12            => ins_asg_rec.ass_attribute12
2325   ,P_ASS_ATTRIBUTE13            => ins_asg_rec.ass_attribute13
2326   ,P_ASS_ATTRIBUTE14            => ins_asg_rec.ass_attribute14
2327   ,P_ASS_ATTRIBUTE15            => ins_asg_rec.ass_attribute15
2328   ,P_ASS_ATTRIBUTE16            => ins_asg_rec.ass_attribute16
2329   ,P_ASS_ATTRIBUTE17            => ins_asg_rec.ass_attribute17
2330   ,P_ASS_ATTRIBUTE18            => ins_asg_rec.ass_attribute18
2331   ,P_ASS_ATTRIBUTE19            => ins_asg_rec.ass_attribute19
2332   ,P_ASS_ATTRIBUTE2             => ins_asg_rec.ass_attribute2
2333   ,P_ASS_ATTRIBUTE20            => ins_asg_rec.ass_attribute20
2334   ,P_ASS_ATTRIBUTE21            => ins_asg_rec.ass_attribute21
2335   ,P_ASS_ATTRIBUTE22            => ins_asg_rec.ass_attribute22
2336   ,P_ASS_ATTRIBUTE23            => ins_asg_rec.ass_attribute23
2337   ,P_ASS_ATTRIBUTE24            => ins_asg_rec.ass_attribute24
2338   ,P_ASS_ATTRIBUTE25            => ins_asg_rec.ass_attribute25
2339   ,P_ASS_ATTRIBUTE26            => ins_asg_rec.ass_attribute26
2340   ,P_ASS_ATTRIBUTE27            => ins_asg_rec.ass_attribute27
2341   ,P_ASS_ATTRIBUTE28            => ins_asg_rec.ass_attribute28
2342   ,P_ASS_ATTRIBUTE29            => ins_asg_rec.ass_attribute29
2343   ,P_ASS_ATTRIBUTE3             => ins_asg_rec.ass_attribute3
2344   ,P_ASS_ATTRIBUTE30            => ins_asg_rec.ass_attribute30
2345   ,P_ASS_ATTRIBUTE4             => ins_asg_rec.ass_attribute4
2346   ,P_ASS_ATTRIBUTE5             => ins_asg_rec.ass_attribute5
2347   ,P_ASS_ATTRIBUTE6             => ins_asg_rec.ass_attribute6
2348   ,P_ASS_ATTRIBUTE7             => ins_asg_rec.ass_attribute7
2349   ,P_ASS_ATTRIBUTE8             => ins_asg_rec.ass_attribute8
2350   ,P_ASS_ATTRIBUTE9             => ins_asg_rec.ass_attribute9
2351   ,P_ASS_ATTRIBUTE_CATEGORY     => ins_asg_rec.ass_attribute_category
2352   ,P_BARGAINING_UNIT_CODE       => ins_asg_rec.bargaining_unit_code
2353   ,P_BUSINESS_GROUP_ID          => ins_asg_rec.business_group_id
2354   ,P_CAGR_GRADE_DEF_ID          => ins_asg_rec.cagr_grade_def_id
2355   ,P_CAGR_ID_FLEX_NUM           => ins_asg_rec.cagr_id_flex_num
2356   ,P_CHANGE_REASON              => ins_asg_rec.change_reason
2357   ,P_COLLECTIVE_AGREEMENT_ID    => ins_asg_rec.collective_agreement_id
2358   ,P_COMMENT_ID                 => ins_asg_rec.comment_id
2359   ,P_CONTRACT_ID                => ins_asg_rec.contract_id
2360   ,P_DATE_PROBATION_END         => ins_asg_rec.date_probation_end
2361   ,P_DEFAULT_CODE_COMB_ID       => ins_asg_rec.default_code_comb_id
2362   ,P_EFFECTIVE_END_DATE         => ins_asg_rec.effective_end_date
2363   ,P_EFFECTIVE_START_DATE       => ins_asg_rec.effective_start_date
2364   ,P_EMPLOYEE_CATEGORY          => ins_asg_rec.employee_category
2365   ,P_EMPLOYMENT_CATEGORY        => ins_asg_rec.employment_category
2366   ,P_ESTABLISHMENT_ID           => ins_asg_rec.establishment_id
2367   ,P_FREQUENCY                  => ins_asg_rec.frequency
2368   ,P_GRADE_ID                   => ins_asg_rec.grade_id
2369   ,P_HOURLY_SALARIED_CODE       => ins_asg_rec.hourly_salaried_code
2370   ,P_INTERNAL_ADDRESS_LINE      => ins_asg_rec.internal_address_line
2371   ,P_JOB_ID                     => ins_asg_rec.job_id
2372   ,P_JOB_POST_SOURCE_NAME       => ins_asg_rec.job_post_source_name
2373   ,P_LABOUR_UNION_MEMBER_FLAG   => ins_asg_rec.labour_union_member_flag
2374   ,P_LOCATION_ID                => ins_asg_rec.location_id
2375   ,P_MANAGER_FLAG               => ins_asg_rec.manager_flag
2376   ,P_NORMAL_HOURS               => ins_asg_rec.normal_hours
2377   ,P_NOTICE_PERIOD              => ins_asg_rec.notice_period
2378   ,P_NOTICE_PERIOD_UOM          => ins_asg_rec.notice_period_uom
2379   ,P_OBJECT_VERSION_NUMBER      => ins_asg_rec.object_version_number
2380   ,P_ORGANIZATION_ID            => ins_asg_rec.organization_id
2381   ,P_PAYROLL_ID                 => ins_asg_rec.payroll_id
2382   ,P_PAY_BASIS_ID               => ins_asg_rec.pay_basis_id
2383   ,P_PEOPLE_GROUP_ID            => ins_asg_rec.people_group_id
2384   ,P_PERF_REVIEW_PERIOD         => ins_asg_rec.perf_review_period
2385   ,P_PERF_REVIEW_PERIOD_FREQUEN => ins_asg_rec.perf_review_period_frequency
2386   ,P_PERIOD_OF_SERVICE_ID       => ins_asg_rec.period_of_service_id
2387   ,P_PERSON_ID                  => ins_asg_rec.person_id
2388   ,P_PERSON_REFERRED_BY_ID      => ins_asg_rec.person_referred_by_id
2389   ,P_PLACEMENT_DATE_START       => ins_asg_rec.period_of_placement_date_start
2390   ,P_POSITION_ID                => ins_asg_rec.position_id
2391   ,P_POSTING_CONTENT_ID         => ins_asg_rec.posting_content_id
2392   ,P_PRIMARY_FLAG               => ins_asg_rec.primary_flag
2393   ,P_PROBATION_PERIOD           => ins_asg_rec.probation_period
2394   ,P_PROBATION_UNIT             => ins_asg_rec.probation_unit
2395   ,P_PROGRAM_APPLICATION_ID     => ins_asg_rec.program_application_id
2396   ,P_PROGRAM_ID                 => ins_asg_rec.program_id
2397   ,P_PROGRAM_UPDATE_DATE        => ins_asg_rec.program_update_date
2398   ,P_PROJECT_TITLE              => ins_asg_rec.project_title
2399   ,P_RECRUITER_ID               => ins_asg_rec.recruiter_id
2400   ,P_RECRUITMENT_ACTIVITY_ID    => ins_asg_rec.recruitment_activity_id
2401   ,P_REQUEST_ID                 => ins_asg_rec.request_id
2402   ,P_SAL_REVIEW_PERIOD          => ins_asg_rec.sal_review_period
2403   ,P_SAL_REVIEW_PERIOD_FREQUEN  => ins_asg_rec.sal_review_period_frequency
2404   ,P_SET_OF_BOOKS_ID            => ins_asg_rec.set_of_books_id
2405   ,P_SOFT_CODING_KEYFLEX_ID     => ins_asg_rec.soft_coding_keyflex_id
2406   ,P_SOURCE_ORGANIZATION_ID     => ins_asg_rec.source_organization_id
2407   ,P_SOURCE_TYPE                => ins_asg_rec.source_type
2408   ,P_SPECIAL_CEILING_STEP_ID    => ins_asg_rec.special_ceiling_step_id
2409   ,P_SUPERVISOR_ID              => ins_asg_rec.supervisor_id
2410   ,P_TIME_NORMAL_FINISH         => ins_asg_rec.time_normal_finish
2411   ,P_TIME_NORMAL_START          => ins_asg_rec.time_normal_start
2412   ,P_TITLE                      => ins_asg_rec.title
2413   ,P_VACANCY_ID                 => ins_asg_rec.vacancy_id
2414   ,P_VENDOR_ASSIGNMENT_NUMBER   => ins_asg_rec.vendor_assignment_number
2415   ,P_VENDOR_EMPLOYEE_NUMBER     => ins_asg_rec.vendor_employee_number
2416   ,P_VENDOR_ID                  => ins_asg_rec.vendor_id
2417   ,P_WORK_AT_HOME               => ins_asg_rec.work_at_home
2418   ,P_GRADE_LADDER_PGM_ID        => ins_asg_rec.grade_ladder_pgm_id
2419   ,P_SUPERVISOR_ASSIGNMENT_ID   => ins_asg_rec.supervisor_assignment_id
2420   ,P_VENDOR_SITE_ID             => ins_asg_rec.vendor_site_id
2421   ,P_PO_HEADER_ID               => ins_asg_rec.po_header_id
2422   ,P_PO_LINE_ID                 => ins_asg_rec.po_line_id
2423   ,P_PROJECTED_ASSIGNMENT_END   => ins_asg_rec.projected_assignment_end
2424   );
2425   IF g_debug THEN
2426     hr_utility.set_location( 'Leaving ' || g_package || l_proc, 10);
2427   END IF;
2428 
2429 end post_insert;
2430 -----------------------------------------------------------------------------
2431 procedure post_delete(
2432    p_ass_id    number,
2433    p_grd_id    number,
2434    p_sess_date    date,
2435    p_new_end_date    date,
2436    p_val_end_date    date,
2437    p_eff_end_date    date,
2438    p_del_mode     varchar2,
2439    p_val_st_date     date,
2440    p_new_prim_flag      varchar2,
2441    p_eot       date,
2442    p_pd_os_id     number,
2443    p_new_prim_ass_id IN OUT NOCOPY number,
2444    p_prim_change_flag   IN OUT NOCOPY varchar2,
2445    p_per_sys_st      varchar2,
2446    p_bg_id        number,
2447    p_old_pay_id      number,
2448    p_new_pay_id      number,
2449    p_cancel_atd      date,
2450         p_cancel_lspd      date,
2451         p_reterm_atd    date,
2452         p_reterm_lspd      date,
2453    p_warning      IN OUT NOCOPY varchar2,
2454    p_future_spp_warning OUT NOCOPY boolean,
2455    p_cost_warning          OUT NOCOPY boolean) is
2456    l_raise_warning      varchar2(1);
2457    l_calling_proc    varchar2(30);
2458    l_future_spp_warnings   boolean;
2459  l_dummy_warning         boolean;
2460    l_Cost_warning          boolean;
2461  --
2462  l_proc VARCHAR2(72) := g_package||'post_delete';
2463  --
2464   -- Payroll Object Group functionality. Not all the values required for call
2465   -- to pay_pog_all_assignments_pkg are available, so cursor is used to get the
2466   -- values.
2467   --
2468   cursor cur_asg_details(p_asg_id number
2469                         ,p_eff_date date)
2470   is
2471   select effective_start_date
2472   ,      object_version_number
2473   ,      business_group_id
2474   from   per_all_assignments_f
2475   where  assignment_id = p_asg_id
2476   and    p_eff_date between effective_start_date
2477                         and effective_end_date;
2478   --
2479   l_esd date;
2480   l_ovn number;
2481   l_bg_id number;
2482   --
2483 begin
2484   --
2485   hr_utility.set_location('Entering : '||l_proc,10);
2486   --
2487   --
2488   hr_assignment_internal.maintain_spp_asg
2489     (p_assignment_id                => p_ass_id
2490     ,p_datetrack_mode               => p_del_mode
2491     ,p_validation_start_date        => p_val_st_Date
2492     ,p_validation_end_date          => p_val_end_date
2493     ,p_grade_id                           => p_grd_id
2494     ,p_spp_delete_warning           => l_future_spp_warnings);
2495   --
2496   hr_utility.set_location(l_proc,20);
2497   --
2498     if p_del_mode in ('FUTURE_CHANGE', 'DELETE_NEXT_CHANGE') then
2499         --
2500         l_calling_proc := 'POST_DELETE';
2501         --
2502     hr_utility.set_location(l_proc||' / '||p_del_mode,30);
2503     --
2504       future_del_cleanup
2505       (p_ass_id,
2506        p_grd_id,
2507        p_sess_date,
2508              l_calling_proc,
2509        p_val_st_date,
2510        p_val_end_date,
2511            p_del_mode,
2512              l_dummy_warning);
2513     --
2514         if p_new_end_date is null then
2515             --
2516             if p_val_end_date = p_eot then
2517                 --
2518                 tidy_up_ref_int(
2519                               'FUTURE',
2520                               p_sess_date,
2521                               p_new_end_date,
2522                               p_val_end_date,
2523                               p_eff_end_date,
2524                               p_ass_id,
2525                                     l_cost_warning);
2526         --
2527           end if;
2528       --
2529       else
2530       --
2531             l_calling_proc := 'POST_DELETE';
2532       --
2533             hr_utility.set_location(l_proc,40);
2534 
2535             hr_assignment.del_ref_int_delete(
2536                p_ass_id,
2537                p_grd_id,
2538                'END',
2539                p_new_end_date,
2540                 0, 0,
2541                 l_calling_proc,
2542                 p_val_st_date,
2543                 p_val_end_date,
2544                p_del_mode,
2545               l_dummy_warning);
2546             --
2547             -- NB l_cost_warning is not set in this sceanrio. It
2548             -- is only used if mode is FUTURE.
2549             --
2550             tidy_up_ref_int
2551         ('INT-END',
2552          p_sess_date,
2553          p_new_end_date,
2554          p_val_end_date,
2555          p_eff_end_date,
2556          p_ass_id,
2557             l_cost_warning);
2558             --
2559       end if;
2560         --
2561     elsif p_del_mode = 'ZAP' then
2562       --
2563         -- Delete any of the assignments' children records.
2564         -- Warn the user that any associated assignment status,
2565       -- nonrecurring entry, or recurring entry records will be
2566       -- deleted, and prompt the user to continue. Then delete any
2567       -- such records. Checks are performed to ensure that
2568       -- nonrecurring or recurring entry records exist before
2569       -- deleting them, as this improves performance.
2570         --
2571       l_calling_proc := 'POST_DELETE';
2572     --
2573       hr_utility.set_location(l_proc,50);
2574 
2575       hr_assignment.del_ref_int_delete(
2576             p_ass_id,
2577             null,
2578             'ZAP',
2579             p_val_st_date,
2580             0, 0,
2581             l_calling_proc,
2582             p_val_st_date,
2583             p_val_end_date,
2584             p_del_mode,
2585             l_dummy_warning);
2586     --
2587   end if;
2588    --
2589     if p_prim_change_flag = 'Y' then
2590     --
2591         hr_utility.set_location(l_proc,60);
2592 
2593         iud_update_primary(
2594                         p_del_mode,
2595                         p_new_prim_flag,
2596                         p_val_st_date,
2597                         p_new_end_date,
2598                         p_eot,
2599                         p_pd_os_id,
2600                         p_ass_id,
2601                         p_new_prim_ass_id,
2602                         p_prim_change_flag);
2603     --
2604     end if;
2605    --
2606     --  If TERM_ASSIGN statuses were removed or if the END status was
2607     --  overridden then a new end date may need to be set. This was
2608     --  determined in the HR_ASSIGNMENT.CHECK_TERM server-side pkg
2609     --  called from the CHECK_TERM_BY_POS call (in
2610     --  update_and_delete_bundle) and a value for the new end date will
2611     --  have been put in P_NEW_END_DATE.
2612     --
2613     if p_del_mode in ('DELETE_NEXT_CHANGE', 'FUTURE_CHANGE') then
2614     --
2615       if p_new_end_date is not null then
2616       --
2617             set_end_date
2618         (p_new_end_date,
2619          p_ass_id);
2620       --
2621       end if;
2622     --
2623     end if;
2624     --
2625     hr_utility.set_location(l_proc,70);
2626 
2627     do_cancel_reterm(
2628          p_ass_id,
2629          p_bg_id,
2630          p_cancel_atd,
2631          p_cancel_lspd,
2632          p_reterm_atd,
2633          p_reterm_lspd);
2634     --
2635     -- Pass null p_upd_mode.
2636     --
2637     hr_utility.set_location(l_proc,80);
2638 
2639     maintain_entries
2640     (null,
2641       p_del_mode,
2642       p_per_sys_st,
2643       p_sess_date,
2644       p_val_st_date,
2645       p_val_end_date,
2646       p_new_end_date,
2647       p_ass_id,
2648       p_bg_id,
2649       p_old_pay_id,
2650       p_new_pay_id,
2651       null,    -- p_old_pg_id. Added for bug#3924690.
2652       null,    -- p_new_pg_id. Added for bug#3924690.
2653       null,    -- Added for Bug#13960540
2654       null,    -- Added for Bug#13960540
2655       null,     -- Added for Bug#13960540
2656       null,    -- Added for Bug#13960540
2657       null,    -- Added for Bug#13960540
2658       null,    -- Added for Bug#13960540
2659          l_raise_warning);
2660     --
2661     if l_raise_warning in ('Y','S') then
2662     --
2663     if l_raise_warning = 'Y' then
2664       --
2665          p_warning := 'HR_7016_ASS_ENTRIES_CHANGED';
2666       --
2667     else
2668       --
2669          p_warning := 'HR_7442_ASS_SAL_ENT_CHANGED';
2670       --
2671     end if;
2672     --
2673   end if;
2674   --
2675   -- Bug 16091156
2676   per_saladmin_utility.adjust_pay_proposals(p_ass_id);
2677   --
2678   p_cost_warning := l_cost_warning;
2679   p_future_spp_warning := l_future_spp_warnings;
2680       --
2681   --
2682   -- Payroll Object Group functionality, requires call to
2683   -- pay_pog_all_assignments_pkg. This is designed to be called from a row
2684   -- handler user hook, hence has many parameters that are not available here.
2685   -- So a cursor is used to return those values that are not available to this
2686   -- procedure. The 'old' values have been selected into a record in the
2687   -- pre_delete procedure
2688   --
2689   hr_utility.set_location(l_proc,90);
2690   OPEN cur_asg_details(p_ass_id, p_sess_date);
2691   FETCH cur_asg_details into l_esd, l_ovn, l_bg_id;
2692   IF cur_asg_details%NOTFOUND THEN
2693     CLOSE cur_asg_details;
2694     hr_utility.trace('no rows from cur_asg_details');
2695     --
2696     -- if ZAP mode no rows returned, setup l_ovn and l_esd
2697     --
2698     IF p_del_mode = 'ZAP' THEN
2699       l_ovn := per_assignments_f2_pkg.g_old_asg_rec.object_version_number;
2700       l_esd := per_assignments_f2_pkg.g_old_asg_rec.effective_start_date;
2701     ELSE
2702       hr_utility.trace('Not zap - error');
2703     END IF;
2704   ELSE
2705     CLOSE cur_asg_details;
2706   END IF;
2707   --
2708   -- call temporary POG package
2709   --
2710   hr_utility.set_location(l_proc,100);
2711   pay_pog_all_assignments_pkg.after_delete
2712   (p_effective_date               => p_sess_date
2713   ,p_datetrack_mode               => p_del_mode
2714   ,p_validation_start_date        => p_val_st_date
2715   ,p_validation_end_date          => p_val_end_date
2716   ,P_ASSIGNMENT_ID                => p_ass_id
2717   ,P_EFFECTIVE_END_DATE           => p_eff_end_date
2718   ,P_EFFECTIVE_START_DATE         => l_esd
2719   ,P_OBJECT_VERSION_NUMBER        => l_ovn
2720   ,P_ORG_NOW_NO_MANAGER_WARNING   => null
2721   ,P_APPLICANT_RANK_O
2722      => per_assignments_f2_pkg.g_old_asg_rec.applicant_rank
2723   ,P_APPLICATION_ID_O
2724      => per_assignments_f2_pkg.g_old_asg_rec.application_id
2725   ,P_ASSIGNMENT_CATEGORY_O
2726      => per_assignments_f2_pkg.g_old_asg_rec.assignment_category
2727   ,P_ASSIGNMENT_NUMBER_O
2728      => per_assignments_f2_pkg.g_old_asg_rec.assignment_number
2729   ,P_ASSIGNMENT_SEQUENCE_O
2730      => per_assignments_f2_pkg.g_old_asg_rec.assignment_sequence
2731   ,P_ASSIGNMENT_STATUS_TYPE_ID_O
2732      => per_assignments_f2_pkg.g_old_asg_rec.assignment_status_type_id
2733   ,P_ASSIGNMENT_TYPE_O
2734      => per_assignments_f2_pkg.g_old_asg_rec.assignment_type
2735   ,P_ASS_ATTRIBUTE1_O
2736      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute1
2737   ,P_ASS_ATTRIBUTE10_O
2738      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute10
2739   ,P_ASS_ATTRIBUTE11_O
2740      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute11
2741   ,P_ASS_ATTRIBUTE12_O
2742      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute12
2743   ,P_ASS_ATTRIBUTE13_O
2744      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute13
2745   ,P_ASS_ATTRIBUTE14_O
2746      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute14
2747   ,P_ASS_ATTRIBUTE15_O
2748      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute15
2749   ,P_ASS_ATTRIBUTE16_O
2750      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute16
2751   ,P_ASS_ATTRIBUTE17_O
2752      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute17
2753   ,P_ASS_ATTRIBUTE18_O
2754      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute18
2755   ,P_ASS_ATTRIBUTE19_O
2756      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute19
2757   ,P_ASS_ATTRIBUTE2_O
2758      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute2
2759   ,P_ASS_ATTRIBUTE20_O
2760      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute20
2761   ,P_ASS_ATTRIBUTE21_O
2762      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute21
2763   ,P_ASS_ATTRIBUTE22_O
2764      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute22
2765   ,P_ASS_ATTRIBUTE23_O
2766      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute23
2767   ,P_ASS_ATTRIBUTE24_O
2768     => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute24
2769   ,P_ASS_ATTRIBUTE25_O
2770      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute25
2771   ,P_ASS_ATTRIBUTE26_O
2772      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute26
2773   ,P_ASS_ATTRIBUTE27_O
2774     => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute27
2775   ,P_ASS_ATTRIBUTE28_O
2776     => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute28
2777   ,P_ASS_ATTRIBUTE29_O
2778      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute29
2779   ,P_ASS_ATTRIBUTE3_O
2780      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute3
2781   ,P_ASS_ATTRIBUTE30_O
2782      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute30
2783   ,P_ASS_ATTRIBUTE4_O
2784      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute4
2785   ,P_ASS_ATTRIBUTE5_O
2786      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute5
2787   ,P_ASS_ATTRIBUTE6_O
2788      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute6
2789   ,P_ASS_ATTRIBUTE7_O
2790      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute7
2791   ,P_ASS_ATTRIBUTE8_O
2792      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute8
2793   ,P_ASS_ATTRIBUTE9_O
2794      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute9
2795   ,P_ASS_ATTRIBUTE_CATEGORY_O
2796      => per_assignments_f2_pkg.g_old_asg_rec.ass_attribute_category
2797   ,P_BARGAINING_UNIT_CODE_O
2798      => per_assignments_f2_pkg.g_old_asg_rec.bargaining_unit_code
2799   ,P_BUSINESS_GROUP_ID_O
2800      => p_bg_id
2801   ,P_CAGR_GRADE_DEF_ID_O
2802      => per_assignments_f2_pkg.g_old_asg_rec.cagr_grade_def_id
2803   ,P_CAGR_ID_FLEX_NUM_O
2804      => per_assignments_f2_pkg.g_old_asg_rec.cagr_id_flex_num
2805   ,P_CHANGE_REASON_O
2806      => per_assignments_f2_pkg.g_old_asg_rec.change_reason
2807   ,P_COLLECTIVE_AGREEMENT_ID_O
2808      => per_assignments_f2_pkg.g_old_asg_rec.collective_agreement_id
2809   ,P_COMMENT_ID_O
2810      => per_assignments_f2_pkg.g_old_asg_rec.comment_id
2811   ,P_CONTRACT_ID_O
2812      => per_assignments_f2_pkg.g_old_asg_rec.contract_id
2813   ,P_DATE_PROBATION_END_O
2814      => per_assignments_f2_pkg.g_old_asg_rec.date_probation_end
2815   ,P_DEFAULT_CODE_COMB_ID_O
2816      => per_assignments_f2_pkg.g_old_asg_rec.default_code_comb_id
2817   ,P_EFFECTIVE_END_DATE_O
2818      => per_assignments_f2_pkg.g_old_asg_rec.effective_end_date
2819   ,P_EFFECTIVE_START_DATE_O
2820      => per_assignments_f2_pkg.g_old_asg_rec.effective_start_date
2821   ,P_EMPLOYEE_CATEGORY_O
2822      => per_assignments_f2_pkg.g_old_asg_rec.employee_category
2823   ,P_EMPLOYMENT_CATEGORY_O
2824      => per_assignments_f2_pkg.g_old_asg_rec.employment_category
2825   ,P_ESTABLISHMENT_ID_O
2826      => per_assignments_f2_pkg.g_old_asg_rec.establishment_id
2827   ,P_FREQUENCY_O
2828      => per_assignments_f2_pkg.g_old_asg_rec.frequency
2829   ,P_GRADE_ID_O
2830      => per_assignments_f2_pkg.g_old_asg_rec.grade_id
2831   ,P_HOURLY_SALARIED_CODE_O
2832      => per_assignments_f2_pkg.g_old_asg_rec.hourly_salaried_code
2833   ,P_INTERNAL_ADDRESS_LINE_O
2834      => per_assignments_f2_pkg.g_old_asg_rec.internal_address_line
2835   ,P_JOB_ID_O
2836      => per_assignments_f2_pkg.g_old_asg_rec.job_id
2837   ,P_JOB_POST_SOURCE_NAME_O
2838      => per_assignments_f2_pkg.g_old_asg_rec.job_post_source_name
2839   ,P_LABOUR_UNION_MEMBER_FLAG_O
2840      => per_assignments_f2_pkg.g_old_asg_rec.labour_union_member_flag
2841   ,P_LOCATION_ID_O
2842      => per_assignments_f2_pkg.g_old_asg_rec.location_id
2843   ,P_MANAGER_FLAG_O
2844      => per_assignments_f2_pkg.g_old_asg_rec.manager_flag
2845   ,P_NORMAL_HOURS_O
2846      => per_assignments_f2_pkg.g_old_asg_rec.normal_hours
2847   ,P_NOTICE_PERIOD_O
2848      => per_assignments_f2_pkg.g_old_asg_rec.notice_period
2849   ,P_NOTICE_PERIOD_UOM_O
2850      => per_assignments_f2_pkg.g_old_asg_rec.notice_period_uom
2851   ,P_OBJECT_VERSION_NUMBER_O
2852      => per_assignments_f2_pkg.g_old_asg_rec.object_version_number
2853   ,P_ORGANIZATION_ID_O
2854      => per_assignments_f2_pkg.g_old_asg_rec.organization_id
2855   ,P_PAYROLL_ID_O
2856      => per_assignments_f2_pkg.g_old_asg_rec.payroll_id
2857   ,P_PAY_BASIS_ID_O
2858      => per_assignments_f2_pkg.g_old_asg_rec.pay_basis_id
2859   ,P_PEOPLE_GROUP_ID_O
2860      => per_assignments_f2_pkg.g_old_asg_rec.people_group_id
2861   ,P_PERF_REVIEW_PERIOD_O
2862      => per_assignments_f2_pkg.g_old_asg_rec.perf_review_period
2863   ,P_PERF_REVIEW_PERIOD_FREQUEN_O
2864      => per_assignments_f2_pkg.g_old_asg_rec.perf_review_period_frequency
2865   ,P_PERIOD_OF_SERVICE_ID_O
2866      => per_assignments_f2_pkg.g_old_asg_rec.period_of_service_id
2867   ,P_PERSON_ID_O
2868      => per_assignments_f2_pkg.g_old_asg_rec.person_id
2869   ,P_PERSON_REFERRED_BY_ID_O
2870      => per_assignments_f2_pkg.g_old_asg_rec.person_referred_by_id
2871   ,P_PLACEMENT_DATE_START_O
2872      => per_assignments_f2_pkg.g_old_asg_rec.period_of_placement_date_start
2873   ,P_POSITION_ID_O
2874      => per_assignments_f2_pkg.g_old_asg_rec.position_id
2875   ,P_POSTING_CONTENT_ID_O
2876      => per_assignments_f2_pkg.g_old_asg_rec.posting_content_id
2877   ,P_PRIMARY_FLAG_O
2878      => per_assignments_f2_pkg.g_old_asg_rec.primary_flag
2879   ,P_PROBATION_PERIOD_O
2880      => per_assignments_f2_pkg.g_old_asg_rec.probation_period
2881   ,P_PROBATION_UNIT_O
2882      => per_assignments_f2_pkg.g_old_asg_rec.probation_unit
2883   ,P_PROGRAM_APPLICATION_ID_O
2884      => per_assignments_f2_pkg.g_old_asg_rec.program_application_id
2885   ,P_PROGRAM_ID_O
2886      => per_assignments_f2_pkg.g_old_asg_rec.program_id
2887   ,P_PROGRAM_UPDATE_DATE_O
2888      => per_assignments_f2_pkg.g_old_asg_rec.program_update_date
2889   ,P_PROJECT_TITLE_O
2890      => per_assignments_f2_pkg.g_old_asg_rec.project_title
2891   ,P_RECRUITER_ID_O
2892      => per_assignments_f2_pkg.g_old_asg_rec.recruiter_id
2893   ,P_RECRUITMENT_ACTIVITY_ID_O
2894      => per_assignments_f2_pkg.g_old_asg_rec.recruitment_activity_id
2895   ,P_REQUEST_ID_O
2896      => per_assignments_f2_pkg.g_old_asg_rec.request_id
2897   ,P_SAL_REVIEW_PERIOD_O
2898      => per_assignments_f2_pkg.g_old_asg_rec.sal_review_period
2899   ,P_SAL_REVIEW_PERIOD_FREQUEN_O
2900      => per_assignments_f2_pkg.g_old_asg_rec.sal_review_period_frequency
2901   ,P_SET_OF_BOOKS_ID_O
2902      => per_assignments_f2_pkg.g_old_asg_rec.set_of_books_id
2903   ,P_SOFT_CODING_KEYFLEX_ID_O
2904      => per_assignments_f2_pkg.g_old_asg_rec.soft_coding_keyflex_id
2905   ,P_SOURCE_ORGANIZATION_ID_O
2906     => per_assignments_f2_pkg.g_old_asg_rec.source_organization_id
2907   ,P_SOURCE_TYPE_O
2908      => per_assignments_f2_pkg.g_old_asg_rec.source_type
2909   ,P_SPECIAL_CEILING_STEP_ID_O
2910      => per_assignments_f2_pkg.g_old_asg_rec.special_ceiling_step_id
2911   ,P_SUPERVISOR_ID_O
2912      => per_assignments_f2_pkg.g_old_asg_rec.supervisor_id
2913   ,P_TIME_NORMAL_FINISH_O
2914      => per_assignments_f2_pkg.g_old_asg_rec.time_normal_finish
2915   ,P_TIME_NORMAL_START_O
2916      => per_assignments_f2_pkg.g_old_asg_rec.time_normal_start
2917   ,P_TITLE_O
2918      => per_assignments_f2_pkg.g_old_asg_rec.title
2919   ,P_VACANCY_ID_O
2920      => per_assignments_f2_pkg.g_old_asg_rec.vacancy_id
2921   ,P_VENDOR_ASSIGNMENT_NUMBER_O
2922      => per_assignments_f2_pkg.g_old_asg_rec.vendor_assignment_number
2923   ,P_VENDOR_EMPLOYEE_NUMBER_O
2924     => per_assignments_f2_pkg.g_old_asg_rec.vendor_employee_number
2925   ,P_VENDOR_ID_O
2926      => per_assignments_f2_pkg.g_old_asg_rec.vendor_id
2927   ,P_WORK_AT_HOME_O
2928      => per_assignments_f2_pkg.g_old_asg_rec.work_at_home
2929   ,P_GRADE_LADDER_PGM_ID_O
2930      => per_assignments_f2_pkg.g_old_asg_rec.grade_ladder_pgm_id
2931   ,P_SUPERVISOR_ASSIGNMENT_ID_O
2932      => per_assignments_f2_pkg.g_old_asg_rec.supervisor_assignment_id
2933   ,P_VENDOR_SITE_ID_O
2934      => per_assignments_f2_pkg.g_old_asg_rec.vendor_site_id
2935   ,P_PO_HEADER_ID_O
2936      => per_assignments_f2_pkg.g_old_asg_rec.po_header_id
2937   ,P_PO_LINE_ID_O
2938      => per_assignments_f2_pkg.g_old_asg_rec.po_line_id
2939   ,P_PROJECTED_ASSIGNMENT_END_O
2940      => per_assignments_f2_pkg.g_old_asg_rec.projected_assignment_end
2941   );
2942   --
2943   hr_utility.set_location('Leaving : '||l_proc,999);
2944   --
2945 end post_delete;
2946 -----------------------------------------------------------------------------
2947 END PER_ASSIGNMENTS_F1_PKG;