DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ASSIGNMENTS_F_PKG

Source


1 PACKAGE BODY PER_ASSIGNMENTS_F_PKG AS
2 /* $Header: peasg01t.pkb 120.29.12010000.3 2008/09/29 05:42:27 ubhat ship $ */
3 -----------------------------------------------------------------------------
4 --
5 --  **** Standard ON-* procedures of base view. *****
6 --
7 -----------------------------------------------------------------------------
8 --
9 -- Standard Insert procedure
10 --
11 --bug no 6028006 starts here
12 --g_package  varchar2(21) := 'PER_ASSIGNMENTS_F_PKG.';
13   g_package  varchar2(22) := 'PER_ASSIGNMENTS_F_PKG.';
14 --bug no 6028006 ends here
15 g_debug    boolean; -- debug flag
16 --
17 procedure insert_row(
18    p_row_id                           in out nocopy varchar2,
19    p_assignment_id                    in out nocopy number,
20    p_effective_start_date             date,
21    p_effective_end_date               date,
22    p_business_group_id                number,
23    p_recruiter_id                     number,
24    p_grade_id                         number,
25    p_position_id                      number,
26    p_job_id                           number,
27    p_assignment_status_type_id        number,
28    p_payroll_id                       number,
29    p_location_id                      number,
30    p_person_referred_by_id            number,
31    p_supervisor_id                    number,
32    p_special_ceiling_step_id          number,
33    p_person_id                        number,
34    p_recruitment_activity_id          number,
35    p_source_organization_id           number,
36    p_organization_id                  number,
37    p_people_group_id                  number,
38    p_soft_coding_keyflex_id           number,
39    p_vacancy_id                       number,
40    p_assignment_sequence              number,
41    p_assignment_type                  varchar2,
42    p_primary_flag                     varchar2,
43    p_application_id                   number,
44    p_assignment_number                varchar2,
45    p_change_reason                    varchar2,
46    p_comment_id                       number,
47    p_date_probation_end               date,
48    p_default_code_comb_id             number,
49    p_frequency                        varchar2,
50    p_internal_address_line            varchar2,
51    p_manager_flag                     varchar2,
52    p_normal_hours                     number,
53    p_period_of_service_id             number,
54    p_probation_period                 number,
55    p_probation_unit                   varchar2,
56    p_set_of_books_id                  number,
57    p_source_type                      varchar2,
58    p_time_normal_finish               varchar2,
59    p_time_normal_start                varchar2,
60    p_request_id                       number,
61    p_program_application_id           number,
62    p_program_id                       number,
63    p_program_update_date              date,
64    p_ass_attribute_category           varchar2,
65    p_ass_attribute1                   varchar2,
66    p_ass_attribute2                   varchar2,
67    p_ass_attribute3                   varchar2,
68    p_ass_attribute4                   varchar2,
69    p_ass_attribute5                   varchar2,
70    p_ass_attribute6                   varchar2,
71    p_ass_attribute7                   varchar2,
72    p_ass_attribute8                   varchar2,
73    p_ass_attribute9                   varchar2,
74    p_ass_attribute10                  varchar2,
75    p_ass_attribute11                  varchar2,
76    p_ass_attribute12                  varchar2,
77    p_ass_attribute13                  varchar2,
78    p_ass_attribute14                  varchar2,
79    p_ass_attribute15                  varchar2,
80    p_ass_attribute16                  varchar2,
81    p_ass_attribute17                  varchar2,
82    p_ass_attribute18                  varchar2,
83    p_ass_attribute19                  varchar2,
84    p_ass_attribute20                  varchar2,
85    p_ass_attribute21                  varchar2,
86    p_ass_attribute22                  varchar2,
87    p_ass_attribute23                  varchar2,
88    p_ass_attribute24                  varchar2,
89    p_ass_attribute25                  varchar2,
90    p_ass_attribute26                  varchar2,
91    p_ass_attribute27                  varchar2,
92    p_ass_attribute28                  varchar2,
93    p_ass_attribute29                  varchar2,
94    p_ass_attribute30                  varchar2,
95    p_sal_review_period                number,
96    p_sal_review_period_frequency      varchar2,
97    p_perf_review_period               number,
98    p_perf_review_period_frequency     varchar2,
99    p_pay_basis_id                     number,
100    p_employment_category              varchar2,
101    p_bargaining_unit_code             varchar2,
102    p_labour_union_member_flag         varchar2,
103    p_hourly_salaried_code             varchar2,
104    p_contract_id                      number   default null,
105    p_cagr_id_flex_num                 number   default null,
106    p_cagr_grade_def_id                number   default null,
107    p_establishment_id                 number   default null,
108    p_collective_agreement_id          number   default null,
109    p_notice_period                    number   default null,
110    p_notice_period_uom                varchar2 default null,
111    p_employee_category                varchar2 default null,
112    p_work_at_home                     varchar2 default null,
113    p_job_post_source_name             varchar2 default null,
114    p_placement_date_start             date     default null,
115    p_vendor_id                        number   default null,
116    p_vendor_employee_number           varchar2 default null,
117    p_vendor_assignment_number         varchar2 default null,
118    p_assignment_category              varchar2 default null,
119    p_title                            varchar2 default null,
120    p_project_title                    varchar2 default null,
121    p_grade_ladder_pgm_id              number   default null,
122    p_supervisor_assignment_id         number   default null,
123    p_vendor_site_id                   number   default null,
124    p_po_header_id                     number   default null,
125    p_po_line_id                       number   default null,
126    p_projected_assignment_end         date     default null
127  ) is
128     l_assignment_status_id  number; --discards irc_status_type out params
129     l_object_version_number  number;
130 --
131     l_return_code        number;
132     l_return_text        varchar2(240);
133     l_session_date       date;
134     l_proc               varchar2(200):= 'PER_ASSIGNMENTS_F_PKG.INSERT_ROW';
135     --
136 /*
137     --WWBUG 2130950 Begin hrwf synchronization --tpapired
138       l_asg_rec                per_all_assignments_f%rowtype;
139       cursor l_asg_cur is
140         select *
141         from per_all_assignments_f
142         where assignment_id           = P_ASSIGNMENT_ID
143         and   effective_start_date    = P_EFFECTIVE_START_DATE
144         and   effective_end_date      = P_EFFECTIVE_END_DATE;
145       --WWBUG 2130950 End hrwf synchronization -tpapired
146    --
147 */
148 -- Bug 1319140 fix begin: Added US legislation code check.
149     l_legislation_code   varchar2(150);
150 
151     cursor   ac1 is
152           select legislation_code
153             from per_business_groups
154            where business_group_id = P_BUSINESS_GROUP_ID;
155 -- Bug 1319140 fix end: Added US legislation code check.
156 
157 
158 cursor c1 is
159    select   per_assignments_s.nextval
160    from  sys.dual;
161 cursor c2 is
162    select   rowid
163    from  per_assignments_f
164    where assignment_id     = P_ASSIGNMENT_ID
165    and     effective_start_date     = P_EFFECTIVE_START_DATE
166         and     effective_end_date     = P_EFFECTIVE_END_DATE;
167 begin
168    open c1;
169    fetch c1 into P_ASSIGNMENT_ID;
170    close c1;
171 --
172 /*-- Start change for the bug 5854568  ----*/
173    hr_utility.set_location('Entering '||l_proc,20);
174    hr_utility.set_location('In the insert row',21);
175    hr_utility.set_location('Assgid= '||P_ASSIGNMENT_ID,22);
176    hr_utility.set_location('Pid= '||p_position_id,23);
177    hr_utility.set_location('Date= '||P_EFFECTIVE_START_DATE,24);
178 
179    per_asg_bus1.chk_frozen_single_pos
180     (p_assignment_id         =>  P_ASSIGNMENT_ID
181     ,p_position_id           =>  p_position_id
182     ,p_effective_date        =>  P_EFFECTIVE_START_DATE
183     ,p_assignment_type	     =>  p_assignment_type	 -- 6356978
184     );
185 /*-- End change for the bug 5854568  ----*/
186    begin
187      insert into per_assignments_f (
188    assignment_id,
189    effective_start_date,
190    effective_end_date,
191    business_group_id,
192    recruiter_id,
193    grade_id,
194    position_id,
195    job_id,
196    assignment_status_type_id,
197    payroll_id,
198    location_id,
199    person_referred_by_id,
200    supervisor_id,
201    special_ceiling_step_id,
202    person_id,
203    recruitment_activity_id,
204    source_organization_id,
205    organization_id,
206    people_group_id,
207    soft_coding_keyflex_id,
208    vacancy_id,
209    assignment_sequence,
210    assignment_type,
211    primary_flag,
212    application_id,
213    assignment_number,
214    change_reason,
215    comment_id,
216    date_probation_end,
217    default_code_comb_id,
218    frequency,
219    internal_address_line,
220    manager_flag,
221    normal_hours,
222    period_of_service_id,
223    probation_period,
224    probation_unit,
225    set_of_books_id,
226    source_type,
227    time_normal_finish,
228    time_normal_start,
229    request_id,
230    program_application_id,
231    program_id,
232    program_update_date,
233    ass_attribute_category,
234    ass_attribute1,
235    ass_attribute2,
236    ass_attribute3,
237    ass_attribute4,
238    ass_attribute5,
239    ass_attribute6,
240    ass_attribute7,
241    ass_attribute8,
242    ass_attribute9,
243    ass_attribute10,
244    ass_attribute11,
245    ass_attribute12,
246    ass_attribute13,
247    ass_attribute14,
248    ass_attribute15,
249    ass_attribute16,
250    ass_attribute17,
251    ass_attribute18,
252    ass_attribute19,
253    ass_attribute20,
254    ass_attribute21,
255    ass_attribute22,
256    ass_attribute23,
257    ass_attribute24,
258    ass_attribute25,
259    ass_attribute26,
260    ass_attribute27,
261    ass_attribute28,
262    ass_attribute29,
263    ass_attribute30,
264    sal_review_period,
265    sal_review_period_frequency,
266    perf_review_period,
267    perf_review_period_frequency,
268    pay_basis_id,
269    employment_category,
270         bargaining_unit_code,
271         labour_union_member_flag,
272         hourly_salaried_code,
273    contract_id,
274    cagr_id_flex_num,
275    cagr_grade_def_id,
276    establishment_id,
277    collective_agreement_id,
278    notice_period,
279    notice_period_uom,
280    work_at_home,
281    employee_category,
282    job_post_source_name,
283         period_of_placement_date_start,
284         vendor_id,
285         vendor_employee_number,
286         vendor_assignment_number,
287         assignment_category,
288         title,
289         project_title,
290         grade_ladder_pgm_id,
291         supervisor_assignment_id,
292         vendor_site_id,
293         po_header_id,
294         po_line_id,
295         projected_assignment_end)
296 values (
297    p_assignment_id,
298    p_effective_start_date,
299    p_effective_end_date,
300    p_business_group_id,
301    p_recruiter_id,
302    p_grade_id,
303    p_position_id,
304    p_job_id,
305    p_assignment_status_type_id,
306    p_payroll_id,
307    p_location_id,
308    p_person_referred_by_id,
309    p_supervisor_id,
310    p_special_ceiling_step_id,
311    p_person_id,
312    p_recruitment_activity_id,
313    p_source_organization_id,
314    p_organization_id,
315    p_people_group_id,
316    p_soft_coding_keyflex_id,
317    p_vacancy_id,
318    p_assignment_sequence,
319    p_assignment_type,
320    p_primary_flag,
321    p_application_id,
322    p_assignment_number,
323    p_change_reason,
324    p_comment_id,
325    p_date_probation_end,
326    p_default_code_comb_id,
327    p_frequency,
328    p_internal_address_line,
329    p_manager_flag,
330    p_normal_hours,
331    p_period_of_service_id,
332    p_probation_period,
333    p_probation_unit,
334    p_set_of_books_id,
335    p_source_type,
336    p_time_normal_finish,
337    p_time_normal_start,
338    p_request_id,
339    p_program_application_id,
340    p_program_id,
341    p_program_update_date,
342    p_ass_attribute_category,
343    p_ass_attribute1,
344    p_ass_attribute2,
345    p_ass_attribute3,
346    p_ass_attribute4,
347    p_ass_attribute5,
348    p_ass_attribute6,
349    p_ass_attribute7,
350    p_ass_attribute8,
351    p_ass_attribute9,
352    p_ass_attribute10,
353    p_ass_attribute11,
354    p_ass_attribute12,
355    p_ass_attribute13,
356    p_ass_attribute14,
357    p_ass_attribute15,
358    p_ass_attribute16,
359    p_ass_attribute17,
360    p_ass_attribute18,
361    p_ass_attribute19,
362    p_ass_attribute20,
363    p_ass_attribute21,
364    p_ass_attribute22,
365    p_ass_attribute23,
366    p_ass_attribute24,
367    p_ass_attribute25,
368    p_ass_attribute26,
369    p_ass_attribute27,
370    p_ass_attribute28,
371    p_ass_attribute29,
372    p_ass_attribute30,
373    p_sal_review_period,
374    p_sal_review_period_frequency,
375    p_perf_review_period,
376    p_perf_review_period_frequency,
377    p_pay_basis_id,
378    p_employment_category,
379         p_bargaining_unit_code,
380         p_labour_union_member_flag,
381         p_hourly_salaried_code,
382    p_contract_id,
383    p_cagr_id_flex_num,
384    p_cagr_grade_def_id,
385    p_establishment_id,
386    p_collective_agreement_id,
387    p_notice_period,
388    p_notice_period_uom,
389    p_work_at_home,
390    p_employee_category,
391    p_job_post_source_name,
392         p_placement_date_start,
393         p_vendor_id,
394         p_vendor_employee_number,
395         p_vendor_assignment_number,
396         p_assignment_category,
397         p_title,
398         p_project_title,
399         p_grade_ladder_pgm_id,
400         p_supervisor_assignment_id,
401         p_vendor_site_id,
402         p_po_header_id,
403         p_po_line_id,
404         p_projected_assignment_end
405 );
406    end;
407 --
408     hr_utility.set_location( l_proc, 30);
409 
410     -- Insert a row into irc_assignment_statuses for irecruitment
411 if p_assignment_type = 'A' then
412 IRC_ASG_STATUS_API.create_irc_asg_status
413             ( p_validate                   => FALSE
414             , p_assignment_id              => p_assignment_id
415             , p_assignment_status_type_id  => p_assignment_status_type_id
416             , p_status_change_reason       => p_change_reason   -- Bug 2676934
417             , p_status_change_date         => p_effective_start_date
418             , p_assignment_status_id       => l_assignment_status_id
419             , p_object_version_number      => l_object_version_number
420              );
421 end if;
422     hr_utility.set_location( l_proc, 40);
423    open c2;
424    fetch c2 into P_ROW_ID;
425    close c2;
426   -- bug 1228430  Adding a call to default tax with validation for
427   -- new assignments.
428 
429   l_session_date := p_effective_start_date;
430 
431 -- Bug 1319140 fix begin: Added US legislation code check.
432     hr_utility.set_location( l_proc, 50);
433    open ac1;
434    fetch ac1 into l_legislation_code;
435    if ac1%notfound then
436         close ac1;
437         fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
438         fnd_message.set_token('PROCEDURE',
439                 'PER_ASSIGNMENTS_F1_PKG.INSERT_ROW');
440         fnd_message.set_token('STEP', '0');
441         fnd_message.raise_error;
442    end if;
443    close ac1;
444     hr_utility.set_location( l_proc, 60);
445 
446 -- Start of fix 3634447
447 -- Add the person to the appropriate security lists
448 hr_security_internal.add_to_person_list(
449                      p_effective_date => p_effective_start_date,
450                      p_assignment_id  => p_assignment_id);
451 -- End of fix 3634447
452 hr_security.add_assignment(p_person_id, p_assignment_id); -- Bug 4018555
453 --
454     hr_utility.set_location( l_proc, 70);
455 
456 IF l_legislation_code = 'US' THEN
457   pay_us_emp_dt_tax_rules.default_tax_with_validation(
458                    p_assignment_id        => p_assignment_id,
459                    p_person_id            => p_person_id,
460                    p_effective_start_date => p_effective_start_date,
461                    p_effective_end_date   => p_effective_end_date,
462                    p_session_date         => l_session_date,
463                    p_business_group_id    => p_business_group_id,
464                    p_from_form            => 'Assignment',
465                    p_mode                 => NULL,
466                    p_location_id          => p_location_id,
467                    p_return_code          => l_return_code,
468                    p_return_text          => l_return_text);
469 END IF;
470 -- Bug 1319140 fix end: Added US legislation code check.
471 --
472     hr_utility.set_location( l_proc, 80);
473 
474   ben_dt_trgr_handle.assignment
475     (p_rowid                   => null
476     ,p_assignment_id           => p_assignment_id
477     ,p_business_group_id       => p_business_group_id
478     ,p_person_id               => p_person_id
479     ,p_effective_start_date    => p_effective_start_date
480     ,p_effective_end_date      => p_effective_end_date
481     ,p_assignment_status_type_id  => p_assignment_status_type_id
482     ,p_assignment_type         => p_assignment_type
483     ,p_organization_id         => p_organization_id
484     ,p_primary_flag            => p_primary_flag
485     ,p_change_reason           => p_change_reason
486     ,p_employment_category     => p_employment_category
487     ,p_frequency               => p_frequency
488     ,p_grade_id                => p_grade_id
489     ,p_job_id                  => p_job_id
490     ,p_position_id             => p_position_id
491     ,p_location_id             => p_location_id
492     ,p_normal_hours            => p_normal_hours
493     ,p_payroll_id              => p_payroll_id
494     ,p_pay_basis_id            => p_pay_basis_id
495     ,p_bargaining_unit_code    => p_bargaining_unit_code
496     ,p_labour_union_member_flag => p_labour_union_member_flag
497     ,p_hourly_salaried_code    => p_hourly_salaried_code
498     ,p_people_group_id    => p_people_group_id
499     ,p_ass_attribute1 => p_ass_attribute1
500     ,p_ass_attribute2 => p_ass_attribute2
501     ,p_ass_attribute3 => p_ass_attribute3
502     ,p_ass_attribute4 => p_ass_attribute4
503     ,p_ass_attribute5 => p_ass_attribute5
504     ,p_ass_attribute6 => p_ass_attribute6
505     ,p_ass_attribute7 => p_ass_attribute7
506     ,p_ass_attribute8 => p_ass_attribute8
507     ,p_ass_attribute9 => p_ass_attribute9
508     ,p_ass_attribute10 => p_ass_attribute10
509     ,p_ass_attribute11 => p_ass_attribute11
510     ,p_ass_attribute12 => p_ass_attribute12
511     ,p_ass_attribute13 => p_ass_attribute13
512     ,p_ass_attribute14 => p_ass_attribute14
513     ,p_ass_attribute15 => p_ass_attribute15
514     ,p_ass_attribute16 => p_ass_attribute16
515     ,p_ass_attribute17 => p_ass_attribute17
516     ,p_ass_attribute18 => p_ass_attribute18
517     ,p_ass_attribute19 => p_ass_attribute19
518     ,p_ass_attribute20 => p_ass_attribute20
519     ,p_ass_attribute21 => p_ass_attribute21
520     ,p_ass_attribute22 => p_ass_attribute22
521     ,p_ass_attribute23 => p_ass_attribute23
522     ,p_ass_attribute24 => p_ass_attribute24
523     ,p_ass_attribute25 => p_ass_attribute25
524     ,p_ass_attribute26 => p_ass_attribute26
525     ,p_ass_attribute27 => p_ass_attribute27
526     ,p_ass_attribute28 => p_ass_attribute28
527     ,p_ass_attribute29 => p_ass_attribute29
528     ,p_ass_attribute30 => p_ass_attribute30
529     );
530   --
531 /*
532   --WWBUG 2130950 Begin hrwf synchronization --tpapired
533     open l_asg_cur;
534     fetch l_asg_cur into l_asg_rec;
535     close l_asg_cur;
536        per_hrwf_synch.PER_ASG_WF(
537                   p_rec    => l_asg_rec,
538                        p_action => 'INSERT');
539   --WWBUG 2130950 End hrwf synchronization --tpapired
540 */
541   --
542 --start changes for bug 6598795
543 
544 hr_assignment.update_assgn_context_value (p_business_group_id,
545                                  p_person_id,
546                                  p_assignment_id,
547                                  p_effective_start_date);
548 
549 --end changes for bug 6598795
550 --
551 end insert_row;
552 -----------------------------------------------------------------------------
553 --
554 -- Standard delete procedure
555 --
556 procedure delete_row(p_row_id varchar2) is
557 begin
558    delete   from per_assignments_f a
559    where a.rowid  = chartorowid(P_ROW_ID);
560 end delete_row;
561 -----------------------------------------------------------------------------
562 --
563 -- Standard lock procedure
564 --
565 procedure lock_row(
566    p_row_id          varchar2,
567    p_assignment_id                    number,
568    p_effective_start_date             date,
569    p_effective_end_date               date,
570    p_business_group_id                number,
571    p_recruiter_id                     number,
572    p_grade_id                         number,
573    p_position_id                      number,
574    p_job_id                           number,
575    p_assignment_status_type_id        number,
576    p_payroll_id                       number,
577    p_location_id                      number,
578    p_person_referred_by_id            number,
579    p_supervisor_id                    number,
580    p_special_ceiling_step_id          number,
581    p_person_id                        number,
582    p_recruitment_activity_id          number,
583    p_source_organization_id           number,
584    p_organization_id                  number,
585    p_people_group_id                  number,
586    p_soft_coding_keyflex_id           number,
587    p_vacancy_id                       number,
588    p_assignment_sequence              number,
589    p_assignment_type                  varchar2,
590    p_primary_flag                     varchar2,
591    p_application_id                   number,
592    p_assignment_number                varchar2,
593    p_change_reason                    varchar2,
594    p_comment_id                       number,
595    p_date_probation_end               date,
596    p_default_code_comb_id             number,
597    p_frequency                        varchar2,
598    p_internal_address_line            varchar2,
599    p_manager_flag                     varchar2,
600    p_normal_hours                     number,
601    p_period_of_service_id             number,
602    p_probation_period                 number,
603    p_probation_unit                   varchar2,
604    p_set_of_books_id                  number,
605    p_source_type                      varchar2,
606    p_time_normal_finish               varchar2,
607    p_time_normal_start                varchar2,
608    p_request_id                       number,
609    p_program_application_id           number,
610    p_program_id                       number,
611    p_program_update_date              date,
612    p_ass_attribute_category           varchar2,
613    p_ass_attribute1                   varchar2,
614    p_ass_attribute2                   varchar2,
615    p_ass_attribute3                   varchar2,
616    p_ass_attribute4                   varchar2,
617    p_ass_attribute5                   varchar2,
618    p_ass_attribute6                   varchar2,
619    p_ass_attribute7                   varchar2,
620    p_ass_attribute8                   varchar2,
621    p_ass_attribute9                   varchar2,
622    p_ass_attribute10                  varchar2,
623    p_ass_attribute11                  varchar2,
624    p_ass_attribute12                  varchar2,
625    p_ass_attribute13                  varchar2,
626    p_ass_attribute14                  varchar2,
627    p_ass_attribute15                  varchar2,
628    p_ass_attribute16                  varchar2,
629    p_ass_attribute17                  varchar2,
630    p_ass_attribute18                  varchar2,
631    p_ass_attribute19                  varchar2,
632    p_ass_attribute20                  varchar2,
633    p_ass_attribute21                  varchar2,
634    p_ass_attribute22                  varchar2,
635    p_ass_attribute23                  varchar2,
636    p_ass_attribute24                  varchar2,
637    p_ass_attribute25                  varchar2,
638    p_ass_attribute26                  varchar2,
639    p_ass_attribute27                  varchar2,
640    p_ass_attribute28                  varchar2,
641    p_ass_attribute29                  varchar2,
642    p_ass_attribute30                  varchar2,
643    p_sal_review_period                number,
644    p_sal_review_period_frequency      varchar2,
645    p_perf_review_period               number,
646    p_perf_review_period_frequency     varchar2,
647    p_pay_basis_id                     number,
648    p_employment_category         varchar2,
649         p_bargaining_unit_code             varchar2,
650         p_labour_union_member_flag         varchar2,
651         p_hourly_salaried_code             varchar2,
652    p_contract_id                      number,
653    p_cagr_id_flex_num                 number,
654    p_cagr_grade_def_id                number,
655    p_establishment_id                 number,
656    p_collective_agreement_id          number,
657         p_notice_period          number,
658         p_notice_period_uom         varchar2,
659         p_employee_category         varchar2,
660         p_work_at_home           varchar2,
661         p_job_post_source_name         varchar2,
662         p_placement_date_start             date,
663         p_vendor_id                        number,
664         p_vendor_employee_number           varchar2,
665         p_vendor_assignment_number         varchar2,
666         p_assignment_category              varchar2,
667         p_title                            varchar2,
668         p_project_title                    varchar2,
669         p_grade_ladder_pgm_id              number,
670         p_supervisor_assignment_id         number,
671         p_vendor_site_id                   number,
672         p_po_header_id                     number,
673         p_po_line_id                       number,
674         p_projected_assignment_end         date
675 ) is
676 --
677 cursor ASS_CUR is
678    select   *
679    from  per_assignments_f a
680    where a.rowid  = chartorowid(P_ROW_ID)
681    FOR   UPDATE OF ASSIGNMENT_ID NOWAIT;
682 --
683 ass_rec  ASS_CUR%rowtype;
684 --
685 begin
686 --
687    open ASS_CUR;
688 --
689    fetch ASS_CUR into ASS_REC;
690 --
691    if ASS_CUR%notfound then
692       close  ASS_CUR;
693                 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
694                 fnd_message.set_token('PROCEDURE',
695                         'PER_ASSIGNMENTS_F_PKG.LOCK_ROW');
696                 fnd_message.set_token('STEP', '1');
697                 fnd_message.raise_error;
698    end if;
699    close ASS_CUR;
700 --
701 ass_rec.assignment_type := rtrim(ass_rec.assignment_type);
702 ass_rec.primary_flag := rtrim(ass_rec.primary_flag);
703 ass_rec.assignment_number := rtrim(ass_rec.assignment_number);
704 ass_rec.change_reason := rtrim(ass_rec.change_reason);
705 ass_rec.employment_category := rtrim(ass_rec.employment_category);
706 ass_rec.frequency := rtrim(ass_rec.frequency);
707 ass_rec.internal_address_line := rtrim(ass_rec.internal_address_line);
708 ass_rec.manager_flag := rtrim(ass_rec.manager_flag);
709 ass_rec.perf_review_period_frequency :=
710    rtrim(ass_rec.perf_review_period_frequency);
711 ass_rec.probation_unit := rtrim(ass_rec.probation_unit);
712 ass_rec.sal_review_period_frequency :=
713    rtrim(ass_rec.sal_review_period_frequency);
714 ass_rec.source_type := rtrim(ass_rec.source_type);
715 ass_rec.time_normal_finish := rtrim(ass_rec.time_normal_finish);
716 ass_rec.time_normal_start := rtrim(ass_rec.time_normal_start);
717 ass_rec.ass_attribute_category := rtrim(ass_rec.ass_attribute_category);
718 ass_rec.ass_attribute1 := rtrim(ass_rec.ass_attribute1);
719 ass_rec.ass_attribute2 := rtrim(ass_rec.ass_attribute2);
720 ass_rec.ass_attribute3 := rtrim(ass_rec.ass_attribute3);
721 ass_rec.ass_attribute4 := rtrim(ass_rec.ass_attribute4);
722 ass_rec.ass_attribute5 := rtrim(ass_rec.ass_attribute5);
723 ass_rec.ass_attribute6 := rtrim(ass_rec.ass_attribute6);
724 ass_rec.ass_attribute7 := rtrim(ass_rec.ass_attribute7);
725 ass_rec.ass_attribute8 := rtrim(ass_rec.ass_attribute8);
726 ass_rec.ass_attribute9 := rtrim(ass_rec.ass_attribute9);
727 ass_rec.ass_attribute10 := rtrim(ass_rec.ass_attribute10);
728 ass_rec.ass_attribute11 := rtrim(ass_rec.ass_attribute11);
729 ass_rec.ass_attribute12 := rtrim(ass_rec.ass_attribute12);
730 ass_rec.ass_attribute13 := rtrim(ass_rec.ass_attribute13);
731 ass_rec.ass_attribute14 := rtrim(ass_rec.ass_attribute14);
732 ass_rec.ass_attribute15 := rtrim(ass_rec.ass_attribute15);
733 ass_rec.ass_attribute16 := rtrim(ass_rec.ass_attribute16);
734 ass_rec.ass_attribute17 := rtrim(ass_rec.ass_attribute17);
735 ass_rec.ass_attribute18 := rtrim(ass_rec.ass_attribute18);
736 ass_rec.ass_attribute19 := rtrim(ass_rec.ass_attribute19);
737 ass_rec.ass_attribute20 := rtrim(ass_rec.ass_attribute20);
738 ass_rec.ass_attribute21 := rtrim(ass_rec.ass_attribute21);
739 ass_rec.ass_attribute22 := rtrim(ass_rec.ass_attribute22);
740 ass_rec.ass_attribute23 := rtrim(ass_rec.ass_attribute23);
741 ass_rec.ass_attribute24 := rtrim(ass_rec.ass_attribute24);
742 ass_rec.ass_attribute25 := rtrim(ass_rec.ass_attribute25);
743 ass_rec.ass_attribute26 := rtrim(ass_rec.ass_attribute26);
744 ass_rec.ass_attribute27 := rtrim(ass_rec.ass_attribute27);
745 ass_rec.ass_attribute28 := rtrim(ass_rec.ass_attribute28);
746 ass_rec.ass_attribute29 := rtrim(ass_rec.ass_attribute29);
747 ass_rec.ass_attribute30 := rtrim(ass_rec.ass_attribute30);
748 ass_rec.bargaining_unit_code := rtrim(ass_rec.bargaining_unit_code);
749 ass_rec.labour_union_member_flag := rtrim(ass_rec.labour_union_member_flag);
750 ass_rec.hourly_salaried_code:= rtrim(ass_rec.hourly_salaried_code);
751 ass_rec.contract_id     := rtrim(ass_rec.contract_id);
752 ass_rec.cagr_id_flex_num  := rtrim(ass_rec.cagr_id_flex_num);
753 ass_rec.cagr_grade_def_id := rtrim(ass_rec.cagr_grade_def_id);
754 ass_rec.establishment_id  := rtrim(ass_rec.establishment_id);
755 ass_rec.collective_agreement_id := rtrim(ass_rec.collective_agreement_id);
756 ass_rec.notice_period := rtrim(ass_rec.notice_period);
757 ass_rec.notice_period_uom := rtrim(ass_rec.notice_period_uom);
758 ass_rec.employee_category := rtrim(ass_rec.employee_category);
759 ass_rec.work_at_home := rtrim(ass_rec.work_at_home);
760 ass_rec.job_post_source_name := rtrim(ass_rec.job_post_source_name);
761 ass_rec.period_of_placement_date_start := rtrim(ass_rec.period_of_placement_date_start);
762 ass_rec.vendor_employee_number := rtrim(ass_rec.vendor_employee_number);
763 ass_rec.vendor_assignment_number := rtrim(ass_rec.vendor_assignment_number);
764 ass_rec.assignment_category := rtrim(ass_rec.assignment_category);
765 ass_rec.title := rtrim(ass_rec.title);
766 ass_rec.project_title := rtrim(ass_rec.project_title);
767 
768 --
769 if ( ((ass_rec.assignment_id = p_assignment_id)
770 or (ass_rec.assignment_id is null
771  and (p_assignment_id is null)))
772 and ((ass_rec.notice_period = p_notice_period)
773 or (ass_rec.notice_period is null
774  and (p_notice_period is null)))
775 and ((ass_rec.notice_period_uom = p_notice_period_uom)
776 or (ass_rec.notice_period_uom is null
777  and (p_notice_period_uom is null)))
778 and ((ass_rec.work_at_home = p_work_at_home)
779 or (ass_rec.work_at_home is null
780  and (p_work_at_home is null)))
781 and ((ass_rec.employee_category = p_employee_category)
782 or (ass_rec.employee_category is null
783  and (p_employee_category is null)))
784 and ((ass_rec.job_post_source_name = p_job_post_source_name)
785 or (ass_rec.job_post_source_name is null
786  and (p_job_post_source_name is null)))
787 and ((ass_rec.contract_id = p_contract_id)
788 or (ass_rec.contract_id is null
789  and (p_contract_id is null)))
790 and ((ass_rec.collective_agreement_id = p_collective_agreement_id)
791 or (ass_rec.collective_agreement_id is null
792  and (p_collective_agreement_id is null)))
793 and ((ass_rec.establishment_id = p_establishment_id)
794 or (ass_rec.establishment_id is null
795  and (p_establishment_id is null)))
796 and ((ass_rec.cagr_grade_def_id = p_cagr_grade_def_id)
797 or (ass_rec.cagr_grade_def_id is null
798  and (p_cagr_grade_def_id is null)))
799 and ((ass_rec.cagr_id_flex_num = p_cagr_id_flex_num)
800 or (ass_rec.cagr_id_flex_num is null
801  and (p_cagr_id_flex_num is null)))
802 and ((ass_rec.effective_start_date = p_effective_start_date)
803 or (ass_rec.effective_start_date is null
804  and (p_effective_start_date is null)))
805 and ((ass_rec.effective_end_date = p_effective_end_date)
806 or (ass_rec.effective_end_date is null
807  and (p_effective_end_date is null)))
808 and ((ass_rec.business_group_id = p_business_group_id)
809 or (ass_rec.business_group_id is null
810  and (p_business_group_id is null)))
811 and ((ass_rec.recruiter_id = p_recruiter_id)
812 or (ass_rec.recruiter_id is null
813  and (p_recruiter_id is null)))
814 and ((ass_rec.grade_id = p_grade_id)
815 or (ass_rec.grade_id is null
816  and (p_grade_id is null)))
817 and ((ass_rec.position_id = p_position_id)
818 or (ass_rec.position_id is null
819  and (p_position_id is null)))
820 and ((ass_rec.job_id = p_job_id)
821 or (ass_rec.job_id is null
822  and (p_job_id is null)))
823 and ((ass_rec.assignment_status_type_id = p_assignment_status_type_id)
824 or (ass_rec.assignment_status_type_id is null
825  and (p_assignment_status_type_id is null)))
826 and ((ass_rec.payroll_id = p_payroll_id)
827 or (ass_rec.payroll_id is null
828  and (p_payroll_id is null)))
829 and ((ass_rec.location_id = p_location_id)
830 or (ass_rec.location_id is null
831  and (p_location_id is null)))
832 and ((ass_rec.person_referred_by_id = p_person_referred_by_id)
833 or (ass_rec.person_referred_by_id is null
834  and (p_person_referred_by_id is null)))
835 and ((ass_rec.supervisor_id = p_supervisor_id)
836 or (ass_rec.supervisor_id is null
837  and (p_supervisor_id is null)))
838 and ((ass_rec.special_ceiling_step_id = p_special_ceiling_step_id)
839 or (ass_rec.special_ceiling_step_id is null
840  and (p_special_ceiling_step_id is null)))
841 and ((ass_rec.person_id = p_person_id)
842 or (ass_rec.person_id is null
843  and (p_person_id is null)))
844 and ((ass_rec.recruitment_activity_id = p_recruitment_activity_id)
845 or (ass_rec.recruitment_activity_id is null
846  and (p_recruitment_activity_id is null)))
847 and ((ass_rec.source_organization_id = p_source_organization_id)
848 or (ass_rec.source_organization_id is null
849  and (p_source_organization_id is null)))
850 and ((ass_rec.organization_id = p_organization_id)
851 or (ass_rec.organization_id is null
852  and (p_organization_id is null)))
853 and ((ass_rec.people_group_id = p_people_group_id)
854 or (ass_rec.people_group_id is null
855  and (p_people_group_id is null)))
856 and ((ass_rec.soft_coding_keyflex_id = p_soft_coding_keyflex_id)
857 or (ass_rec.soft_coding_keyflex_id is null
858  and (p_soft_coding_keyflex_id is null)))
859 and ((ass_rec.vacancy_id = p_vacancy_id)
860 or (ass_rec.vacancy_id is null
861  and (p_vacancy_id is null)))
862 and ((ass_rec.assignment_sequence = p_assignment_sequence)
863 or (ass_rec.assignment_sequence is null
864  and (p_assignment_sequence is null)))
865 and ((ass_rec.assignment_type = p_assignment_type)
866 or (ass_rec.assignment_type is null
867  and (p_assignment_type is null)))
868 and ((ass_rec.primary_flag = p_primary_flag)
869 or (ass_rec.primary_flag is null
870  and (p_primary_flag is null)))
871 and ((ass_rec.application_id = p_application_id)
872 or (ass_rec.application_id is null
873  and (p_application_id is null)))
874 and ((ass_rec.assignment_number = p_assignment_number)
875 or (ass_rec.assignment_number is null
876  and (p_assignment_number is null)))
877 and ((ass_rec.change_reason = p_change_reason)
878 or (ass_rec.change_reason is null
879  and (p_change_reason is null)))
880 and ((ass_rec.comment_id = p_comment_id)
881 or (ass_rec.comment_id is null
882  and (p_comment_id is null)))
883 and ((ass_rec.date_probation_end = p_date_probation_end)
884 or (ass_rec.date_probation_end is null
885  and (p_date_probation_end is null)))
886 and ((ass_rec.default_code_comb_id = p_default_code_comb_id)
887 or (ass_rec.default_code_comb_id is null
888  and (p_default_code_comb_id is null)))
889 and ((ass_rec.frequency = p_frequency)
890 or (ass_rec.frequency is null
891  and (p_frequency is null)))
892 and ((ass_rec.internal_address_line = p_internal_address_line)
893 or (ass_rec.internal_address_line is null
894  and (p_internal_address_line is null)))
895 and ((ass_rec.manager_flag = p_manager_flag)
896 or (ass_rec.manager_flag is null
897  and (p_manager_flag is null)))
898 and ((ass_rec.normal_hours = p_normal_hours)
899 or (ass_rec.normal_hours is null
900  and (p_normal_hours is null)))
901 and ((ass_rec.period_of_service_id = p_period_of_service_id)
902 or (ass_rec.period_of_service_id is null
903  and (p_period_of_service_id is null)))
904 and ((ass_rec.probation_period = p_probation_period)
905 or (ass_rec.probation_period is null
906  and (p_probation_period is null)))
907 and ((ass_rec.probation_unit = p_probation_unit)
908 or (ass_rec.probation_unit is null
909  and (p_probation_unit is null)))
910 and ((ass_rec.set_of_books_id = p_set_of_books_id)
911 or (ass_rec.set_of_books_id is null
912  and (p_set_of_books_id is null)))
913 and ((ass_rec.source_type = p_source_type)
914 or (ass_rec.source_type is null
915  and (p_source_type is null)))
916 and ((ass_rec.time_normal_finish = p_time_normal_finish)
917 or (ass_rec.time_normal_finish is null
918  and (p_time_normal_finish is null)))
919 and ((ass_rec.time_normal_start = p_time_normal_start)
920 or (ass_rec.time_normal_start is null
921  and (p_time_normal_start is null)))
922 and ((ass_rec.request_id = p_request_id)
923 or (ass_rec.request_id is null
924  and (p_request_id is null)))
925 and ((ass_rec.program_application_id = p_program_application_id)
926 or (ass_rec.program_application_id is null
927  and (p_program_application_id is null)))
928 and ((ass_rec.program_id = p_program_id)
929 or (ass_rec.program_id is null
930  and (p_program_id is null)))
931 and ((ass_rec.program_update_date = p_program_update_date)
932 or (ass_rec.program_update_date is null
933  and (p_program_update_date is null)))
934 and ((ass_rec.sal_review_period = p_sal_review_period)
935 or (ass_rec.sal_review_period is null
936  and (p_sal_review_period is null)))
937 and ((ass_rec.sal_review_period_frequency = p_sal_review_period_frequency)
938 or (ass_rec.sal_review_period_frequency is null
939  and (p_sal_review_period_frequency is null)))
940 and ((ass_rec.perf_review_period = p_perf_review_period)
941 or (ass_rec.perf_review_period is null
942  and (p_perf_review_period is null)))
943 and ((ass_rec.perf_review_period_frequency = p_perf_review_period_frequency)
944 or (ass_rec.perf_review_period_frequency is null
945  and (p_perf_review_period_frequency is null)))
946 and ((ass_rec.pay_basis_id = p_pay_basis_id)
947 or (ass_rec.pay_basis_id is null
948  and (p_pay_basis_id is null)))) then
949 if ( ((ass_rec.ass_attribute_category = p_ass_attribute_category)
950    or (ass_rec.ass_attribute_category is null
951     and (p_ass_attribute_category is null)))
952    and ((ass_rec.ass_attribute1 = p_ass_attribute1)
953    or (ass_rec.ass_attribute1 is null
954     and (p_ass_attribute1 is null)))
955    and ((ass_rec.ass_attribute2 = p_ass_attribute2)
956    or (ass_rec.ass_attribute2 is null
957     and (p_ass_attribute2 is null)))
958    and ((ass_rec.ass_attribute3 = p_ass_attribute3)
959    or (ass_rec.ass_attribute3 is null
960     and (p_ass_attribute3 is null)))
961    and ((ass_rec.ass_attribute4 = p_ass_attribute4)
962    or (ass_rec.ass_attribute4 is null
963     and (p_ass_attribute4 is null)))
964    and ((ass_rec.ass_attribute5 = p_ass_attribute5)
965    or (ass_rec.ass_attribute5 is null
966     and (p_ass_attribute5 is null)))
967    and ((ass_rec.ass_attribute6 = p_ass_attribute6)
968    or (ass_rec.ass_attribute6 is null
969     and (p_ass_attribute6 is null)))
970    and ((ass_rec.ass_attribute7 = p_ass_attribute7)
971    or (ass_rec.ass_attribute7 is null
972     and (p_ass_attribute7 is null)))
973    and ((ass_rec.ass_attribute8 = p_ass_attribute8)
974    or (ass_rec.ass_attribute8 is null
975     and (p_ass_attribute8 is null)))
976    and ((ass_rec.ass_attribute9 = p_ass_attribute9)
977    or (ass_rec.ass_attribute9 is null
978     and (p_ass_attribute9 is null)))
979    and ((ass_rec.ass_attribute10 = p_ass_attribute10)
980    or (ass_rec.ass_attribute10 is null
981     and (p_ass_attribute10 is null)))
982    and ((ass_rec.ass_attribute11 = p_ass_attribute11)
983    or (ass_rec.ass_attribute11 is null
984     and (p_ass_attribute11 is null)))
985    and ((ass_rec.ass_attribute12 = p_ass_attribute12)
986    or (ass_rec.ass_attribute12 is null
987     and (p_ass_attribute12 is null)))
988    and ((ass_rec.ass_attribute13 = p_ass_attribute13)
989    or (ass_rec.ass_attribute13 is null
990     and (p_ass_attribute13 is null)))
991    and ((ass_rec.ass_attribute14 = p_ass_attribute14)
992    or (ass_rec.ass_attribute14 is null
993     and (p_ass_attribute14 is null)))
994    and ((ass_rec.ass_attribute15 = p_ass_attribute15)
995    or (ass_rec.ass_attribute15 is null
996     and (p_ass_attribute15 is null)))
997    and ((ass_rec.ass_attribute16 = p_ass_attribute16)
998    or (ass_rec.ass_attribute16 is null
999     and (p_ass_attribute16 is null)))
1000    and ((ass_rec.ass_attribute17 = p_ass_attribute17)
1001    or (ass_rec.ass_attribute17 is null
1002     and (p_ass_attribute17 is null)))
1003    and ((ass_rec.ass_attribute18 = p_ass_attribute18)
1004    or (ass_rec.ass_attribute18 is null
1005     and (p_ass_attribute18 is null)))
1006    and ((ass_rec.ass_attribute19 = p_ass_attribute19)
1007    or (ass_rec.ass_attribute19 is null
1008     and (p_ass_attribute19 is null)))
1009    and ((ass_rec.ass_attribute20 = p_ass_attribute20)
1010    or (ass_rec.ass_attribute20 is null
1011     and (p_ass_attribute20 is null)))
1012    and ((ass_rec.ass_attribute21 = p_ass_attribute21)
1013    or (ass_rec.ass_attribute21 is null
1014     and (p_ass_attribute21 is null)))
1015    and ((ass_rec.ass_attribute22 = p_ass_attribute22)
1016    or (ass_rec.ass_attribute22 is null
1017     and (p_ass_attribute22 is null)))
1018    and ((ass_rec.ass_attribute23 = p_ass_attribute23)
1019    or (ass_rec.ass_attribute23 is null
1020     and (p_ass_attribute23 is null)))
1021    and ((ass_rec.ass_attribute24 = p_ass_attribute24)
1022    or (ass_rec.ass_attribute24 is null
1023     and (p_ass_attribute24 is null)))
1024    and ((ass_rec.ass_attribute25 = p_ass_attribute25)
1025    or (ass_rec.ass_attribute25 is null
1026     and (p_ass_attribute25 is null)))
1027    and ((ass_rec.ass_attribute26 = p_ass_attribute26)
1028    or (ass_rec.ass_attribute26 is null
1029     and (p_ass_attribute26 is null)))
1030    and ((ass_rec.ass_attribute27 = p_ass_attribute27)
1031    or (ass_rec.ass_attribute27 is null
1032     and (p_ass_attribute27 is null)))
1033    and ((ass_rec.ass_attribute28 = p_ass_attribute28)
1034    or (ass_rec.ass_attribute28 is null
1035     and (p_ass_attribute28 is null)))
1036    and ((ass_rec.ass_attribute29 = p_ass_attribute29)
1037    or (ass_rec.ass_attribute29 is null
1038     and (p_ass_attribute29 is null)))
1039    and ((ass_rec.ass_attribute30 = p_ass_attribute30)
1040    or (ass_rec.ass_attribute30 is null
1041     and (p_ass_attribute30 is null)))
1042    and ((ass_rec.employment_category = p_employment_category)
1043    or (ass_rec.employment_category is null
1044     and (p_employment_category is null)))
1045         and ((ass_rec.bargaining_unit_code = p_bargaining_unit_code)
1046         or (ass_rec.bargaining_unit_code is null
1047          and (p_bargaining_unit_code is null)))
1048         and ((ass_rec.labour_union_member_flag = p_labour_union_member_flag)
1049         or (ass_rec.labour_union_member_flag is null
1050          and (p_labour_union_member_flag is null)))
1051         and ((ass_rec.hourly_salaried_code = p_hourly_salaried_code)
1052         or (ass_rec.hourly_salaried_code is null
1053          and (p_hourly_salaried_code is null)))
1054         and ((ass_rec.vendor_id = p_vendor_id)
1055         or (ass_rec.vendor_id is null
1056          and (p_vendor_id is null)))
1057         and ((ass_rec.vendor_site_id = p_vendor_site_id)
1058         or (ass_rec.vendor_site_id is null
1059          and (p_vendor_site_id is null)))
1060         and ((ass_rec.po_header_id = p_po_header_id)
1061         or (ass_rec.po_header_id is null
1062          and (p_po_header_id is null)))
1063         and ((ass_rec.po_line_id = p_po_line_id)
1064         or (ass_rec.po_line_id is null
1065          and (p_po_line_id is null)))
1066         and ((ass_rec.projected_assignment_end = p_projected_assignment_end)
1067         or (ass_rec.projected_assignment_end is null
1068          and (p_projected_assignment_end is null)))
1069 ) then
1070       return;   -- Row successfully locked, no changes
1071    end if;
1072 end if;
1073 --
1074    fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
1075    app_exception.raise_exception;
1076 --
1077 end lock_row;
1078 -----------------------------------------------------------------------------
1079 --
1080 -- Standard update procedure
1081 --
1082 /****************************/
1083 
1084 procedure update_row(
1085    p_row_id          varchar2,
1086    p_assignment_id                    number,
1087    p_effective_start_date             date,
1088    p_effective_end_date               date,
1089    p_business_group_id                number,
1090    p_recruiter_id                     number,
1091    p_grade_id                         number,
1092    p_position_id                      number,
1093    p_job_id                           number,
1094    p_assignment_status_type_id        number,
1095    p_payroll_id                       number,
1096    p_location_id                      number,
1097    p_person_referred_by_id            number,
1098    p_supervisor_id                    number,
1099    p_special_ceiling_step_id          number,
1100    p_person_id                        number,
1101    p_recruitment_activity_id          number,
1102    p_source_organization_id           number,
1103    p_organization_id                  number,
1104    p_people_group_id                  number,
1105    p_soft_coding_keyflex_id           number,
1106    p_vacancy_id                       number,
1107    p_assignment_sequence              number,
1108    p_assignment_type                  varchar2,
1109    p_primary_flag                     varchar2,
1110    p_application_id                   number,
1111    p_assignment_number                varchar2,
1112    p_change_reason                    varchar2,
1113    p_comment_id                       number,
1114    p_date_probation_end               date,
1115    p_default_code_comb_id             number,
1116    p_frequency                        varchar2,
1117    p_internal_address_line            varchar2,
1118    p_manager_flag                     varchar2,
1119    p_normal_hours                     number,
1120    p_period_of_service_id             number,
1121    p_probation_period                 number,
1122    p_probation_unit                   varchar2,
1123    p_set_of_books_id                  number,
1124    p_source_type                      varchar2,
1125    p_time_normal_finish               varchar2,
1126    p_time_normal_start                varchar2,
1127    p_request_id                       number,
1128    p_program_application_id           number,
1129    p_program_id                       number,
1130    p_program_update_date              date,
1131    p_ass_attribute_category           varchar2,
1132    p_ass_attribute1                   varchar2,
1133    p_ass_attribute2                   varchar2,
1134    p_ass_attribute3                   varchar2,
1135    p_ass_attribute4                   varchar2,
1136    p_ass_attribute5                   varchar2,
1137    p_ass_attribute6                   varchar2,
1138    p_ass_attribute7                   varchar2,
1139    p_ass_attribute8                   varchar2,
1140    p_ass_attribute9                   varchar2,
1141    p_ass_attribute10                  varchar2,
1142    p_ass_attribute11                  varchar2,
1143    p_ass_attribute12                  varchar2,
1144    p_ass_attribute13                  varchar2,
1145    p_ass_attribute14                  varchar2,
1146    p_ass_attribute15                  varchar2,
1147    p_ass_attribute16                  varchar2,
1148    p_ass_attribute17                  varchar2,
1149    p_ass_attribute18                  varchar2,
1150    p_ass_attribute19                  varchar2,
1151    p_ass_attribute20                  varchar2,
1152    p_ass_attribute21                  varchar2,
1153    p_ass_attribute22                  varchar2,
1154    p_ass_attribute23                  varchar2,
1155    p_ass_attribute24                  varchar2,
1156    p_ass_attribute25                  varchar2,
1157    p_ass_attribute26                  varchar2,
1158    p_ass_attribute27                  varchar2,
1159    p_ass_attribute28                  varchar2,
1160    p_ass_attribute29                  varchar2,
1161    p_ass_attribute30                  varchar2,
1162    p_sal_review_period                number,
1163    p_sal_review_period_frequency      varchar2,
1164    p_perf_review_period               number,
1165    p_perf_review_period_frequency     varchar2,
1166    p_pay_basis_id                     number,
1167    p_employment_category         varchar2,
1168         p_dt_update_mode                   varchar2,
1169         p_session_date                     date,
1170         p_bargaining_unit_code             varchar2,
1171         p_labour_union_member_flag         varchar2,
1172         p_hourly_salaried_code             varchar2,
1173    p_contract_id                      number default null,
1174    p_cagr_id_flex_num                 number default null,
1175    p_cagr_grade_def_id                number default null,
1176    p_establishment_id                 number default null,
1177    p_collective_agreement_id          number default null,
1178         p_notice_period          number   default null,
1179         p_notice_period_uom         varchar2 default null,
1180         p_employee_category         varchar2 default null,
1181         p_work_at_home           varchar2 default null,
1182         p_job_post_source_name         varchar2 default null,
1183         p_placement_date_start             date     default null,
1184         p_vendor_id                        number   default null,
1185         p_vendor_employee_number           varchar2 default null,
1186         p_vendor_assignment_number         varchar2 default null,
1187         p_assignment_category              varchar2 default null,
1188         p_title                            varchar2 default null,
1189         p_project_title                    varchar2 default null,
1190         p_grade_ladder_pgm_id              number   default null,
1191         p_supervisor_assignment_id         number   default null,
1192         p_vendor_site_id                   number   default null,
1193         p_po_header_id                     number   default null,
1194         p_po_line_id                       number   default null,
1195         p_projected_assignment_end         date     default null
1196 ) is
1197         l_assignment_status_id number; --discards out params from irc_asg_st
1198         l_asg_status_ovn       number; --discards out params from irc_asg_st
1199         l_previous_asg_status  number;
1200         l_organization_id    number;
1201         l_legislation_code   varchar2(150);
1202         l_return_code        number;
1203         l_return_text        varchar2(240);
1204         l_location_id        number;
1205         l_loc_id             number;
1206         l_location_id_changed  number := 0;
1207         l_dt_update_mode      varchar2(240);
1208         l_percent_time        number;
1209         dummy                date;
1210 --
1211 l_proc            varchar2(10) :=  'insert_row';
1212 --
1213 
1214 --
1215 /*
1216       --WWBUG 2130950 Begin hrwf synchronization --tpapired
1217    l_asg_rec                per_all_assignments_f%rowtype;
1218         cursor l_asg_cur is
1219         select *
1220    from per_all_assignments_f
1221    where assignment_id           = P_ASSIGNMENT_ID
1222    and     effective_start_date    = P_EFFECTIVE_START_DATE
1223         and     effective_end_date          = P_EFFECTIVE_END_DATE;
1224       --WWBUG 2130950 End hrwf synchronization -tpapired
1225 */
1226       --
1227         -- DK 99/05/03
1228         -- Bug 883263 (rdbms 883275)
1229         -- The workaround gives a simpler and more efficient query
1230         -- Replace the form's view (per_assignments_v) with the secure view.
1231         --
1232 
1233         cursor  perav1(c_row_id  rowid) is
1234           select pav.organization_id,
1235                  pbg.legislation_code,
1236                  pav.location_id
1237           from   per_assignments_f   pav,
1238                  per_business_groups pbg
1239           where  c_row_id              = pav.rowid
1240             and  pav.business_group_id = pbg.business_group_id;
1241 --
1242 
1243   cursor csr_chk_loc_change is
1244   select paf.location_id
1245   from   PER_ASSIGNMENTS_F paf
1246   where  paf.assignment_id = p_assignment_id
1247   and    p_session_date between paf.effective_start_date
1248         and paf.effective_end_date;
1249 
1250 /* Need to check that US payroll is installed */
1251 /*
1252 CURSOR get_install_info IS
1253 SELECT status
1254 FROM fnd_product_installations
1255 WHERE application_id = 801
1256 AND   p_primary_flag = 'Y';
1257 */
1258 
1259   cursor c_pay_proposals is
1260   select min(change_date)
1261   from per_pay_proposals
1262   where assignment_id = p_assignment_id;
1263 
1264    --start code for bug 6961562
1265 	l_installed          boolean;
1266 	l_po_installed      VARCHAR2(1);
1267 	l_industry           VARCHAR2(1);
1268 	l_vendor_id      number default null;
1269 	l_vendor_site_id      number default null;
1270 
1271 	cursor po_cwk is
1272 	select vendor_id,vendor_site_id from
1273 	per_all_assignments_f paf
1274 	 where paf.assignment_id = p_assignment_id
1275 	 and nvl(p_session_date,sysdate) between paf.effective_start_date
1276 	and paf.effective_end_date;
1277 --end code for bug 6961562
1278 
1279 
1280 --
1281 --
1282 l_status            VARCHAR2(50);
1283 l_change_date       DATE;
1284 --
1285 begin
1286 --
1287 -- #294004 If the organization_id has been changed away from the default
1288 --business_group, an update to ins_per_list should be invoked, after the update
1289 --to per_assignments_f. This is because all secure users will be able to see
1290 --the person when assigned to the default business group and we want to
1291 --restrict access immediately the organization is entered, rather than waiting
1292 --for the next run of listgen.
1293 --
1294      hr_utility.set_location('per_assignments_f_pkg.update_row',1);
1295      open csr_chk_loc_change;
1296      fetch csr_chk_loc_change into l_loc_id;
1297 
1298     if csr_chk_loc_change%NOTFOUND then
1299              close csr_chk_loc_change;
1300              fnd_message.set_name(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1301              fnd_message.set_token('PROCEDURE',
1302                             'per_assignments_f_pkg.update_row');
1303              fnd_message.set_token('STEP','1');
1304              fnd_message.raise_error;
1305     else
1306        if l_loc_id <> p_location_id then
1307          l_location_id_changed := 1;
1308          close csr_chk_loc_change;
1309        end if;
1310     end if;
1311 
1312 /**
1313 
1314 -- Bug 2365872
1315 -- If records exists in per_pay_proposals for the assignment
1316 -- then salary basis cannot be nulled.
1317 --
1318   if p_pay_basis_id is null then
1319     open c_pay_proposals;
1320 
1321     hr_utility.set_location('per_assignments_f_pkg.update_row',10);
1322     fetch c_pay_proposals into l_change_date;
1323       if c_pay_proposals%FOUND then
1324            if l_change_date < p_session_date then
1325            fnd_message.set_name('PER','HR_289767_SALARY_BASIS_IS_NULL');
1326            fnd_message.raise_error;
1327            end if;
1328        hr_utility.set_location('per_assignments_f_pkg.update_row',20);
1329       end if;
1330     hr_utility.set_location('per_assignments_f_pkg.update_row',30);
1331   end if;
1332 
1333 -- End Bug 2365872
1334 **/
1335 
1336 /************************************/
1337     hr_utility.set_location(g_package || l_proc, 20);
1338 
1339    open perav1(chartorowid(p_row_id));
1340    fetch perav1 into l_organization_id, l_legislation_code,
1341                      l_location_id;
1342    if perav1%notfound then
1343         close perav1;
1344    fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1345    fnd_message.set_token('PROCEDURE',
1346       'PER_ASSIGNMENTS_F1_PKG.UPDATE_ROW');
1347    fnd_message.set_token('STEP', '1');
1348    fnd_message.raise_error;
1349    end if;
1350    close perav1;
1351 
1352     -- start code for bug 6961562
1353 	 -- PO
1354 	l_installed := fnd_installation.get(appl_id => 210
1355 		,dep_appl_id => 210
1356           ,status => l_po_installed
1357           ,industry => l_industry);
1358 
1359 	if l_po_installed <> 'N' then
1360 	open po_cwk;
1361 	fetch po_cwk into l_vendor_id,l_vendor_site_id;
1362 	if po_cwk%found then
1363 	if (l_vendor_id <> p_vendor_id)
1364 	or (l_vendor_site_id <> p_vendor_site_id) then
1365 	PO_HR_INTERFACE_PVT.is_Supplier_Updatable( p_assignment_id => p_assignment_id,
1366                                                p_effective_date => p_session_date );
1367 		end if;
1368 	end if;
1369 	close po_cwk;
1370 	end if;
1371   -- end code for bug 6961562
1372 
1373    --
1374    -- changed p_rowid => null to p_rowid => p_row_id
1375    --
1376     hr_utility.set_location(g_package || l_proc, 30);
1377 
1378     ben_dt_trgr_handle.assignment
1379             (p_rowid                   => p_row_id
1380             ,p_assignment_id           => p_assignment_id
1381             ,p_business_group_id       => p_business_group_id
1382        ,p_person_id               => p_person_id
1383        ,p_effective_start_date    => p_effective_start_date
1384        ,p_effective_end_date      => p_effective_end_date
1385        ,p_assignment_status_type_id  => p_assignment_status_type_id
1386        ,p_assignment_type         => p_assignment_type
1387        ,p_organization_id         => p_organization_id
1388        ,p_primary_flag            => p_primary_flag
1389        ,p_change_reason           => p_change_reason
1390        ,p_employment_category     => p_employment_category
1391        ,p_frequency               => p_frequency
1392        ,p_grade_id                => p_grade_id
1393        ,p_job_id                  => p_job_id
1394        ,p_position_id             => p_position_id
1395        ,p_location_id             => p_location_id
1396        ,p_normal_hours            => p_normal_hours
1397        ,p_payroll_id              => p_payroll_id
1398        ,p_pay_basis_id            => p_pay_basis_id
1399        ,p_bargaining_unit_code    => p_bargaining_unit_code
1400        ,p_labour_union_member_flag => p_labour_union_member_flag
1401             ,p_hourly_salaried_code    => p_hourly_salaried_code
1402             ,p_people_group_id    => p_people_group_id
1403        ,p_ass_attribute1 => p_ass_attribute1
1404        ,p_ass_attribute2 => p_ass_attribute2
1405        ,p_ass_attribute3 => p_ass_attribute3
1406        ,p_ass_attribute4 => p_ass_attribute4
1407        ,p_ass_attribute5 => p_ass_attribute5
1408        ,p_ass_attribute6 => p_ass_attribute6
1409        ,p_ass_attribute7 => p_ass_attribute7
1410        ,p_ass_attribute8 => p_ass_attribute8
1411        ,p_ass_attribute9 => p_ass_attribute9
1412        ,p_ass_attribute10 => p_ass_attribute10
1413        ,p_ass_attribute11 => p_ass_attribute11
1414        ,p_ass_attribute12 => p_ass_attribute12
1415        ,p_ass_attribute13 => p_ass_attribute13
1416        ,p_ass_attribute14 => p_ass_attribute14
1417        ,p_ass_attribute15 => p_ass_attribute15
1418        ,p_ass_attribute16 => p_ass_attribute16
1419        ,p_ass_attribute17 => p_ass_attribute17
1420        ,p_ass_attribute18 => p_ass_attribute18
1421        ,p_ass_attribute19 => p_ass_attribute19
1422        ,p_ass_attribute20 => p_ass_attribute20
1423        ,p_ass_attribute21 => p_ass_attribute21
1424        ,p_ass_attribute22 => p_ass_attribute22
1425        ,p_ass_attribute23 => p_ass_attribute23
1426        ,p_ass_attribute24 => p_ass_attribute24
1427        ,p_ass_attribute25 => p_ass_attribute25
1428        ,p_ass_attribute26 => p_ass_attribute26
1429        ,p_ass_attribute27 => p_ass_attribute27
1430        ,p_ass_attribute28 => p_ass_attribute28
1431        ,p_ass_attribute29 => p_ass_attribute29
1432        ,p_ass_attribute30 => p_ass_attribute30
1433             );
1434 --
1435     hr_utility.set_location(g_package || l_proc, 40);
1436 -- Retrieve Previous assignment_status_id
1437   select assignment_status_type_id into l_previous_asg_status
1438    from  per_assignments_f
1439    where rowid = chartorowid(P_ROW_ID);
1440 
1441     hr_utility.set_location(g_package || l_proc, 45);
1442 
1443   if l_previous_asg_status <> p_assignment_status_type_id
1444   and p_assignment_type = 'A' then
1445    IRC_ASG_STATUS_API.create_irc_asg_status
1446     (p_assignment_id                => p_assignment_id
1447      , p_assignment_status_type_id  => p_assignment_status_type_id
1448      , p_status_change_date         => p_effective_start_date
1449      , p_status_change_reason       => p_change_reason   -- Bug 2676934
1450      , p_assignment_status_id       => l_assignment_status_id
1451      , p_object_version_number      => l_asg_status_ovn);
1452   end if;
1453 
1454     hr_utility.set_location(g_package || l_proc, 50);
1455    update per_assignments_f a
1456    set   a.assignment_id = P_ASSIGNMENT_ID,
1457    a.effective_start_date = P_EFFECTIVE_START_DATE,
1458    a.effective_end_date = P_EFFECTIVE_END_DATE,
1459    a.business_group_id = P_BUSINESS_GROUP_ID,
1460    a.recruiter_id = P_RECRUITER_ID,
1461    a.grade_id = P_GRADE_ID,
1462    a.position_id = P_POSITION_ID,
1463    a.job_id = P_JOB_ID,
1464    a.assignment_status_type_id = P_ASSIGNMENT_STATUS_TYPE_ID,
1465    a.payroll_id = P_PAYROLL_ID,
1466    a.location_id = P_LOCATION_ID,
1467    a.person_referred_by_id = P_PERSON_REFERRED_BY_ID,
1468    a.supervisor_id = P_SUPERVISOR_ID,
1469    a.special_ceiling_step_id = P_SPECIAL_CEILING_STEP_ID,
1470    a.person_id = P_PERSON_ID,
1471    a.recruitment_activity_id = P_RECRUITMENT_ACTIVITY_ID,
1472    a.source_organization_id = P_SOURCE_ORGANIZATION_ID,
1473    a.organization_id = P_ORGANIZATION_ID,
1474    a.people_group_id = P_PEOPLE_GROUP_ID,
1475    a.soft_coding_keyflex_id = P_SOFT_CODING_KEYFLEX_ID,
1476    a.vacancy_id = P_VACANCY_ID,
1477    a.assignment_sequence = P_ASSIGNMENT_SEQUENCE,
1478    a.assignment_type = P_ASSIGNMENT_TYPE,
1479    a.primary_flag = P_PRIMARY_FLAG,
1480    a.application_id = P_APPLICATION_ID,
1481    a.assignment_number = P_ASSIGNMENT_NUMBER,
1482    a.change_reason = P_CHANGE_REASON,
1483    a.comment_id = P_COMMENT_ID,
1484    a.date_probation_end = P_DATE_PROBATION_END,
1485    a.default_code_comb_id = P_DEFAULT_CODE_COMB_ID,
1486    a.frequency = P_FREQUENCY,
1487    a.internal_address_line = P_INTERNAL_ADDRESS_LINE,
1488    a.manager_flag = P_MANAGER_FLAG,
1489    a.normal_hours = P_NORMAL_HOURS,
1490    a.period_of_service_id = P_PERIOD_OF_SERVICE_ID,
1491    a.probation_period = P_PROBATION_PERIOD,
1492    a.probation_unit = P_PROBATION_UNIT,
1493    a.set_of_books_id = P_SET_OF_BOOKS_ID,
1494    a.source_type = P_SOURCE_TYPE,
1495    a.time_normal_finish = P_TIME_NORMAL_FINISH,
1496    a.time_normal_start = P_TIME_NORMAL_START,
1497    a.request_id = P_REQUEST_ID,
1498    a.program_application_id = P_PROGRAM_APPLICATION_ID,
1499    a.program_id = P_PROGRAM_ID,
1500    a.program_update_date = P_PROGRAM_UPDATE_DATE,
1501    a.ass_attribute_category = P_ASS_ATTRIBUTE_CATEGORY,
1502    a.ass_attribute1 = P_ASS_ATTRIBUTE1,
1503    a.ass_attribute2 = P_ASS_ATTRIBUTE2,
1504    a.ass_attribute3 = P_ASS_ATTRIBUTE3,
1505    a.ass_attribute4 = P_ASS_ATTRIBUTE4,
1506    a.ass_attribute5 = P_ASS_ATTRIBUTE5,
1507    a.ass_attribute6 = P_ASS_ATTRIBUTE6,
1508    a.ass_attribute7 = P_ASS_ATTRIBUTE7,
1509    a.ass_attribute8 = P_ASS_ATTRIBUTE8,
1510    a.ass_attribute9 = P_ASS_ATTRIBUTE9,
1511    a.ass_attribute10 = P_ASS_ATTRIBUTE10,
1512    a.ass_attribute11 = P_ASS_ATTRIBUTE11,
1513    a.ass_attribute12 = P_ASS_ATTRIBUTE12,
1514    a.ass_attribute13 = P_ASS_ATTRIBUTE13,
1515    a.ass_attribute14 = P_ASS_ATTRIBUTE14,
1516    a.ass_attribute15 = P_ASS_ATTRIBUTE15,
1517    a.ass_attribute16 = P_ASS_ATTRIBUTE16,
1518    a.ass_attribute17 = P_ASS_ATTRIBUTE17,
1519    a.ass_attribute18 = P_ASS_ATTRIBUTE18,
1520    a.ass_attribute19 = P_ASS_ATTRIBUTE19,
1521    a.ass_attribute20 = P_ASS_ATTRIBUTE20,
1522    a.ass_attribute21 = P_ASS_ATTRIBUTE21,
1523    a.ass_attribute22 = P_ASS_ATTRIBUTE22,
1524    a.ass_attribute23 = P_ASS_ATTRIBUTE23,
1525    a.ass_attribute24 = P_ASS_ATTRIBUTE24,
1526    a.ass_attribute25 = P_ASS_ATTRIBUTE25,
1527    a.ass_attribute26 = P_ASS_ATTRIBUTE26,
1528    a.ass_attribute27 = P_ASS_ATTRIBUTE27,
1529    a.ass_attribute28 = P_ASS_ATTRIBUTE28,
1530    a.ass_attribute29 = P_ASS_ATTRIBUTE29,
1531    a.ass_attribute30 = P_ASS_ATTRIBUTE30,
1532    a.sal_review_period = P_SAL_REVIEW_PERIOD,
1533    a.sal_review_period_frequency = P_SAL_REVIEW_PERIOD_FREQUENCY,
1534    a.perf_review_period = P_PERF_REVIEW_PERIOD,
1535    a.perf_review_period_frequency = P_PERF_REVIEW_PERIOD_FREQUENCY,
1536    a.pay_basis_id = P_PAY_BASIS_ID,
1537    a.employment_category = P_EMPLOYMENT_CATEGORY,
1538         a.bargaining_unit_code = P_BARGAINING_UNIT_CODE,
1539         a.labour_union_member_flag = P_LABOUR_UNION_MEMBER_FLAG,
1540         a.hourly_salaried_code = P_HOURLY_SALARIED_CODE,
1541    a.collective_agreement_id = P_COLLECTIVE_AGREEMENT_ID,
1542    a.cagr_grade_def_id       = P_CAGR_GRADE_DEF_ID,
1543    a.establishment_id        = P_ESTABLISHMENT_ID,
1544    a.contract_id             = P_CONTRACT_ID,
1545    a.cagr_id_flex_num        = P_CAGR_ID_FLEX_NUM,
1546         a.notice_period      = P_NOTICE_PERIOD,
1547         a.notice_period_uom       = P_NOTICE_PERIOD_UOM,
1548         a.work_at_home       = P_WORK_AT_HOME,
1549         a.employee_category     = P_EMPLOYEE_CATEGORY,
1550         a.job_post_source_name    = P_JOB_POST_SOURCE_NAME,
1551         a.period_of_placement_date_start = p_placement_date_start,
1552         a.vendor_id               = p_vendor_id,
1553         a.vendor_employee_number  = p_vendor_employee_number,
1554         a.vendor_assignment_number = p_vendor_assignment_number,
1555         a.assignment_category     = p_assignment_category,
1556         a.title                   = p_title,
1557         a.project_title           = p_project_title,
1558         a.grade_ladder_pgm_id     = p_grade_ladder_pgm_id,
1559         a.supervisor_assignment_id = p_supervisor_assignment_id,
1560         a.vendor_site_id           = p_vendor_site_id,
1561         a.po_header_id             = p_po_header_id,
1562         a.po_line_id               = p_po_line_id,
1563         a.projected_assignment_end = p_projected_assignment_end
1564  where a.rowid = chartorowid(P_ROW_ID);
1565 --
1566 -- Start of fix 3815024
1567     hr_utility.set_location(g_package || l_proc, 60);
1568 
1569 /*if l_organization_id = p_business_group_id and
1570    p_organization_id <> p_business_group_id then*/ -- Commented for bug 6167879
1571    --
1572    hr_security_internal.clear_from_person_list(
1573                         p_person_id => p_person_id);
1574    --
1575 /*end if;*/ -- Commented for 6167879
1576 --
1577     hr_utility.set_location(g_package || l_proc, 70);
1578 
1579 hr_security_internal.add_to_person_list(
1580                      p_effective_date => p_effective_start_date,
1581                      p_assignment_id  => p_assignment_id);
1582 -- End of fix 3815024
1583 --
1584 /*  OPEN  get_install_info;
1585 FETCH get_install_info INTO l_status;
1586 CLOSE get_install_info; */
1587 
1588 /* Added call to maintain the denormalized table, For 420029 lwthomps */
1589 /* Added call to create tax records, 268389 lwthomps */
1590 /* Taken out nocopy comment from if legislation_code = 'US', Bug: 1196833 */
1591  IF   l_legislation_code = 'US' then
1592 --   AND l_status = 'I'
1593 --   AND p_assignment_type = 'E' THEN
1594 
1595    IF p_assignment_type = 'E' THEN
1596 --
1597      IF p_payroll_id IS NOT NULL AND p_pay_basis_id IS NOT NULL THEN
1598 --
1599 --
1600        if  l_location_id_changed <> 1 then
1601         l_location_id := NULL;
1602         l_dt_update_mode := NULL;
1603        else
1604         l_location_id := p_location_id;
1605         l_dt_update_mode := p_dt_update_mode;
1606        end if;
1607 
1608     hr_utility.set_location(g_package || l_proc, 80);
1609 
1610        pay_us_emp_dt_tax_rules.default_tax_with_validation(
1611                               p_assignment_id        => p_assignment_id,
1612                               p_person_id            => p_person_id,
1613                               p_effective_start_date => p_effective_start_date,
1614                               p_effective_end_date => p_effective_end_date,
1615                               p_session_date         => p_session_date,
1616                               p_business_group_id    => p_business_group_id,
1617                               p_from_form            => 'Assignment',
1618                               p_mode                 => l_dt_update_mode,
1619                               p_location_id          => l_location_id,
1620                               p_return_code          => l_return_code,
1621                               p_return_text          => l_return_text);
1622   END IF;
1623 --
1624   pay_asg_geo_pkg.pay_us_asg_rpt( p_assignment_id );
1625 --
1626 END IF;
1627 END IF; /* End of legislation code check */
1628 /*
1629   --WWBUG 2130950 Begin hrwf synchronization --tpapired
1630     open l_asg_cur;
1631    fetch l_asg_cur into l_asg_rec;
1632    close l_asg_cur;
1633    per_hrwf_synch.PER_ASG_WF(
1634                   p_rec    => l_asg_rec,
1635                p_action => 'UPDATE');
1636   --WWBUG 2130950 End hrwf synchronization --tpapired
1637 */
1638 --
1639 end update_row;
1640 /****************************/
1641 --
1642 procedure dml_promotion(
1643         p_assignment_id   number,
1644         p_promotion_date  date,
1645         p_prom_flag       char) is
1646 --
1647   cursor c_promotion_exists is
1648     select assignment_extra_info_id, object_version_number
1649     from per_assignment_extra_info
1650      where  assignment_id = p_assignment_id
1651      and    information_type = 'PROMOTION'
1652      and    fnd_date.canonical_to_date(aei_information1) = p_promotion_date;
1653 --
1654   l_promotion_rec c_promotion_exists%rowtype;
1655   l_assignment_extra_info_id number;
1656   l_object_version_number    number;
1657 --
1658 l_proc            varchar2(13) :=  'dml_promotion';
1659 --
1660 begin
1661 --  g_debug := hr_utility.debug_enabled; -- get debug status
1662   IF g_debug THEN
1663     hr_utility.set_location('Entering: '|| g_package || l_proc, 5);
1664   END IF;
1665 
1666   open c_promotion_exists;
1667   fetch c_promotion_exists into l_promotion_rec;
1668   if p_prom_flag = 'Y' then
1669      if c_promotion_exists%notfound then
1670        hr_assignment_extra_info_api.create_assignment_extra_info(
1671         p_assignment_id            =>  p_assignment_id
1672        ,p_information_type         => 'PROMOTION'
1673        ,p_aei_information_category => 'PROMOTION' -- #1965910
1674        ,p_aei_information1         => p_promotion_date
1675        ,p_assignment_extra_info_id => l_assignment_extra_info_id
1676        ,p_object_version_number    => l_object_version_number
1677                                                                  );
1678      end if;
1679   else
1680      if c_promotion_exists%found then
1681        hr_assignment_extra_info_api.delete_assignment_extra_info(
1682           p_assignment_extra_info_id => l_promotion_rec.assignment_extra_info_id
1683          ,p_object_version_number    => l_promotion_rec.object_version_number
1684                                                                 );
1685      end if;
1686   end if;
1687 --
1688   close c_promotion_exists;
1689 --
1690     hr_utility.set_location('Leaving: '|| g_package || l_proc, 10);
1691 --
1692 end dml_promotion;
1693 -----------------------------------------------------------------------------
1694 --
1695 -- ****  End of standard ON-* checks.  ****
1696 --
1697 -----------------------------------------------------------------------------
1698 --
1699 END PER_ASSIGNMENTS_F_PKG;